public interface HttpInterceptorIFC
Integration Server provides a framework for creating and registering inbound HTTP interceptors. An inbound HTTP interceptor is invoked when Integration Server is the HTTP server. An inbound HTTP interceptor intercepts all received HTTP requests and outbound HTTP responses with the exception of: OAuth messages; services that use their own HTTP URL connections; and intermediate requests and responses in NTLM, DIGEST and REDIRECTS.
Integration Server makes the raw HTTP request and response, including the HTTP header information, accessible to the inbound HTTP interceptor. In the case of HTTP requests, the inbound HTTP interceptor intercepts a received HTTP request before Integration server performs any processing. For an outbound HTTP response, the inbound HTTP interceptor intercepts an HTTP response after Integration Server creates the HTTP response but before Integration Server sends the response to the requesting client.
An inbound HTTP interceptor is comprised of:
Keep the following information in mind when creating an inbound HTTP interceptor:
Following are the general steps to take when creating an inbound HTTP interceptor.
Modifier and Type | Method and Description |
---|---|
void |
postProcess(int responseCode,
java.lang.String responseMessage,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] bytes,
java.lang.String correlationID)
Receives HTTP Response data after all processing has been done, but before the response
is sent back to the client.
|
void |
preProcess(java.lang.String requestURL,
java.lang.String requestType,
java.lang.String httpVersion,
java.util.Map headers,
byte[] streamBytes,
java.lang.String correlationID)
Receives HTTP request data before any processing has been done on the Integration Server.
|
void preProcess(java.lang.String requestURL, java.lang.String requestType, java.lang.String httpVersion, java.util.Map headers, byte[] streamBytes, java.lang.String correlationID) throws HttpInterceptorException
requestURL
- The URL used by the client for this HTTP request, including the query if present.requestType
- The HTTP method used. Possible values are GET, PUT, POST, PATCH, and DELETE.httpVersion
- The HTTP version of the request.headers
- A map of the fields in the request transport header, where key names represent header
field names and values represent the header field values.streamBytes
- The body of the HTTP request represented as a byte array.correlationID
- An id assigned to this request that can be used to correlate this request to a specific
response when it comes back through the HTTP Interceptor.HttpInterceptorException
- - Thrown by preProcess method to interrupt Integration Server processing of this request.void postProcess(int responseCode, java.lang.String responseMessage, java.util.Map<java.lang.String,java.lang.String> headers, byte[] bytes, java.lang.String correlationID)
responseCode
- HTTP status code of the response.responseMessage
- HTTP status message of the response.headers
- A map of the fields in the response transport header, where key names represent header
field names and values represent the header field values.bytes
- The body of the HTTP response represented as a byte array.correlationID
- An id assigned to the original preprocess request that can be used to correlate this
postProcess response back to a specific request that came through the HTTP Interceptor.