http feature

HTTP Feature

Version: 17.07

Supported Since: 17.07

HTTP Feature

HTTP Feature provides a collection of API methods that can be used to process HTTP/S transport informations.

APIs Java Docs

getJvmRoute

Parameters
XMessageContext msgContext

The message context contains the current message to extract jvmRoute

Returns
Optional<String>

The Tomcat jvmRoute from the session

This API can be used to retrieves the jvmRoute from the JSESSIONID cookie or jsessionid URL parameter of an HTTP/S request

getCookie

Parameters
XMessageContext msgContext

The message context contains the message to extract cookie

String name

The name of the cookie

Returns
Optional<String>

The value of the cookie according to the given name.

This API can be used to retrieves the value of the cookie with the given name.

setCookie

Parameters
XMessageContext msgContext

The message context contains the response message to set the cookie on

String name

The name of the cookie

String value

The value of the cookie

String path

The path for the cookie

String domain

The domain for the cookie

int age

The max age for the cookie(seconds)

boolean true

If cookie is secure

This API can be used to sets a HTTP cookie on the message.

setCookie

Parameters
XMessageContext msgContext

The message context contains the response message to set the cookie on

String name

The name of the cookie

String value

The value of the cookie

String path

The path for the cookie

int age

The max age for the cookie(seconds)

This API can be used to sets a HTTP cookie on the message. This setting cookie exclude domian and secure attributes.

setCookie

Parameters
XMessageContext msgContext

The message context contains the response message to set the cookie on

String name

The name of the cookie

String value

The value of the cookie

This API can be used to sets a HTTP cookie on the message. This setting cookie exclude path, domian, age and secure attributes.

addPreemptiveBasicAuthentication

Parameters
XMessageContext msgContext

The message context contains the message to add an HTTP 'Authorization' header for basic authentication

String username

The username which used to authenticate

String password

The password which is used to authenticate

Charset charset

The character set for the credentials

boolean proxy

If header should be for proxy authentication or WWW authentication

This API can be used to adds an HTTP transport header for preemptive basic authentication for this message.

Preemptive basic authentication will perform better than basic authentication after an initial request fails with an HTTP 401 authentication required response. However, basic authentication will not be secure as digest authentication or other such mechanisms. It is recommended that basic authentication if used, should be over an SSL secured connection - in which case the authentication security would be acceptable.

addPreemptiveBasicAuthentication

Parameters
XMessageContext msgContext

The message context contains the message to add an HTTP 'Authorization' header for basic authentication

String username

The username which used to authenticate in US-ASCII character set

String password

The password which is used to authenticate in US-ASCII character set

This API can be used to adds an HTTP transport header for preemptive basic authentication for this message. In this API used to US-ASCII character set dor the authentication credentails. And this API set WWW authentication header.

Preemptive basic authentication will perform better than basic authentication after an initial request fails with an HTTP 401 authentication required response. However, basic authentication will not be secure as digest authentication or other such mechanisms. It is recommended that basic authentication if used, should be over an SSL secured connection - in which case the authentication security would be acceptable.

getFirstRequestParameter

Parameters
XMessageContext msgContext

The message context contains the message to extract request parameter

String key

The name or key of the query parameter

Returns
Optional<String>

The first value of the query parameter (if multiple values are present for this name) or empty Optional

This API can be used to retrieves the first request query parameter with the given name.

removeRequestParameter

Parameters
XMessageContext msgContext

The message context contains the message

String key

The name or key of the query parameter

Returns
List<String>

Removed request parameter values as a list

This API can be used to removes the request query parameter with the given name.

addRequestParameter

Parameters
XMessageContext msgContext

The message context contains the message to set the outgoing query parameter

String name

The name of the query parameter

String value

The value of the query parameter

This API can be used to adds an outgoing query parameter with the given name.

getRequestParameterMap

Parameters
XMessageContext msgContext

The message context contains the message to extract query parameter map

Returns
Optional<String>

Query parameter Map which in cuurent meesage or an empty Map

This API can be used to retrieves the query parameters as a Map from the message which in given message context.

getRequestParameterValues

Parameters
XMessageContext msgContext

The message context contains the message to extract query parameter list

String key

The name or key of the query paramters

Returns
Optional<String>

List of values with the given name/key or an empty List

This API can be used to retrieves the list of query parameters for the given name/key from the message which in given message context.

getRemoteAddress

Parameters
XMessageContext msgContext

The message context contains the remote address to be retrieved

Returns
Optional<String>

The remote address of the given message context

This API can be used to retrieves the remote address of the given message context.

getRemotePort

