Class HttpInputSourceDefn

  • All Implemented Interfaces:
    InputSourceDefn

    public class HttpInputSourceDefn
    extends FormattedInputSourceDefn
    Definition of an HTTP input source source.

    Provides a parameterized form where the user defines a value for the uriTemplate table property in the table spec, then provides the partial URLs in a table function to use for that one query. The final URIs are created by combining the template and the arguments. Example:

  • uriTemplate property): "http://example.com/data/kttm-{}.json"
  • uris function argument: "22-Nov-21, 22-Nov-22"

When the template is used, the format is optional: it can be provided either with the table spec or at runtime, depending on what the user wants to accomplish. In the above, where the ".json" is encoded in the template, it makes sense to include the format with the spec. If the template was "http://example.com/data/{}", and the data comes in multiple formats, it might make sense to specify the format in the query. In this case, the table spec acts more like a connection.

If the template is not used, then the uris property must be provided in the table spec, along with the corresponding format.

The above semantics make a bit more sense when we realize that the spec can also provide a user name and password. When those are provided, then the input source must name a single site: the one for which the credentials are valid. Given this, the only table spec that makes sense is one where the URI is defined: either as a template or explicitly.

When used as an ad-hoc function, the user specifies the uris and optional user name and password: the template is not available (or useful) in the ad-hoc case.

Table function parameters are cleaned up relative to the input source field names to make them a bit easier to use.