com.softwareag.connectivity.httpclient
Event HttpTransport


Holds a chain instance which is configured to invoke HTTP requests using pre-defined event types and HTTP Client Transport connectivity plug-in. It should be used to create new HTTP requests.

The chain instances are configured to handle events of type Request and Response. The payload is converted into or converted from appropriate payload format based on the connectivity plug-in codecs defined for the chain.

The static actions starting with getOrCreate should be used to get an instance with desired configurations. The actions with names similar to createRequest and createAndExecuteRequest should be used to create a request which then should be executed.

Note that chain instances created by the event are not persisted even if the event is used from persistent monitor. So new instances should be obtained using actions similar to getOrCreate on recovery.
See Also:
com.softwareag.connectivity.httpclient.Request - 
com.softwareag.connectivity.httpclient.Response - 

Constant summary
 stringCONFIG_AUTH_TYPE := "authenticationType"

The configuration name to specify the authentication type configuration of the HTTP transport. The default value is none.
 stringCONFIG_BASE_PATH := "basePath"

The configuration name to specify the basePath configuration of the HTTP transport. The default value is an empty string.
 stringCONFIG_DYNAMIC_CHAIN_DEF_NAME := "dynamicChainDefinitionName"

The configuration name to specify the name of dynamic chain definition to use for the chain instances. The default value is HTTPClientGenericJSONChain.
 stringCONFIG_PASSWORD := "password"

The configuration name to specify the password configuration of the HTTP transport. The default value is an empty string.
 stringCONFIG_PROXY_AUTH_TYPE := "proxyAuthenticationType"

The configuration name to specify the proxy authentication type configuration of the HTTP transport. The default value is none.
 stringCONFIG_PROXY_HOST := "proxyHost"

The configuration name to specify the proxy host configuration of the HTTP transport. The default value is an empty string which means no proxy server.
 stringCONFIG_PROXY_PASSWORD := "proxyPassword"

The configuration name to specify the proxy password configuration of the HTTP transport. The default value is an empty string.
 stringCONFIG_PROXY_PORT := "proxyPort"

The configuration name to specify the proxy port configuration of the HTTP transport. A port value must be provided if a proxy server is specified in the CONFIG_PROXY_HOST.
 stringCONFIG_PROXY_USERNAME := "proxyUsername"

The configuration name to specify the proxy username configuration of the HTTP transport when proxyAuthenticationType is HTTP_BASIC. The default value is an empty string.
 stringCONFIG_TIMEOUT_SECS := "timeoutSecs"

The configuration name to specify the timeoutSecs configuration of the HTTP transport. The default value is 120 seconds.
 stringCONFIG_TLS := "tls"

The configuration name to specify tls configuration of the HTTP transport. The default value is false.
 stringCONFIG_TLS_ACCEPT_UNRECOGNIZED_CERTS := "tlsAcceptUnrecognizedCertificates"

The configuration name to specify the tlsAcceptUnrecognizedCertificates configuration of the HTTP transport. The default value is false.
 stringCONFIG_TLS_CERT_AUTH_FILE := "tlsCertificateAuthorityFile"

The configuration name to specify the tlsCertificateAuthorityFile configuration of the HTTP transport. The default value is an empty string.
 stringCONFIG_USERNAME := "username"

The configuration name to specify the username configuration of the HTTP transport. The default value is an empty string.
 
Action summary
 voidcreateAndExecuteRequest(string method, string path, any payload, com.softwareag.connectivity.httpclient.HttpOptions options, action<com.softwareag.connectivity.httpclient.Response> callback)

Create an HTTP request and execute it. The callback action is executed when the corresponding response is received.
 com.softwareag.connectivity.httpclient.RequestcreateDELETERequest(string path)

Create an HTTP DELETE request for the specified path.
 com.softwareag.connectivity.httpclient.RequestcreateGETRequest(string path)

Create an HTTP GET request for the specified path.
 com.softwareag.connectivity.httpclient.RequestcreatePOSTRequest(string path, any payload)

Create an HTTP POST request for the specified path and the payload.
 com.softwareag.connectivity.httpclient.RequestcreatePUTRequest(string path, any payload)

Create an HTTP PUT request for the specified path and the payload.
 com.softwareag.connectivity.httpclient.RequestcreateRequest(string method, string path, any payload, com.softwareag.connectivity.httpclient.HttpOptions options)

