Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This feature will be available with V3.4 of the software.

...

Two options for request creation exist, one for simple GET requests and one for more complex POST requests with a body. Both rely on a <URLTemplate> element to produce the URL, which can be populated with dependency data much like an LDAP search filter or database query. The POST option also supports a <BodyTemplate> element that can similarly generate a request body based on dependency data, typically JSON or XML. With POST, you also can control caching of results (if a results cache is used) by generating a cache entry key using a <CacheKeyTemplate> element.

The only supplied implementation for response processing is script-based, using the <ResponseMapping> element to supply a script to produce attribute data from the response body. For efficiency, the implementation assumes that the response processing script can consume the results in real time, and leaves any buffering of the data to the script, should that be necessary. Support is built-in for limiting the size of the data, allowed content types, and HTTP status codes accepted, to address the most common sanity checks.

...

NameTypeDefaultDescription
httpClientRefBean ID
Bean ID of the HttpClient instance to use
httpClientSecurityParametersRefBean ID
Bean ID of the HttpClientSecurityParameters instance to use, ignored if one of the security shortcut settings are used
serverCertificateResource path
Path of resource containing a server certificate whose public key must match the server's. If set, httpClientSecurityParametersRef is ignored.
certificateAuthorityResource path
Path of resource containing a certificate authority used to validate the server's certificate. If set, httpClientSecurityParametersRef is ignored.
clientPrivateKeyResource path
Path of resource containing a private key used to authenticate the client to the server via TLS. If set, httpClientSecurityParametersRef is ignored.
clientCertificateResource path
Path of resource containing a certificate used to authenticate the client to the server via TLS. If set, httpClientSecurityParametersRef is ignored.
maxLengthLong0Limits size of response body to accept, or 0 for no limit. When used, only  non-chunked responses that include a content length will be accepted.
acceptStatusesCollection<Integer>200Acceptable HTTP status codes
acceptTypesCollection<String>
Acceptable MIME content types
headerMapRefMap<String,String>
Bean ID of a map of custom header names and values to set in the HTTP request

mappingStrategyRef

Bean ID
Bean ID of a HTTPResponseMappingStrategy to process the result set in a pluggable way
validatorRef
Bean ID
Bean ID of a Validator to control what constitutes an initialization failure (the default does no validation)
executableSearchBuilderRefBean ID
Bean ID of an ExecutableSearchBuilder<HTTPSearch> to produce the request to execute

templateEngine

Bean ID
Bean ID of a org.apache.velocity.app.VelocityEngine to use for processing the URL template, generally unnecessary

...

NameCardinalityDescription

<URLTemplate>

0 or 1Template of a URL to execute via HTTP GET or POST
<BodyTemplate>0 or 1Template for a request body to submit via HTTP POST, requires use of <URLTemplate>
<CacheKeyTemplate>0 or 1Template to produce a cache key to associate with the result of an HTTP POST, requires use of <BodyTemplate>
<ResponseMapping>0 or 1Inline or external script to execute to process the response body

<ResultCache>


0 or 1

Defines how results should be cached.

<ResultCacheBean>

Bean ID (in the element content) defining how results should be cached as an externally defined com.google.common.cache.Cache<String,Map<String,IdPAttribute>> 

Externally (Spring) Defined Content

...

In practice, the HTTP Data Connector may be supplied with beans of the following types:

In addition native bean IDs can be injected as follows:

  1. The HttpClient instance and its security settings are injected via the httpClientRef and httpClientSecurityParametersRef attributes.
  2. The builder for the request can be specified as an externally defined bean via the executableSearchBuilderRef attribute (as a replacement for the <URLTemplate> element and related elements). This allows for complete generality of the request-building process.
  3. The processing of the response can be specified with an externally defined bean via the mappingStrategyRef attribute (as a replacement for the <ResponseMapping> element).
  4. The caching of results can be specified as an externally defined bean via the <ResultCacheBean> element (as a replacement for the <ResultCache> element).
  5. Rarely, a non-default Velocity engine can be injected via the templateEngine attribute.