net.officefloor.plugin.socket.server.http.protocol
Class HttpCommunicationProtocol

java.lang.Object
  extended by net.officefloor.plugin.socket.server.http.protocol.HttpCommunicationProtocol
All Implemented Interfaces:
CommunicationProtocol<HttpConnectionHandler>, ServerSocketHandler<HttpConnectionHandler>

public class HttpCommunicationProtocol
extends Object
implements CommunicationProtocol<HttpConnectionHandler>, ServerSocketHandler<HttpConnectionHandler>

HTTP CommunicationProtocol.

Author:
Daniel Sagenschneider

Field Summary
static long DEFAULT_VALUE_CONNECTION_TIMEOUT
          Default value for property PROPERTY_CONNECTION_TIMEOUT.
static boolean DEFAULT_VALUE_IS_SEND_STACK_TRACE_ON_FAILURE
          Default value for property PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE.
static int DEFAULT_VALUE_MAXIMUM_HTTP_REQUEST_HEADERS
          Default value for the property PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS.
static long DEFAULT_VALUE_MAXIMUM_REQUEST_BODY_LENGTH
          Default value for property PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH.
static int DEFAULT_VALUE_MAXIMUM_TEXT_PART_LENGTH
          Default value for property PROPERTY_MAXIMUM_TEXT_PART_LENGTH.
static String PROPERTY_CONNECTION_TIMEOUT
          Property name for the connection timeout.
static String PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE
          Name of property to determine if send stack trace on failure.
static String PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS
          Name of property to indicate the maximum number of HttpHeader instances per HttpRequest.
static String PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH
          Property name for the maximum length in bytes of the HttpRequest body.
static String PROPERTY_MAXIMUM_TEXT_PART_LENGTH
          Property name for the maximum length of a text part for the HttpRequest.
 
Constructor Summary
HttpCommunicationProtocol()
           
 
Method Summary
 HttpConnectionHandler createConnectionHandler(Connection connection)
          Creates a ConnectionHandler for a new Connection.
 Server<HttpConnectionHandler> createServer()
          Creates the Server to handle requests.
 ServerSocketHandler<HttpConnectionHandler> createServerSocketHandler(AbstractAsyncManagedObjectSource.MetaDataContext<None,Indexed> context, BufferSquirtFactory bufferSquirtFactory)
          Creates the ServerSocketHandler.
 void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
          Loads any specifications for this communication protocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE

public static final String PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE
Name of property to determine if send stack trace on failure.

See Also:
Constant Field Values

DEFAULT_VALUE_IS_SEND_STACK_TRACE_ON_FAILURE

public static final boolean DEFAULT_VALUE_IS_SEND_STACK_TRACE_ON_FAILURE
Default value for property PROPERTY_IS_SEND_STACK_TRACE_ON_FAILURE.

See Also:
Constant Field Values

PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS

public static final String PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS
Name of property to indicate the maximum number of HttpHeader instances per HttpRequest.

See Also:
Constant Field Values

DEFAULT_VALUE_MAXIMUM_HTTP_REQUEST_HEADERS

public static final int DEFAULT_VALUE_MAXIMUM_HTTP_REQUEST_HEADERS
Default value for the property PROPERTY_MAXIMUM_HTTP_REQUEST_HEADERS.

See Also:
Constant Field Values

PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH

public static final String PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH
Property name for the maximum length in bytes of the HttpRequest body.

See Also:
Constant Field Values

DEFAULT_VALUE_MAXIMUM_REQUEST_BODY_LENGTH

public static final long DEFAULT_VALUE_MAXIMUM_REQUEST_BODY_LENGTH
Default value for property PROPERTY_MAXIMUM_REQUEST_BODY_LENGTH.

See Also:
Constant Field Values

PROPERTY_CONNECTION_TIMEOUT

public static final String PROPERTY_CONNECTION_TIMEOUT
Property name for the connection timeout.

See Also:
Constant Field Values

DEFAULT_VALUE_CONNECTION_TIMEOUT

public static final long DEFAULT_VALUE_CONNECTION_TIMEOUT
Default value for property PROPERTY_CONNECTION_TIMEOUT.

See Also:
Constant Field Values

PROPERTY_MAXIMUM_TEXT_PART_LENGTH

public static final String PROPERTY_MAXIMUM_TEXT_PART_LENGTH
Property name for the maximum length of a text part for the HttpRequest.

See Also:
Constant Field Values

DEFAULT_VALUE_MAXIMUM_TEXT_PART_LENGTH

public static final int DEFAULT_VALUE_MAXIMUM_TEXT_PART_LENGTH
Default value for property PROPERTY_MAXIMUM_TEXT_PART_LENGTH.

See Also:
Constant Field Values
Constructor Detail

HttpCommunicationProtocol

public HttpCommunicationProtocol()
Method Detail

loadSpecification

public void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from interface: CommunicationProtocol
Loads any specifications for this communication protocol.

Specified by:
loadSpecification in interface CommunicationProtocol<HttpConnectionHandler>
Parameters:
context - AbstractAsyncManagedObjectSource.SpecificationContext.

createServerSocketHandler

public ServerSocketHandler<HttpConnectionHandler> createServerSocketHandler(AbstractAsyncManagedObjectSource.MetaDataContext<None,Indexed> context,
                                                                            BufferSquirtFactory bufferSquirtFactory)
                                                                     throws Exception
Description copied from interface: CommunicationProtocol
Creates the ServerSocketHandler.

Specified by:
createServerSocketHandler in interface CommunicationProtocol<HttpConnectionHandler>
Parameters:
context - AbstractAsyncManagedObjectSource.MetaDataContext.
bufferSquirtFactory - BufferSquirtFactory.
Throws:
Exception - If fails to create the ServerSocketHandler.

createServer

public Server<HttpConnectionHandler> createServer()
Description copied from interface: ServerSocketHandler
Creates the Server to handle requests.

Specified by:
createServer in interface ServerSocketHandler<HttpConnectionHandler>
Returns:
Server to handle requests.

createConnectionHandler

public HttpConnectionHandler createConnectionHandler(Connection connection)
Description copied from interface: ServerSocketHandler
Creates a ConnectionHandler for a new Connection.

Specified by:
createConnectionHandler in interface ServerSocketHandler<HttpConnectionHandler>
Parameters:
connection - A new Connection requiring handling.
Returns:
ConnectionHandler to handle the new Connection.


Copyright © 2005-2011. All Rights Reserved.