Parameters
XMessageContext msgContext

The message context contains the remote port to be retrieved

Returns
Optional<Integer>

The remote port of the given message context

This API can be used to retrieves the remote port of the given message context.

getLocalAddress

Parameters
XMessageContext msgContext

The message context contains the local address to be retrieved

Returns
Optional<String>

The local address of the network interface via which the given message context has been received

This API can be used to retrieves the local address of the network interface via which the given message context has been received to the ESB.

getLocalPort

Parameters
XMessageContext msgContext

The message context contains the local port to be retrieved

Returns
Optional<Integer>

The local port of the network interface via which the given message context has been received

This API can be used to retrieves the local port of the network interface via which the given message context has been received to the ESB.

getMethod

Parameters
XMessageContext msgContext

The message context contains the message of which the received HTTP method to be retrieved

Returns
Method

The received HTTP method of the given message

This API can be used to retrieves the given methods receiving transport.http.nioHTTP method, could be one of

  • GET

  • POST

  • PUT

  • DELETE}</li>

  • HEAD

  • OPTIONS

  • PATCH

  • TRACE

setMethod

Parameters
XMessageContext msgContext

The message context contains the message to which the HTTP method to be set

Method method

The HTTP method to be set

This API can be used to sets the HTTP method for the current message effective for the next HTTP send action.

getReceivedMessageSize

Parameters
XMessageContext msgContext

The message context contains the message of which the received size to be retrieved

Returns
Long

The received message size over HTTP of the given message

This API can be used to retrieves the size of the received message over HTTP, of the given message - This is only available for requests and responses received and not for messages about to be sent out.

getReceivedHeaderSize

Parameters
XMessageContext msgContext

The message context contains the message of which the received header size to be retrieved

Returns
Long

The received message header size over HTTP of the given message

This API can be used to retrieves the size of the received header over HTTP, of the given message - This is only available for requests and responses received and not for messages about to be sent out.

getReceivedEntitySize

Parameters
MessageContext msgContext

The message context contains the message of which the received header size to be retrieved

Returns
Long

The received message entity size over HTTP of the given message

This API can be used to retrieves the size of the received header over HTTP, of the given message - This is only available for requests and responses received and not for messages about to be sent out.

getAuthenticatedUsername

Parameters
MessageContext msgContext

The message context contains the message of which the authenticated username to be fetched

Returns
Optional<String>

The authenticated username of the given message

This API can be used to retrieves the authenticated username of the given message.

getAuthenticatedRolesString

Parameters
MessageContext msgContext

The message context contains the message of which the authenticated user roles to be fetched

Returns
Optional<String>

The authenticated roles as a serialized String of the given message

This API can be used to retrieves the authenticated user roles as a serialized String of the given message.

getAuthenticatedRolesArray

Parameters
MessageContext msgContext

The message context contains the message of which the authenticated user roles to be fetched

Returns
String[]

The authenticated user roles as an array of the given message

This API can be used to retrieves the authenticated user roles of the given message as a String array.

setAuthenticationCredentials

Parameters
MessageContext msgContext

The message context contains the message to which the authentication credentials to be set

String username

The authentication username to be set

String password

The authentication password to be set

This API can be used to sets the authentication username and password to be used by HTTP authenticators.

setAuthenticationCredentials

Parameters
MessageContext msgContext

The message context contains the message to which the authentication credentials to be set

String username

The authentication username to be set

String password

The authentication password to be set

String scheme

The authentication scheme to be set

This API can be used to sets the authentication username and password to be used by HTTP authenticators according to the given authentication scheme.

getServiceURL

Parameters
MessageContext msgContext

The message context contains the received service URL to be fetched

Returns
Optional<String>

The received service URL over the HTTP transport

This API can be used to retrieves the service URL of the given message context as seen at the message arrival to the ESB.

getQueryString

Parameters
MessageContext msgContext

The message context contains the message of which the query string to be retrieved

Returns
Optional<String>

The query string of the given message

This API can be used to retrieves the String representation of URL query parameters of the given message received over HTTP/S transport.

setForcedHost

Parameters
MessageContext msgContext

The message context contains the message to which the forced host header is set

String hostName

The host name to be forced regardless of the endpoint address

This API can be used to forces the specified host name for any HTTP request going out after this call through the HTTP transport.

setForwardUrlPostfix

Parameters
MessageContext msgContext

The message context contains the message to which the url postfix should be appended

String postfix

The postfix to be appended to the forward url

This API can be used to appends the given postfix to the HTTP url of the given message.

setResponseStatusLine

Parameters
MessageContext msgContext

The message context contains the message to which to response status line being set

