public interface HttpInterceptorOutboundIFC
Integration Server provides a framework for creating and registering outbound HTTP interceptors. An outbound HTTP interceptor is invoked when Integration Server is an HTTP client. It intercepts all outbound HTTP requests and inbound 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.
An outbound HTTP interceptor is comprised of:
Keep the following information in mind when creating an outbound HTTP interceptor:
Following are the general steps to take when creating an outbound 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 before any processing has been done.
|
void |
preProcess(java.lang.String requestURL,
java.lang.String requestType,
java.lang.String httpVersion,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] streamBytes,
java.lang.String correlationID)
Sends HTTP request data after all processing has been done on Integration Server.
|
void preProcess(java.lang.String requestURL, java.lang.String requestType, java.lang.String httpVersion, java.util.Map<java.lang.String,java.lang.String> headers, byte[] streamBytes, java.lang.String correlationID) throws HttpInterceptorException
requestURL
- The URL to connect to 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 Interceptor.HttpInterceptorException
- - Thrown by preProcess method to interrupt Integraiton 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) throws java.io.IOException
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 interceptor.java.io.IOException