| java.lang.Object seda.sandStorm.lib.http.httpResponse
All known Subclasses: seda.sandStorm.lib.http.httpServiceUnavailableResponse, seda.sandStorm.lib.http.httpOKResponse, seda.sandStorm.lib.http.httpNotFoundResponse, seda.sandStorm.lib.http.httpInternalServerErrorResponse, seda.sandStorm.lib.http.httpBadRequestResponse, seda.sandStorm.lib.http.httpRedirectResponse, com.rimfaxe.webserver.seda.SedaHttpResponse,
httpResponse | abstract public class httpResponse implements httpConst,QueueElementIF(Code) | | This is an abstract class corresponding to an HTTP response.
Use one of the subclasses (such as httpOKResponse or httpNotFoundResponse)
to push responses back to the client.
author: Matt Welsh See Also: httpOKResponse See Also: httpNotFoundResponse |
Constructor Summary | |
protected | httpResponse(int code, String contentType, BufferElement payload, Hashtable headertable) Create an httpResponse with the given response code with the given
payload. | protected | httpResponse(int code, String contentType, Hashtable headertable) Create an httpResponse with the given response code with no payload.
A payload can be assigned later using setPayload().
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. | protected | httpResponse(int code, String contentType, BufferElement payload) Create an httpResponse with the given response code with the given
payload. | protected | httpResponse(int code, String contentType, BufferElement payload, int contentLength) Create an httpResponse with the given response code with the given
payload. | protected | httpResponse(int code, String contentType) Create an httpResponse with the given response code with no payload.
A payload can be assigned later using setPayload().
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. | protected | httpResponse(int code, String contentType, int payloadSize, SinkIF compQ) Create an httpResponse with the the given response code, with an
empty payload of the given size. | protected | httpResponse(int code, String contentType, int payloadSize) Create an httpResponse with the the given response code, with an
empty payload of the given size. | protected | httpResponse(int code, String contentType, int payloadSize, Hashtable headertable, boolean withheaders) Create an httpResponse with the the given response code, with an
empty payload of the given size. |
DEFAULT_MIME_TYPE | final public static String DEFAULT_MIME_TYPE(Code) | | The default MIME type for responses, which is "text/html".
|
RESPONSE_ACCEPTED | final public static int RESPONSE_ACCEPTED(Code) | | Code corresponding to '202 ACCEPTED'.
|
RESPONSE_BAD_GATEWAY | final public static int RESPONSE_BAD_GATEWAY(Code) | | Code corresponding to '502 Bad Gateway'.
|
RESPONSE_BAD_REQUEST | final public static int RESPONSE_BAD_REQUEST(Code) | | Code corresponding to '400 Bad Request'.
|
RESPONSE_CONFLICT | final public static int RESPONSE_CONFLICT(Code) | | Code corresponding to '409 Conflict'.
|
RESPONSE_CONTINUE | final public static int RESPONSE_CONTINUE(Code) | | Code corresponding to '100 Continue'.
|
RESPONSE_CREATED | final public static int RESPONSE_CREATED(Code) | | Code corresponding to '201 Created'.
|
RESPONSE_EXPECTATION_FAILED | final public static int RESPONSE_EXPECTATION_FAILED(Code) | | Code corresponding to '417 Expectation Failed'.
|
RESPONSE_FORBIDDEN | final public static int RESPONSE_FORBIDDEN(Code) | | Code corresponding to '403 Forbidden'.
|
RESPONSE_FOUND | final public static int RESPONSE_FOUND(Code) | | Code corresponding to '302 Found'.
|
RESPONSE_GATEWAY_TIMEOUT | final public static int RESPONSE_GATEWAY_TIMEOUT(Code) | | Code corresponding to '504 Gateway Timeout'.
|
RESPONSE_GONE | final public static int RESPONSE_GONE(Code) | | Code corresponding to '410 Gone'.
|
RESPONSE_HTTP_VERSION_NOT_SUPPORTED | final public static int RESPONSE_HTTP_VERSION_NOT_SUPPORTED(Code) | | Code corresponding to '505 HTTP Version Not Supported'.
|
RESPONSE_INTERNAL_SERVER_ERROR | final public static int RESPONSE_INTERNAL_SERVER_ERROR(Code) | | Code corresponding to '500 Internal Server Error'.
|
RESPONSE_LENGTH_REQUIRED | final public static int RESPONSE_LENGTH_REQUIRED(Code) | | Code corresponding to '411 Length Required'.
|
RESPONSE_METHOD_NOT_ALLOWED | final public static int RESPONSE_METHOD_NOT_ALLOWED(Code) | | Code corresponding to '405 Method Not Allowed'.
|
RESPONSE_MULTIPLE_CHOICES | final public static int RESPONSE_MULTIPLE_CHOICES(Code) | | Code corresponding to '300 Multiple Choices'.
|
RESPONSE_NON_AUTHORITATIVE_INFORMATION | final public static int RESPONSE_NON_AUTHORITATIVE_INFORMATION(Code) | | Code corresponding to '203 Non-Authoritative Information'.
|
RESPONSE_NOT_ACCEPTABLE | final public static int RESPONSE_NOT_ACCEPTABLE(Code) | | Code corresponding to '406 Not Acceptable'.
|
RESPONSE_NOT_FOUND | final public static int RESPONSE_NOT_FOUND(Code) | | Code corresponding to '404 Not Found'.
|
RESPONSE_NOT_IMPLEMENTED | final public static int RESPONSE_NOT_IMPLEMENTED(Code) | | Code corresponding to '501 Not Implemented'.
|
RESPONSE_NOT_MODIFIED | final public static int RESPONSE_NOT_MODIFIED(Code) | | Code corresponding to '304 Not Modified'.
|
RESPONSE_NO_CONTENT | final public static int RESPONSE_NO_CONTENT(Code) | | Code corresponding to '204 No Content'.
|
RESPONSE_OK | final public static int RESPONSE_OK(Code) | | Code corresponding to '200 OK'.
|
RESPONSE_PARTIAL_CONTENT | final public static int RESPONSE_PARTIAL_CONTENT(Code) | | Code corresponding to '206 Partial Content'.
|
RESPONSE_PAYMENT_REQUIRED | final public static int RESPONSE_PAYMENT_REQUIRED(Code) | | Code corresponding to '402 Payment Required'.
|
RESPONSE_PRECONDITION_FAILED | final public static int RESPONSE_PRECONDITION_FAILED(Code) | | Code corresponding to '412 Precondition Failed'.
|
RESPONSE_PROXY_AUTHENTICATION_REQUIRED | final public static int RESPONSE_PROXY_AUTHENTICATION_REQUIRED(Code) | | Code corresponding to '407 Proxy Authentication Required'.
|
RESPONSE_REDIRECT | final public static int RESPONSE_REDIRECT(Code) | | Code corresponding to '301 Moved Permanently'.
|
RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE | final public static int RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE(Code) | | Code corresponding to '416 Requested Range Not Satisfiable'.
|
RESPONSE_REQUEST_ENTITY_TOO_LARGE | final public static int RESPONSE_REQUEST_ENTITY_TOO_LARGE(Code) | | Code corresponding to '413 Request Entity Too Large'.
|
RESPONSE_REQUEST_TIMEOUT | final public static int RESPONSE_REQUEST_TIMEOUT(Code) | | Code corresponding to '408 Request Timeout'.
|
RESPONSE_REQUEST_URI_TOO_LONG | final public static int RESPONSE_REQUEST_URI_TOO_LONG(Code) | | Code corresponding to '414 Request-URI Too Long'.
|
RESPONSE_RESERVED_306 | final public static int RESPONSE_RESERVED_306(Code) | | Code corresponding to '306 (Unused)'.
|
RESPONSE_RESET_CONTENT | final public static int RESPONSE_RESET_CONTENT(Code) | | Code corresponding to '205 Reset Content'.
|
RESPONSE_SEE_OTHER | final public static int RESPONSE_SEE_OTHER(Code) | | Code corresponding to '303 See Other'.
|
RESPONSE_SERVICE_UNAVAILABLE | final public static int RESPONSE_SERVICE_UNAVAILABLE(Code) | | Code corresponding to '503 Service Unavailable'.
|
RESPONSE_SWITCHING_PROTOCOLS | final public static int RESPONSE_SWITCHING_PROTOCOLS(Code) | | Code corresponding to '101 Switching Protocols'.
|
RESPONSE_TEMPORARY_REDIRECT | final public static int RESPONSE_TEMPORARY_REDIRECT(Code) | | Code corresponding to '307 Temporary Redirect'.
|
RESPONSE_UNAUTHORIZED | final public static int RESPONSE_UNAUTHORIZED(Code) | | Code corresponding to '401 Unauthorized'.
|
RESPONSE_UNSUPPORTED_MEDIA_TYPE | final public static int RESPONSE_UNSUPPORTED_MEDIA_TYPE(Code) | | Code corresponding to '415 Unsupported Media Type'.
|
RESPONSE_USE_PROXY | final public static int RESPONSE_USE_PROXY(Code) | | Code corresponding to '305 Use Proxy'.
|
code | protected int code(Code) | | The code corresponding to the response.
|
contentLength | protected int contentLength(Code) | | The content-length header.
|
contentType | protected String contentType(Code) | | The MIME type of the response.
|
defaultHeader | protected static String defaultHeader(Code) | | The default response header.
|
httpResponse | protected httpResponse(int code, String contentType, BufferElement payload, Hashtable headertable)(Code) | | Create an httpResponse with the given response code with the given
payload.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payload - The payload of the response. |
httpResponse | protected httpResponse(int code, String contentType, Hashtable headertable)(Code) | | Create an httpResponse with the given response code with no payload.
A payload can be assigned later using setPayload().
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payload - The payload of the response. |
httpResponse | protected httpResponse(int code, String contentType, BufferElement payload)(Code) | | Create an httpResponse with the given response code with the given
payload.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payload - The payload of the response. |
httpResponse | protected httpResponse(int code, String contentType, BufferElement payload, int contentLength)(Code) | | Create an httpResponse with the given response code with the given
payload.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payload - The payload of the response. Parameters: contentLength - The contentLength to place in the header. |
httpResponse | protected httpResponse(int code, String contentType)(Code) | | Create an httpResponse with the given response code with no payload.
A payload can be assigned later using setPayload().
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payload - The payload of the response. |
httpResponse | protected httpResponse(int code, String contentType, int payloadSize, SinkIF compQ)(Code) | | Create an httpResponse with the the given response code, with an
empty payload of the given size. This can be more efficient than
providing a payload separately, as the entire contents of the
httpResponse can be sent as a single TCP packet. The payload can
be filled in using the getPayload() method.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payloadSize - The size of the payload to allocate. Parameters: compQ - The completion queue for the payload. |
httpResponse | protected httpResponse(int code, String contentType, int payloadSize)(Code) | | Create an httpResponse with the the given response code, with an
empty payload of the given size. This can be more efficient than
providing a payload separately, as the entire contents of the
httpResponse can be sent as a single TCP packet. The payload can
be filled in using the getPayload() method.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payloadSize - The size of the payload to allocate. |
httpResponse | protected httpResponse(int code, String contentType, int payloadSize, Hashtable headertable, boolean withheaders)(Code) | | Create an httpResponse with the the given response code, with an
empty payload of the given size. This can be more efficient than
providing a payload separately, as the entire contents of the
httpResponse can be sent as a single TCP packet. The payload can
be filled in using the getPayload() method.
Parameters: code - The response code; should be one of the constantsfrom httpResponse.RESPONSE_*. Parameters: contentType - The MIME type of the response content. Shouldnot be CRLF-terminated. Parameters: payloadSize - The size of the payload to allocate. |
getBuffers | public BufferElement[] getBuffers(boolean sendHeader)(Code) | | Get an array of BufferElements corresponding to this response.
Used internally when sending the response to a client.
Parameters: sendHeader - Indicate whether the header should be included. |
getDefaultHeader | public static String getDefaultHeader()(Code) | | Return the default header string sent in all responses.
|
getEntityHeader | abstract protected String getEntityHeader()(Code) | | Return the entity header as a String. Must be implemented by
subclasses of httpResponse.
|
getServerPort | public int getServerPort()(Code) | | |
setDefaultHeader | public static void setDefaultHeader(String defhdr)(Code) | | Set the default header string sent in all responses.
|
setPayload | public void setPayload(BufferElement payload)(Code) | | Used to set the payload after creating the response with an
empty payload. XXX Should not be used if the payload was allocated
by this response (that is, if the payloadSize was specified in the
constructor).
|
setServerPort | public void setServerPort(int val)(Code) | | |
|
|