public interface HTTPSupport
Modifier and Type | Method and Description |
---|---|
void |
addPreemptiveBasicAuthentication(Message msg,
java.lang.String username,
java.lang.String password)
Adds an HTTP transport header for pre-emptive basic authentication for this message.
|
void |
addPreemptiveBasicAuthentication(Message msg,
java.lang.String username,
java.lang.String password,
java.lang.String charset,
boolean proxy)
Adds an HTTP transport header for pre-emptive basic authentication for this message.
|
void |
addRequestParameter(Message msg,
java.lang.String name,
java.lang.String value)
Add an outgoing query parameter with the given name
|
java.lang.String[] |
getAuthenticatedRolesArray(Message msg)
Retrieved the the authenticated user roles of the given message as a String array
|
java.lang.String |
getAuthenticatedRolesString(Message msg)
Retrieved the the authenticated user roles as a serialized String of the given message
|
java.lang.String |
getAuthenticatedUsername(Message msg)
Gets the authenticated username of the given message
|
java.lang.String |
getCookie(Message msg,
java.lang.String name)
Return the value of the cookie with the given name
|
java.lang.String |
getFirstRequestParameter(Message msg,
java.lang.String key)
Return the first request query parameter with the given name
|
java.lang.String |
getJvmRoute(Message msg)
Return the jvmRoute from the JSESSIONID cookie or jsessionid URL parameter of an HTTP/S request
|
java.lang.String |
getLocalAddress(Message msg)
Gets the local address of the network interface via which the given message has been received to the ESB
|
int |
getLocalPort(Message msg)
Gets the local socket port used in receiving the current message
|
HttpConstants.Method |
getMethod(Message msg)
Retrieves the given methods receiving HTTP method, could be one of;
HttpConstants.Method.GET
HttpConstants.Method.POST
HttpConstants.Method.PUT
HttpConstants.Method.DELETE
HttpConstants.Method.HEAD
HttpConstants.Method.OPTIONS
HttpConstants.Method.PATCH
|
java.lang.String |
getQueryString(Message msg)
Gives a String representation of URL query parameters of the given message received over HTTP/S transport.
|
long |
getReceivedEntitySize(Message msg)
Retrieves the size of the received HTTP entity of the given message - This is only available for requests and
responses received and not for messages about to be sent out
|
long |
getReceivedHeaderSize(Message msg)
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
|
long |
getReceivedMessageSize(Message msg)
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
|
java.lang.String |
getRemoteAddress(Message msg)
Gets the remote address of the given message
|
int |
getRemotePort(Message msg)
Gets the remote port of the given message
|
java.util.Map |
getRequestParameterMap(Message msg)
Return the query parameters as a Map
|
java.util.List |
getRequestParameterValues(Message msg,
java.lang.String key)
Return the list of query parameters for the given name/key
|
java.lang.String |
getServiceURL(Message msg)
Retrieves the service URL of the given message as seen at the message arrival to the ESB
|
boolean |
isHessian(Message msg)
Check the message content type to see if it indicates a Hessian message
|
void |
removeRequestParameter(Message msg,
java.lang.String key)
Remove the request query parameter with the given name
|
void |
setAuthenticationCredentials(Message msg,
java.lang.String username,
java.lang.String password)
Sets the authentication username and password to be used by HTTP authenticators
|
void |
setAuthenticationCredentials(Message msg,
java.lang.String username,
java.lang.String password,
java.lang.String scheme)
Sets the authentication username and password and scheme to be used by HTTP authenticators
|
void |
setCookie(Message msg,
java.lang.String name,
java.lang.String value)
Set a HTTP cookie on the message
|
void |
setCookie(Message msg,
java.lang.String name,
java.lang.String value,
java.lang.String path,
int age)
Set a HTTP cookie on the message
|
void |
setCookie(Message msg,
java.lang.String name,
java.lang.String value,
java.lang.String path,
java.lang.String domain,
int age,
boolean secure)
Set a HTTP cookie on the message
|
void |
setMethod(Message msg,
HttpConstants.Method method)
Sets the HTTP method for the current message effective for the next HTTP send action
|
void |
setNTLMAuthenticationCredentials(Message msg,
java.lang.String username,
java.lang.String password,
java.lang.String domain,
java.lang.String workstation)
Sets the authentication username and password to be used by HTTP authenticators
|
java.lang.String getJvmRoute(Message msg)
msg
- the current messagejava.lang.String getCookie(Message msg, java.lang.String name)
msg
- message to extract cookie fromname
- the name of the cookievoid setCookie(Message msg, java.lang.String name, java.lang.String value, java.lang.String path, java.lang.String domain, int age, boolean secure)
msg
- the response message to set the cookie onname
- name of the cookievalue
- value of the cookiepath
- the path for the cookiedomain
- the domain for the cookieage
- the max age for the cookiesecure
- true if cookie is securevoid setCookie(Message msg, java.lang.String name, java.lang.String value, java.lang.String path, int age)
msg
- the response message to set the cookie onname
- name of the cookievalue
- value of the cookiepath
- the path for the cookieage
- the max age for the cookievoid setCookie(Message msg, java.lang.String name, java.lang.String value)
msg
- the response message to set the cookie onname
- name of the cookievalue
- value of the cookievoid addPreemptiveBasicAuthentication(Message msg, java.lang.String username, java.lang.String password, java.lang.String charset, boolean proxy)
msg
- the message to add an HTTP 'Authorization' header for basic authenticationusername
- the usernamepassword
- the passwordcharset
- the character set for the credentialsproxy
- if header should be for proxy authentication or WWW authenticationvoid addPreemptiveBasicAuthentication(Message msg, java.lang.String username, java.lang.String password)
msg
- the message to add an HTTP 'Authorization' header for basic authenticationusername
- the username in US-ASCII character setpassword
- the password in US-ASCII character setboolean isHessian(Message msg)
msg
- the message to detectjava.lang.String getFirstRequestParameter(Message msg, java.lang.String key)
msg
- the messagekey
- the name or key of the query parametervoid removeRequestParameter(Message msg, java.lang.String key)
msg
- the messagekey
- the name or key of the query parametervoid addRequestParameter(Message msg, java.lang.String name, java.lang.String value)
msg
- message to set the outgoing query parameter toname
- the name of the query parametervalue
- the value of the query parameterjava.util.Map getRequestParameterMap(Message msg)
msg
- the messagejava.util.List getRequestParameterValues(Message msg, java.lang.String key)
msg
- the messagekey
- the name or keyjava.lang.String getRemoteAddress(Message msg)
msg
- the message of which the remote address to be retrievedint getRemotePort(Message msg)
msg
- the message of which the remote port to be retrievedjava.lang.String getLocalAddress(Message msg)
msg
- the message of which the local address to be retrievedint getLocalPort(Message msg)
msg
- the message of which the local port to be retrievedHttpConstants.Method getMethod(Message msg)
msg
- the message of which the received HTTP method to be retrievedvoid setMethod(Message msg, HttpConstants.Method method)
msg
- the message to which the HTTP method to be setmethod
- the HTTP method to be setlong getReceivedMessageSize(Message msg)
msg
- the message of which the received size to be retrievedlong getReceivedHeaderSize(Message msg)
msg
- the message of which the received header size to be retrievedlong getReceivedEntitySize(Message msg)
msg
- the message of which the received entity size to be retrievedjava.lang.String getAuthenticatedUsername(Message msg)
msg
- the message of which the authenticated username to be fetchedjava.lang.String getAuthenticatedRolesString(Message msg)
msg
- the message of which the authenticated roles to be fetchedjava.lang.String[] getAuthenticatedRolesArray(Message msg)
msg
- the message of which the authenticated user roles to be fetchedvoid setAuthenticationCredentials(Message msg, java.lang.String username, java.lang.String password)
msg
- the message to which the authentication credentials to be setusername
- the authentication username to be setpassword
- the authentication password to be setvoid setAuthenticationCredentials(Message msg, java.lang.String username, java.lang.String password, java.lang.String scheme)
msg
- the message to which the authentication credentials to be setusername
- the authentication username to be setpassword
- the authentication password to be setscheme
- the authentication scheme to be setvoid setNTLMAuthenticationCredentials(Message msg, java.lang.String username, java.lang.String password, java.lang.String domain, java.lang.String workstation)
msg
- the message to which the authentication credentials to be setusername
- the authentication username to be setpassword
- the authentication password to be setdomain
- the authentication NTLM domain to be setjava.lang.String getServiceURL(Message msg)
msg
- the message of which the received service URL to be fetchedjava.lang.String getQueryString(Message msg)
HttpConstants.MessageProperties.QUERY_PARAM_MAP
wont be
reflected in the QUERY_STRING, even though both refers to effectively the same value set initially. The
QUERY_STRING property value does not include the "?" prefixmsg
- the message of which the query string to be retrieved