Create an HTTP request which can be further customized and then executed.
 dictionary<stringstring>static defaultConfigurations()

Return a dictionary populated with the default values for the configuration options used for the HTTP client transport and name of the dynamic chain definition to use for the chain instances.
 com.softwareag.connectivity.httpclient.HttpTransportstatic getOrCreate(string host, integer port)

Create a new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain for the specified host, port and default configurations. It enables the TLS if the value of the port is 443.
 com.softwareag.connectivity.httpclient.HttpTransportstatic getOrCreateWithConfigurations(string host, integer port, dictionary<stringstring> configurations)

Create a new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain for the specified host, port, and configurations.
 
Constant detail

CONFIG_AUTH_TYPE

            string CONFIG_AUTH_TYPE := "authenticationType"
        
The configuration name to specify the authentication type configuration of the HTTP transport. The default value is none.

CONFIG_BASE_PATH

            string CONFIG_BASE_PATH := "basePath"
        
The configuration name to specify the basePath configuration of the HTTP transport. The default value is an empty string.

CONFIG_DYNAMIC_CHAIN_DEF_NAME

            string CONFIG_DYNAMIC_CHAIN_DEF_NAME := "dynamicChainDefinitionName"
        
The configuration name to specify the name of dynamic chain definition to use for the chain instances. The default value is HTTPClientGenericJSONChain.

CONFIG_PASSWORD

            string CONFIG_PASSWORD := "password"
        
The configuration name to specify the password configuration of the HTTP transport. The default value is an empty string.

CONFIG_PROXY_AUTH_TYPE

            string CONFIG_PROXY_AUTH_TYPE := "proxyAuthenticationType"
        
The configuration name to specify the proxy authentication type configuration of the HTTP transport. The default value is none.

CONFIG_PROXY_HOST

            string CONFIG_PROXY_HOST := "proxyHost"
        
The configuration name to specify the proxy host configuration of the HTTP transport. The default value is an empty string which means no proxy server.

CONFIG_PROXY_PASSWORD

            string CONFIG_PROXY_PASSWORD := "proxyPassword"
        
The configuration name to specify the proxy password configuration of the HTTP transport. The default value is an empty string.

CONFIG_PROXY_PORT

            string CONFIG_PROXY_PORT := "proxyPort"
        
The configuration name to specify the proxy port configuration of the HTTP transport. A port value must be provided if a proxy server is specified in the CONFIG_PROXY_HOST.

CONFIG_PROXY_USERNAME

            string CONFIG_PROXY_USERNAME := "proxyUsername"
        
The configuration name to specify the proxy username configuration of the HTTP transport when proxyAuthenticationType is HTTP_BASIC. The default value is an empty string.

CONFIG_TIMEOUT_SECS

            string CONFIG_TIMEOUT_SECS := "timeoutSecs"
        
The configuration name to specify the timeoutSecs configuration of the HTTP transport. The default value is 120 seconds.

CONFIG_TLS

            string CONFIG_TLS := "tls"
        
The configuration name to specify tls configuration of the HTTP transport. The default value is false.

CONFIG_TLS_ACCEPT_UNRECOGNIZED_CERTS

            string CONFIG_TLS_ACCEPT_UNRECOGNIZED_CERTS := "tlsAcceptUnrecognizedCertificates"
        
The configuration name to specify the tlsAcceptUnrecognizedCertificates configuration of the HTTP transport. The default value is false.

CONFIG_TLS_CERT_AUTH_FILE

            string CONFIG_TLS_CERT_AUTH_FILE := "tlsCertificateAuthorityFile"
        
The configuration name to specify the tlsCertificateAuthorityFile configuration of the HTTP transport. The default value is an empty string.

CONFIG_USERNAME

            string CONFIG_USERNAME := "username"
        
The configuration name to specify the username configuration of the HTTP transport. The default value is an empty string.
Action detail

createAndExecuteRequest

            void createAndExecuteRequest(string method, string path, any payload, com.softwareag.connectivity.httpclient.HttpOptions options, action<com.softwareag.connectivity.httpclient.Response> callback)
        
