public interface HTTPRequest
This interface allows to queue a HTTP request into the HTTPClient.
| Modifier and Type | Method and Description |
|---|---|
long |
calculateSize(ConnectionInfo connectionInfo) |
AttributedURI |
getOptionalMessageId() |
HTTPRequestHeader |
getRequestHeader(ConnectionInfo connectionInfo)
Returns the HTTP header for this HTTP request.
|
HTTPResponseHandler |
getResponseHandler(ContentType mediaType)
This method allows the handling of this request's incoming response.
|
XAddressInfo |
getTargetXAddressInfo() |
void |
messageWithoutBodyReceived(int code,
ConnectionInfo connectionInfo,
MonitoringContext context) |
boolean |
needsBody() |
void |
requestSendFailed(java.lang.Exception e,
ConnectionInfo connectionInfo,
MonitoringContext context)
This method will be invoked if an exception occurs whilst sending the HTTP request.
|
void |
responseReceiveFailed(java.lang.Exception e,
ConnectionInfo connectionInfo,
MonitoringContext context)
This method will be invoked if an exception occurs whilst receiving the HTTP response.
|
void |
serializeRequestBody(java.io.OutputStream out,
ConnectionInfo connectionInfo,
MonitoringContext context)
Serializes the HTTP body to the given stream.
|
HTTPRequestHeader getRequestHeader(ConnectionInfo connectionInfo)
long calculateSize(ConnectionInfo connectionInfo)
void serializeRequestBody(java.io.OutputStream out,
ConnectionInfo connectionInfo,
MonitoringContext context)
throws java.io.IOException
out - the stream to serialize the body.connectionInfo - addressing information associated to the requestjava.io.IOExceptionHTTPResponseHandler getResponseHandler(ContentType mediaType) throws java.io.IOException
The HTTPClient will call this method for a incoming response. If no HTTPResponseHandler belongs to this request, the HTTP client will check the internal handler
list.
mediaType - The Internet media type of the response.HTTPResponseHandler which should handle the response.java.io.IOExceptionvoid requestSendFailed(java.lang.Exception e,
ConnectionInfo connectionInfo,
MonitoringContext context)
This method allows to check for exceptions during the HTTP request.
e - the exception.void responseReceiveFailed(java.lang.Exception e,
ConnectionInfo connectionInfo,
MonitoringContext context)
This method allows to check for exceptions during the HTTP response.
e - the exception.void messageWithoutBodyReceived(int code,
ConnectionInfo connectionInfo,
MonitoringContext context)
AttributedURI getOptionalMessageId()
XAddressInfo getTargetXAddressInfo()
boolean needsBody()