seda.sandStorm.lib.http
Class httpResponder

java.lang.Object
  extended by seda.sandStorm.lib.http.httpResponder
All Implemented Interfaces:
QueueElementIF, httpConst

public class httpResponder
extends java.lang.Object
implements httpConst, QueueElementIF

This class is used to wrap an HTTP response along with the connection which it is destined for.

See Also:
httpResponse, httpConnection

Field Summary
private  boolean closeConnection
           
private  httpConnection conn
           
private  httpResponse resp
           
private  boolean sendHeader
           
 
Fields inherited from interface seda.sandStorm.lib.http.httpConst
CRLF, DEFAULT_HTTP_PORT, HTTP_VERSION, WRITE_CLOG_THRESHOLD
 
Constructor Summary
httpResponder(httpResponse resp, httpConnection conn)
          Create an httpResponder with the given response and connection.
httpResponder(httpResponse resp, httpConnection conn, boolean closeConnection)
          Create an httpResponder with the given response and connection.
httpResponder(httpResponse resp, httpConnection conn, boolean closeConnection, boolean sendHeader)
          Create an httpResponder with the given response and connection.
httpResponder(httpResponse resp, httpRequest req)
          Create an httpResponder with the given response, with the connection being derived from the given request.
httpResponder(httpResponse resp, httpRequest req, boolean closeConnection)
          Create an httpResponder with the given response, with the connection being derived from the given request.
httpResponder(httpResponse resp, httpRequest req, boolean closeConnection, boolean sendHeader)
          Create an httpResponder with the given response, with the connection being derived from the given request.
 
Method Summary
 httpConnection getConnection()
          Return the connection for this responder.
 httpResponse getResponse()
          Return the response for this responder.
 boolean sendHeader()
          Returns whether the response header should be sent.
 boolean shouldClose()
          Returns whether the connection should be closed after sending this response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resp

private httpResponse resp

conn

private httpConnection conn

closeConnection

private boolean closeConnection

sendHeader

private boolean sendHeader
Constructor Detail

httpResponder

public httpResponder(httpResponse resp,
                     httpConnection conn,
                     boolean closeConnection,
                     boolean sendHeader)
Create an httpResponder with the given response and connection.

Parameters:
closeConnection - Indicate that the connection should be closed after sending this response.
sendHeader - Indicate that the header of the response should be sent along with the payload.

httpResponder

public httpResponder(httpResponse resp,
                     httpConnection conn,
                     boolean closeConnection)
Create an httpResponder with the given response and connection.

Parameters:
closeConnection - Indicate that the connection should be closed after sending this response.

httpResponder

public httpResponder(httpResponse resp,
                     httpConnection conn)
Create an httpResponder with the given response and connection.


httpResponder

public httpResponder(httpResponse resp,
                     httpRequest req,
                     boolean closeConnection,
                     boolean sendHeader)
Create an httpResponder with the given response, with the connection being derived from the given request.

Parameters:
closeConnection - Indicate that the connection should be closed after sending this response.
sendHeader - Indicate that the header of the response should be sent along with the payload.

httpResponder

public httpResponder(httpResponse resp,
                     httpRequest req,
                     boolean closeConnection)
Create an httpResponder with the given response, with the connection being derived from the given request.

Parameters:
closeConnection - Indicate that the connection should be closed after sending this response.

httpResponder

public httpResponder(httpResponse resp,
                     httpRequest req)
Create an httpResponder with the given response, with the connection being derived from the given request.

Method Detail

getConnection

public httpConnection getConnection()
Return the connection for this responder.


getResponse

public httpResponse getResponse()
Return the response for this responder.


shouldClose

public boolean shouldClose()
Returns whether the connection should be closed after sending this response.


sendHeader

public boolean sendHeader()
Returns whether the response header should be sent.