Create an HTTP request and execute it. The callback action is executed when the corresponding response is received.
Parameters:
method - The HTTP method to use for the request.
path - The HTTP URI for the request.
payload - The payload of the HTTP request.
options - Optional HTTP options to specify headers, cookies and query parameters.
callback - The callback action which gets called on the response.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 
com.softwareag.connectivity.httpclient.RequestType - 

createDELETERequest

            com.softwareag.connectivity.httpclient.Request createDELETERequest(string path)
        
Create an HTTP DELETE request for the specified path.

This is equivalent to calling createRequest(RequestType.DELETE, path, new any, new HttpOptions).
Parameters:
path - The HTTP URI for the request.
Returns:
A new Request event instance which could be further customized and then should be executed by calling the execute() action.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 

createGETRequest

            com.softwareag.connectivity.httpclient.Request createGETRequest(string path)
        
Create an HTTP GET request for the specified path.

This is equivalent to calling createRequest(RequestType.GET, path, new any, new HttpOptions).
Parameters:
path - The HTTP URI for the request.
Returns:
A new Request event instance which could be further customized and then should be executed by calling the execute() action.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 

createPOSTRequest

            com.softwareag.connectivity.httpclient.Request createPOSTRequest(string path, any payload)
        
Create an HTTP POST request for the specified path and the payload.

This is equivalent to calling createRequest(RequestType.POST, path, payload, new HttpOptions).
Parameters:
path - The HTTP URI for the request.
payload - The payload for the request.
Returns:
A new Request event instance which could be further customized and then should be executed by calling the execute() action.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 

createPUTRequest

            com.softwareag.connectivity.httpclient.Request createPUTRequest(string path, any payload)
        
Create an HTTP PUT request for the specified path and the payload.

This is equivalent to calling createRequest(RequestType.PUT, path, payload, new HttpOptions).
Parameters:
path - The HTTP URI for the request.
payload - The payload for the request.
Returns:
A new Request event instance which could be further customized and then should be executed by calling the execute() action.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 

createRequest

            com.softwareag.connectivity.httpclient.Request createRequest(string method, string path, any payload, com.softwareag.connectivity.httpclient.HttpOptions options)
        
Create an HTTP request which can be further customized and then executed.
Parameters:
method - The HTTP method to use for the request.
path - The HTTP URI for the request.
payload - The payload of the HTTP request.
options - Optional HTTP options to specify headers, cookies and query parameters.
Returns:
A new Request event instance which should be executed by calling the execute action.
See Also:
com.softwareag.connectivity.httpclient.Request#execute() - 
com.softwareag.connectivity.httpclient.RequestType - 

defaultConfigurations

            dictionary<stringstring> static defaultConfigurations()
        
Return a dictionary populated with the default values for the configuration options used for the HTTP client transport and name of the dynamic chain definition to use for the chain instances.

Look at the constants starting with CONFIG for the supported configurations and their default values. Look at the documentation of the HTTP Client Transport connectivity plug-in for more information about the configurations.
Returns:
A dictionary with the default configuration values.

getOrCreate

            com.softwareag.connectivity.httpclient.HttpTransport static getOrCreate(string host, integer port)
        
Create a new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain for the specified host, port and default configurations. It enables the TLS if the value of the port is 443.

This is equivalent to calling getOrCreateWithConfigurations(host, port, {CONFIG_TLS:(port = 443).toString()}).
Parameters:
host - The host address.
port - The port number.
Returns:
A new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain.
See Also:
getOrCreateWithConfigurations() - 

getOrCreateWithConfigurations

            com.softwareag.connectivity.httpclient.HttpTransport static getOrCreateWithConfigurations(string host, integer port, dictionary<stringstring> configurations)
        
Create a new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain for the specified host, port, and configurations.

If a chain instance for the specified host, port, basePath and username values already exist then it is used ignoring other configurations otherwise a new instance with the specified configurations is created.

The name of dynamic chain definition to use for the chain instances can be passed through the configurations dictionary. HTTPClientGenericJSONChain is used as dynamic chain definition name if it is not provided.
Parameters:
host - The host address.
port - The port number.
configurations - The dictionary to provide values for the configuration options to override the default values. For any configurations not specified in the dictionary, their default values are used. Look at the constants starting with CONFIG for the supported configurations and their default values.
Returns:
A new instance of the HttpTransport event holding an instance of the HTTP client connectivity chain.
Throws:
Throws IllegalArgumentException if an unknown configuration is specified in the configurations dictionary.