int responseCode

The status code of the response code

String responseReasonMessage

The reason for above status code

This API can be used to sets response status line on the out going message.

setResponseStatusLine

Parameters
MessageContext msgContext

The message context contains the message to which to response status line being set

int responseCode

The status code of the response code

This API can be used to sets response status line on the out going message.

checkBasicAuthentication

Parameters
MessageContext msgContext

The message context contains the message which includes authentication details

String realmName

The name of the authentication realm

boolean ignoreFailure

Authentication failure should be ignore or not. True if authentication failure is ignored. Otherwise authenticator consider failure

String credentialsCharset

The character set for the credentials

UserDetailsService userDetailsService

org.springframework.security.core.userdetails.UserDetailsService object which includes user details

AuthenticationManager authenticationManager

org.springframework.security.authentication.AuthenticationManage which to be used to verify authentication

boolean enableCaching

User detail caching enable or not

String projectId

The identifier of the project

String processElmId

The identifier of the processing element

String flowId

The identifier of the flow

Returns
Optional<String>

Return true if basic authentication success, false otherwise

This API can be used to validates whether this HTTP request has basic authentication and whether these authentication details are correct or not. If basic authentication has succeeded then return true. Otherwise return false.

checkBasicAuthentication

Parameters
MessageContext msgContext

The message context contains the message which includes authentication details

String realmName

The name of the authentication realm

boolean ignoreFailure

Authentication failure should be ignore or not. True if authentication failure is ignored. Otherwise authenticator consider failure

String credentialsCharset

The character set for the credentials

UserDetailsService userDetailsService

org.springframework.security.core.userdetails.UserDetailsService object which includes user details

AuthenticationManager authenticationManager

org.springframework.security.authentication.AuthenticationManage which to be used to verify authentication

Returns
Optional<String>

Return true if basic authentication success, false otherwise

This API can be used to validates whether this HTTP request has basic authentication and whether these authentication details are correct or not, without using user detail caching. If basic authentication has succeeded then return true. Otherwise return false.

checkDigestAuthentication

Parameters
MessageContext msgContext

The message context contains the message which includes authentication details

String realmName

The name of the authentication realm

boolean ignoreFailure

Authentication failure should be ignore or not. True if authentication failure is ignored. Otherwise authenticator consider failure

String credentialsCharset

The character set for the credentials

UserDetailsService userDetailsService

org.springframework.security.core.userdetails.UserDetailsService object which includes user details

int nonceValidateSeconds

The nonce value valid time period(seconds)

String key

The key represent the private key which is used to generate nonce value

boolean passwordAlreadyEncoded

True if the password argument is already encoded in the correct format. False if it is plain text.

AuthHashAlgorithm algorithm

The algorithm used to produce the digest and an un-keyed digest as an instance of org.adroitlogic.x.feature.http.HttpConstants.Authentication

QoP qop

The qop(quality of protection) directive, or null if not set as an instance of org.adroitlogic.x.feature.http.HttpConstants.Authentication

boolean enableCaching

User detail caching enable or not

String projectId

The identifier of the project

String processElmId

The identifier of the processing element

String flowId

The identifier of the flow

Returns
Optional<String>

Return true if digest authentication success, false otherwise

This API can be used to validates whether this HTTP request has digest authentication and these authentication details are correct or not. If digest authentication success then return true. Otherwise return false.

checkDigestAuthentication

Parameters
MessageContext msgContext

The message context contains the message which includes authentication details

String realmName

The name of the authentication realm

boolean ignoreFailure

Authentication failure should be ignore or not. True if authentication failure is ignored. Otherwise authenticator consider failure

String credentialsCharset

The character set for the credentials

UserDetailsService userDetailsService

org.springframework.security.core.userdetails.UserDetailsService object which includes user details

int nonceValidateSeconds

The nonce value valid time period(seconds)

String key

The key represent the private key which is used to generate nonce value

boolean passwordAlreadyEncoded

True if the password argument is already encoded in the correct format. False if it is plain text.

AuthHashAlgorithm algorithm

The algorithm used to produce the digest and an un-keyed digest as an instance of org.adroitlogic.x.feature.http.HttpConstants.Authentication

QoP qop

The qop(quality of protection) directive, or null if not set as an instance of org.adroitlogic.x.feature.http.HttpConstants.Authentication

Returns
Optional<String>

Return true if digest authentication success, false otherwise

This API can be used to validates whether this HTTP request has digest authentication and these authentication details are correct or not, without using user detail caching. If digest authentication success then return true. Otherwise return false.

In this topic
In this topic
Contact Us