org.glassfish.grizzly.http.util
Class HttpStatus

java.lang.Object
  extended by org.glassfish.grizzly.http.util.HttpStatus

public class HttpStatus
extends java.lang.Object

This enum encapsulates the HTTP response status and reason phrases as defined by RFC 2616.

Since:
2.0

Field Summary
static HttpStatus ACCEPTED_202
           
static HttpStatus BAD_GATEWAY_502
           
static HttpStatus BAD_REQUEST_400
           
static HttpStatus CONFLICT_409
           
static HttpStatus CONINTUE_100
           
static HttpStatus CREATED_201
           
static HttpStatus EXPECTATION_FAILED_417
           
static HttpStatus FORBIDDEN_403
           
static HttpStatus FOUND_302
           
static HttpStatus GATEWAY_TIMEOUT_504
           
static HttpStatus GONE_410
           
static HttpStatus HTTP_VERSION_NOT_SUPPORTED_505
           
static HttpStatus INTERNAL_SERVER_ERROR_500
           
static HttpStatus LENGTH_REQUIRED_411
           
static HttpStatus METHOD_NOT_ALLOWED_405
           
static HttpStatus MOVED_PERMANENTLY_301
           
static HttpStatus MULTIPLE_CHOICES_300
           
static HttpStatus NO_CONTENT_204
           
static HttpStatus NON_AUTHORATIVE_INFORMATION_203
           
static HttpStatus NOT_ACCEPTABLE_406
           
static HttpStatus NOT_FOUND_404
           
static HttpStatus NOT_IMPLEMENTED_501
           
static HttpStatus NOT_MODIFIED_304
           
static HttpStatus OK_200
           
static HttpStatus PARTIAL_CONTENT_206
           
static HttpStatus PAYMENT_REQUIRED_402
           
static HttpStatus PRECONDITION_FAILED_412
           
static HttpStatus PROXY_AUTHENTICATION_REQUIRED_407
           
static HttpStatus REQUEST_ENTITY_TOO_LARGE_413
           
static HttpStatus REQUEST_RANGE_NOT_SATISFIABLE_416
           
static HttpStatus REQUEST_TIMEOUT_408
           
static HttpStatus REQUEST_URI_TOO_LONG_414
           
static HttpStatus RESET_CONTENT_205
           
static HttpStatus SEE_OTHER_303
           
static HttpStatus SERVICE_UNAVAILABLE_503
           
static HttpStatus SWITCHING_PROTOCOLS_101
           
static HttpStatus TEMPORARY_REDIRECT_307
           
static HttpStatus UNAUTHORIZED_401
           
static HttpStatus UNSUPPORTED_MEDIA_TYPE_415
           
static HttpStatus USE_PROXY_305
           
static HttpStatus WEB_SOCKET_PROTOCOL_HANDSHAKE_101
           
 
Method Summary
static DataChunk filter(DataChunk message)
          Filter the specified message string for characters that are sensitive in HTML.
static java.lang.String filter(java.lang.String message)
          Filter the specified message string for characters that are sensitive in HTML.
static HttpStatus getHttpStatus(int statusCode)
           
 byte[] getReasonPhraseBytes()
           
 byte[] getStatusBytes()
           
 int getStatusCode()
           
