public class HttpManagedObjectImpl extends Object implements HttpManagedObject, ServerHttpConnection, EscalationHandler
ManagedObject
for the ServerHttpConnection
.Constructor and Description |
---|
HttpManagedObjectImpl(Connection connection,
HttpConversationImpl conversation,
HttpRequestImpl request)
Initiate to process the
HttpRequest by populating the
HttpResponse . |
HttpManagedObjectImpl(HttpResponseImpl completedResponse)
Initiate with
HttpResponse ready to be sent. |
public HttpManagedObjectImpl(Connection connection, HttpConversationImpl conversation, HttpRequestImpl request)
HttpRequest
by populating the
HttpResponse
.connection
- Connection
.conversation
- HttpConversationImpl
.request
- HttpRequestImpl
.public HttpManagedObjectImpl(HttpResponseImpl completedResponse)
HttpResponse
ready to be sent.completedResponse
- HttpResponse
ready to be sent.public Object getObject() throws Exception
ManagedObject
getObject
in interface ManagedObject
Exception
public EscalationHandler getEscalationHandler()
HttpManagedObject
EscalationHandler
.getEscalationHandler
in interface HttpManagedObject
EscalationHandler
.public ServerHttpConnection getServerHttpConnection()
HttpManagedObject
ServerHttpConnection
.getServerHttpConnection
in interface HttpManagedObject
ServerHttpConnection
.public void cleanup(CleanupEscalation[] cleanupEscalations) throws IOException
HttpManagedObject
HttpManagedObject
.cleanup
in interface HttpManagedObject
cleanupEscalations
- CleanupEscalation
instances of previous cleanup of
ManagedObject
instances.IOException
- If fails to clean up HttpManagedObject
.public HttpRequest getHttpRequest()
ServerHttpConnection
HttpRequest
for this ServerHttpConnection
.getHttpRequest
in interface ServerHttpConnection
HttpRequest
for this ServerHttpConnection
.public HttpResponse getHttpResponse()
ServerHttpConnection
HttpResponse
for this ServerHttpConnection
.getHttpResponse
in interface ServerHttpConnection
HttpResponse
for this ServerHttpConnection
.public boolean isSecure()
ServerHttpConnection
isSecure
in interface ServerHttpConnection
true
if connection is over a secure channel.public InetSocketAddress getLocalAddress()
ServerHttpConnection
ServerHttpConnection
.getLocalAddress
in interface ServerHttpConnection
InetSocketAddress
describing the local Socket
for
this ServerHttpConnection
.public InetSocketAddress getRemoteAddress()
ServerHttpConnection
ServerHttpConnection
.getRemoteAddress
in interface ServerHttpConnection
InetSocketAddress
describing the remote Socket
for this ServerHttpConnection
.public Serializable exportState() throws IOException
ServerHttpConnection
Exports the state of the current HttpRequest
and
HttpResponse
.
This enables maintaining the state of the HttpRequest
/
HttpResponse
and later reinstating them (typically after a
redirect).
exportState
in interface ServerHttpConnection
HttpRequest
and
HttpResponse
state.IOException
- Should the state not be able to be exported.ServerHttpConnection.importState(Serializable)
public void importState(Serializable momento)
ServerHttpConnection
HttpRequest
and
HttpResponse
with the input momento.importState
in interface ServerHttpConnection
momento
- Momento exported from a ServerHttpConnection
.ServerHttpConnection.exportState()
public String getHttpMethod()
ServerHttpConnection
Obtains the client sent HTTP method of the ServerHttpConnection
.
As the HttpRequest
method is overridden, this method may be used
by logic requiring to know the actual client HTTP method. An example of
this logic is the POST/redirect/GET pattern that needs to know whether
the client sent HttpRequest
method is a POST
or
GET
(regardless of imported state).
getHttpMethod
in interface ServerHttpConnection
ServerHttpConnection.exportState()
,
ServerHttpConnection.importState(Serializable)
public void handleEscalation(Throwable escalation) throws Throwable
EscalationHandler
Throwable
.handleEscalation
in interface EscalationHandler
escalation
- Escalation.Throwable
- If fails to handle EscalationFlow
.Copyright © 2005–2016. All rights reserved.