public class HttpConversationImpl extends Object implements HttpConversation
Connection
.Constructor and Description |
---|
HttpConversationImpl(Connection connection,
String serverName,
int sendBufferSize,
Charset defaultCharset,
boolean isSendStackTraceOnFailure,
HttpServerClock clock)
Initiate.
|
Modifier and Type | Method and Description |
---|---|
HttpManagedObject |
addRequest(String method,
String requestURI,
String httpVersion,
List<HttpHeader> headers,
HttpEntity entity)
Adds a
HttpRequest to the conversation. |
void |
closeConnection()
Closes the
Connection . |
void |
parseFailure(HttpRequestParseException failure,
boolean isCloseConnection)
Handles a failure in parsing a
HttpRequest . |
public HttpConversationImpl(Connection connection, String serverName, int sendBufferSize, Charset defaultCharset, boolean isSendStackTraceOnFailure, HttpServerClock clock)
connection
- Connection
.serverName
- Server name.sendBufferSize
- Size of the send buffers.defaultCharset
- Default Charset
for the HttpResponse
entity.isSendStackTraceOnFailure
- Flags whether to send the stack trace on failure.clock
- HttpServerClock
.public HttpManagedObject addRequest(String method, String requestURI, String httpVersion, List<HttpHeader> headers, HttpEntity entity)
HttpConversation
HttpRequest
to the conversation.addRequest
in interface HttpConversation
method
- Method.requestURI
- Request URI.httpVersion
- HTTP Version.headers
- HttpHeader
instances.entity
- HttpEntity
to the entity of the HttpRequest
.HttpManagedObject
to process the HttpRequest
.public void parseFailure(HttpRequestParseException failure, boolean isCloseConnection) throws IOException
HttpConversation
HttpRequest
.parseFailure
in interface HttpConversation
failure
- Failure in parsing a HttpRequest
.isCloseConnection
- Flags to close the Connection
once the
HttpRequestParseException
has been processed.IOException
- If fails to write response regarding the
HttpRequestParseException
.public void closeConnection() throws IOException
HttpConversation
Connection
.closeConnection
in interface HttpConversation
IOException
- If fails to close the Connection
.Copyright © 2005–2016. All rights reserved.