static HttpStatus newHttpStatus(int statusCode, java.lang.String reasonPhrase)
           
 void setValues(HttpResponsePacket response)
          Sets the status and reason phrase on the specified response.
 boolean statusMatches(int status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONINTUE_100

public static final HttpStatus CONINTUE_100

SWITCHING_PROTOCOLS_101

public static final HttpStatus SWITCHING_PROTOCOLS_101

WEB_SOCKET_PROTOCOL_HANDSHAKE_101

public static final HttpStatus WEB_SOCKET_PROTOCOL_HANDSHAKE_101

OK_200

public static final HttpStatus OK_200

CREATED_201

public static final HttpStatus CREATED_201

ACCEPTED_202

public static final HttpStatus ACCEPTED_202

NON_AUTHORATIVE_INFORMATION_203

public static final HttpStatus NON_AUTHORATIVE_INFORMATION_203

NO_CONTENT_204

public static final HttpStatus NO_CONTENT_204

RESET_CONTENT_205

public static final HttpStatus RESET_CONTENT_205

PARTIAL_CONTENT_206

public static final HttpStatus PARTIAL_CONTENT_206

MULTIPLE_CHOICES_300

public static final HttpStatus MULTIPLE_CHOICES_300

MOVED_PERMANENTLY_301

public static final HttpStatus MOVED_PERMANENTLY_301

FOUND_302

public static final HttpStatus FOUND_302

SEE_OTHER_303

public static final HttpStatus SEE_OTHER_303

NOT_MODIFIED_304

public static final HttpStatus NOT_MODIFIED_304

USE_PROXY_305

public static final HttpStatus USE_PROXY_305

TEMPORARY_REDIRECT_307

public static final HttpStatus TEMPORARY_REDIRECT_307

BAD_REQUEST_400

public static final HttpStatus BAD_REQUEST_400

UNAUTHORIZED_401

public static final HttpStatus UNAUTHORIZED_401

PAYMENT_REQUIRED_402

public static final HttpStatus PAYMENT_REQUIRED_402

FORBIDDEN_403

public static final HttpStatus FORBIDDEN_403

NOT_FOUND_404

public static final HttpStatus NOT_FOUND_404

METHOD_NOT_ALLOWED_405

public static final HttpStatus METHOD_NOT_ALLOWED_405

NOT_ACCEPTABLE_406

public static final HttpStatus NOT_ACCEPTABLE_406

PROXY_AUTHENTICATION_REQUIRED_407

public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED_407

REQUEST_TIMEOUT_408

public static final HttpStatus REQUEST_TIMEOUT_408

CONFLICT_409

public static final HttpStatus CONFLICT_409

GONE_410

public static final HttpStatus GONE_410

LENGTH_REQUIRED_411

public static final HttpStatus LENGTH_REQUIRED_411

PRECONDITION_FAILED_412

public static final HttpStatus PRECONDITION_FAILED_412

REQUEST_ENTITY_TOO_LARGE_413

public static final HttpStatus REQUEST_ENTITY_TOO_LARGE_413

REQUEST_URI_TOO_LONG_414

public static final HttpStatus REQUEST_URI_TOO_LONG_414

UNSUPPORTED_MEDIA_TYPE_415

public static final HttpStatus UNSUPPORTED_MEDIA_TYPE_415

REQUEST_RANGE_NOT_SATISFIABLE_416

public static final HttpStatus REQUEST_RANGE_NOT_SATISFIABLE_416

EXPECTATION_FAILED_417

public static final HttpStatus EXPECTATION_FAILED_417

INTERNAL_SERVER_ERROR_500

public static final HttpStatus INTERNAL_SERVER_ERROR_500

NOT_IMPLEMENTED_501

public static final HttpStatus NOT_IMPLEMENTED_501

BAD_GATEWAY_502

public static final HttpStatus BAD_GATEWAY_502

SERVICE_UNAVAILABLE_503

public static final HttpStatus SERVICE_UNAVAILABLE_503

GATEWAY_TIMEOUT_504

public static final HttpStatus GATEWAY_TIMEOUT_504

HTTP_VERSION_NOT_SUPPORTED_505

public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED_505
Method Detail

newHttpStatus

public static HttpStatus newHttpStatus(int statusCode,
                                       java.lang.String reasonPhrase)

getHttpStatus

public static HttpStatus getHttpStatus(int statusCode)
Parameters:
statusCode - HTTP status code
Returns:
HttpStatus representation of the status.

statusMatches

public boolean statusMatches(int status)
Returns:
true if the specified int status code matches the status of this HttpStatus.

getStatusCode

public int getStatusCode()
Returns:
the int status code.

getStatusBytes

public byte[] getStatusBytes()

getReasonPhraseBytes

public byte[] getReasonPhraseBytes()
Returns:
the bytes containing the reason phrase as defined by RFC 2616.

setValues

public void setValues(HttpResponsePacket response)
Sets the status and reason phrase on the specified response.

Parameters:
response - the response to set the status and reason phrase on.

filter

public static DataChunk filter(DataChunk message)
Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.

Parameters:
message - The message string to be filtered

filter

public static java.lang.String filter(java.lang.String message)
Filter the specified message string for characters that are sensitive in HTML. This avoids potential attacks caused by including JavaScript codes in the request URL that is often reported in error messages.

Parameters:
message - The message string to be filtered


Copyright © 2011 Oracle Corpration. All Rights Reserved.