net.officefloor.plugin.socket.server.http.conversation.impl
Class HttpManagedObjectImpl

java.lang.Object
  extended by net.officefloor.plugin.socket.server.http.conversation.impl.HttpManagedObjectImpl
All Implemented Interfaces:
EscalationHandler, ManagedObject, HttpManagedObject, ServerHttpConnection

public class HttpManagedObjectImpl
extends Object
implements HttpManagedObject, ServerHttpConnection, EscalationHandler

ManagedObject for the ServerHttpConnection.

Author:
Daniel Sagenschneider

Constructor Summary
HttpManagedObjectImpl(Connection connection, HttpRequestImpl request, HttpResponseImpl response)
          Initiate to process the HttpRequest by populating the HttpResponse.
HttpManagedObjectImpl(HttpResponseImpl completedResponse)
          Initiate with HttpResponse ready to be sent.
 
Method Summary
 void cleanup()
          Cleans up this HttpManagedObject.
 EscalationHandler getEscalationHandler()
          Obtains the EscalationHandler.
 HttpRequest getHttpRequest()
          Obtains the HttpRequest for this ServerHttpConnection.
 HttpResponse getHttpResponse()
          Obtains the HttpResponse for this ServerHttpConnection.
 InetSocketAddress getLocalAddress()
          Obtains the local address for this ServerHttpConnection.
 Object getObject()
           
 InetSocketAddress getRemoteAddress()
          Obtains the remote address for this ServerHttpConnection.
 ServerHttpConnection getServerHttpConnection()
          Obtains the ServerHttpConnection.
 void handleEscalation(Throwable escalation)
           
 boolean isSecure()
          Indicates if the connection is over a secure channel (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpManagedObjectImpl

public HttpManagedObjectImpl(Connection connection,
                             HttpRequestImpl request,
                             HttpResponseImpl response)
Initiate to process the HttpRequest by populating the HttpResponse.

Parameters:
connection - Connection.
request - HttpRequestImpl.
response - HttpResponseImpl.

HttpManagedObjectImpl

public HttpManagedObjectImpl(HttpResponseImpl completedResponse)
Initiate with HttpResponse ready to be sent.

Parameters:
completedResponse - HttpResponse ready to be sent.
Method Detail

getObject

public Object getObject()
                 throws Exception
Specified by:
getObject in interface ManagedObject
Throws:
Exception

getEscalationHandler

public EscalationHandler getEscalationHandler()
Description copied from interface: HttpManagedObject
Obtains the EscalationHandler.

Specified by:
getEscalationHandler in interface HttpManagedObject
Returns:
EscalationHandler.

getServerHttpConnection

public ServerHttpConnection getServerHttpConnection()
Description copied from interface: HttpManagedObject
Obtains the ServerHttpConnection.

Specified by:
getServerHttpConnection in interface HttpManagedObject
Returns:
ServerHttpConnection.

cleanup

public void cleanup()
             throws IOException
Description copied from interface: HttpManagedObject
Cleans up this HttpManagedObject.

Specified by:
cleanup in interface HttpManagedObject
Throws:
IOException - If fails to clean up HttpManagedObject.

getHttpRequest

public HttpRequest getHttpRequest()
Description copied from interface: ServerHttpConnection
Obtains the HttpRequest for this ServerHttpConnection.

Specified by:
getHttpRequest in interface ServerHttpConnection
Returns:
HttpRequest for this ServerHttpConnection.

getHttpResponse

public HttpResponse getHttpResponse()
Description copied from interface: ServerHttpConnection
Obtains the HttpResponse for this ServerHttpConnection.

Specified by:
getHttpResponse in interface ServerHttpConnection
Returns:
HttpResponse for this ServerHttpConnection.

isSecure

public boolean isSecure()
Description copied from interface: ServerHttpConnection
Indicates if the connection is over a secure channel (e.g. utilising SSL).

Specified by:
isSecure in interface ServerHttpConnection
Returns:
true if connection is over a secure channel.

getLocalAddress

public InetSocketAddress getLocalAddress()
Description copied from interface: ServerHttpConnection
Obtains the local address for this ServerHttpConnection.

Specified by:
getLocalAddress in interface ServerHttpConnection
Returns:
InetSocketAddress describing the local Socket for this ServerHttpConnection.

getRemoteAddress

public InetSocketAddress getRemoteAddress()
Description copied from interface: ServerHttpConnection
Obtains the remote address for this ServerHttpConnection.

Specified by:
getRemoteAddress in interface ServerHttpConnection
Returns:
InetSocketAddress describing the remote Socket for this ServerHttpConnection.

handleEscalation

public void handleEscalation(Throwable escalation)
                      throws Throwable
Specified by:
handleEscalation in interface EscalationHandler
Throws:
Throwable


Copyright © 2005-2011. All Rights Reserved.