org.apache.wink.common.http
Class HttpStatus

java.lang.Object
  extended by org.apache.wink.common.http.HttpStatus
All Implemented Interfaces:
java.lang.Cloneable

public class HttpStatus
extends java.lang.Object
implements java.lang.Cloneable

HTTP status codes and a helper methods.


Field Summary
static HttpStatus ACCEPTED
           
static HttpStatus BAD_GATEWAY
           
static HttpStatus BAD_REQUEST
           
static HttpStatus CONFLICT
           
static HttpStatus CONTINUE
           
static HttpStatus CREATED
           
static HttpStatus EXPECTATION_FAILED
           
static HttpStatus FAILED_DEPENDENCY
           
static HttpStatus FORBIDDEN
           
static HttpStatus FOUND
           
static HttpStatus GATEWAY_TIMEOUT
           
static HttpStatus GONE
           
static HttpStatus HTTP_VERSION_NOT_SUPPORTED
           
static HttpStatus INSUFFICIENT_SPACE_ON_RESOURCE
           
static HttpStatus INSUFFICIENT_STORAGE
           
static HttpStatus INTERNAL_SERVER_ERROR
           
static HttpStatus LENGTH_REQUIRED
           
static HttpStatus LOCKED
           
static HttpStatus METHOD_FAILURE
           
static HttpStatus METHOD_NOT_ALLOWED
           
static HttpStatus MOVED_PERMANENTLY
           
static HttpStatus MULTI_STATUS
           
static HttpStatus MULTIPLE_CHOICES
           
static HttpStatus NO_CONTENT
           
static HttpStatus NON_AUTHORITATIVE_INFORMATION
           
static HttpStatus NOT_ACCEPTABLE
           
static HttpStatus NOT_FOUND
           
static HttpStatus NOT_IMPLEMENTED
           
static HttpStatus NOT_MODIFIED
           
static HttpStatus OK
           
static HttpStatus PARTIAL_CONTENT
           
static HttpStatus PAYMENT_REQUIRED
           
static HttpStatus PRECONDITION_FAILED
           
static HttpStatus PROCESSING
           
static HttpStatus PROXY_AUTHENTICATION_REQUIRED
           
static HttpStatus REQUEST_TIMEOUT
           
static HttpStatus REQUEST_TOO_LONG
           
static HttpStatus REQUEST_URI_TOO_LONG
           
static HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE
           
static HttpStatus RESET_CONTENT
           
static HttpStatus SEE_OTHER
           
static HttpStatus SERVICE_UNAVAILABLE
           
static HttpStatus SWITCHING_PROTOCOLS
           
static HttpStatus TEMPORARY_REDIRECT
           
static HttpStatus UNAUTHORIZED
           
static HttpStatus UNPROCESSABLE_ENTITY
           
static HttpStatus UNSUPPORTED_MEDIA_TYPE
           
static HttpStatus USE_PROXY
           
 
Constructor Summary
protected HttpStatus(int code, java.lang.String message)
          Deprecated.  
 
Method Summary
 HttpStatus clone()
           
 HttpStatus duplicate(java.lang.String message)
          Duplicates this status with another status message.
 boolean equals(java.lang.Object httpStatus)
           
 int getCode()
          Gets the status code.
 java.lang.String getMessage()
          Gets the status message.
 java.lang.String getStatusLine()
          Gets the status line like HTTP/1.1 404 Not Found.
 int hashCode()
           
 boolean isError()
          Is this an error status.
 java.lang.String toString()
           
static HttpStatus valueOf(int code)
          Gets HttpStatus for given status code.
static HttpStatus valueOfStatusLine(java.lang.String statusLine)
          Gets HttpStatus for given status line.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTINUE

public static final HttpStatus CONTINUE

SWITCHING_PROTOCOLS

public static final HttpStatus SWITCHING_PROTOCOLS

PROCESSING

public static final HttpStatus PROCESSING

OK

public static final HttpStatus OK

CREATED

public static final HttpStatus CREATED

ACCEPTED

public static final HttpStatus ACCEPTED

NON_AUTHORITATIVE_INFORMATION

public static final HttpStatus NON_AUTHORITATIVE_INFORMATION

NO_CONTENT

public static final HttpStatus NO_CONTENT

RESET_CONTENT

public static final HttpStatus RESET_CONTENT

PARTIAL_CONTENT

public static final HttpStatus PARTIAL_CONTENT

MULTI_STATUS

public static final HttpStatus MULTI_STATUS

MULTIPLE_CHOICES

public static final HttpStatus MULTIPLE_CHOICES

MOVED_PERMANENTLY

public static final HttpStatus MOVED_PERMANENTLY

FOUND

public static final HttpStatus FOUND

SEE_OTHER

public static final HttpStatus SEE_OTHER

NOT_MODIFIED

public static final HttpStatus NOT_MODIFIED

USE_PROXY

public static final HttpStatus USE_PROXY

TEMPORARY_REDIRECT

public static final HttpStatus TEMPORARY_REDIRECT

BAD_REQUEST

public static final HttpStatus BAD_REQUEST

UNAUTHORIZED

public static final HttpStatus UNAUTHORIZED

PAYMENT_REQUIRED

public static final HttpStatus PAYMENT_REQUIRED

FORBIDDEN

public static final HttpStatus FORBIDDEN

NOT_FOUND

public static final HttpStatus NOT_FOUND

METHOD_NOT_ALLOWED

public static final HttpStatus METHOD_NOT_ALLOWED

NOT_ACCEPTABLE

public static final HttpStatus NOT_ACCEPTABLE

PROXY_AUTHENTICATION_REQUIRED

public static final HttpStatus PROXY_AUTHENTICATION_REQUIRED

REQUEST_TIMEOUT

public static final HttpStatus REQUEST_TIMEOUT

CONFLICT

public static final HttpStatus CONFLICT

GONE

public static final HttpStatus GONE

LENGTH_REQUIRED

public static final HttpStatus LENGTH_REQUIRED

PRECONDITION_FAILED

public static final HttpStatus PRECONDITION_FAILED

REQUEST_TOO_LONG

public static final HttpStatus REQUEST_TOO_LONG

REQUEST_URI_TOO_LONG

public static final HttpStatus REQUEST_URI_TOO_LONG

UNSUPPORTED_MEDIA_TYPE

public static final HttpStatus UNSUPPORTED_MEDIA_TYPE

REQUESTED_RANGE_NOT_SATISFIABLE

public static final HttpStatus REQUESTED_RANGE_NOT_SATISFIABLE

EXPECTATION_FAILED

public static final HttpStatus EXPECTATION_FAILED

INSUFFICIENT_SPACE_ON_RESOURCE

public static final HttpStatus INSUFFICIENT_SPACE_ON_RESOURCE

METHOD_FAILURE

public static final HttpStatus METHOD_FAILURE

UNPROCESSABLE_ENTITY

public static final HttpStatus UNPROCESSABLE_ENTITY

LOCKED

public static final HttpStatus LOCKED

FAILED_DEPENDENCY

public static final HttpStatus FAILED_DEPENDENCY

INTERNAL_SERVER_ERROR

public static final HttpStatus INTERNAL_SERVER_ERROR

NOT_IMPLEMENTED

public static final HttpStatus NOT_IMPLEMENTED

BAD_GATEWAY

public static final HttpStatus BAD_GATEWAY

SERVICE_UNAVAILABLE

public static final HttpStatus SERVICE_UNAVAILABLE

GATEWAY_TIMEOUT

public static final HttpStatus GATEWAY_TIMEOUT

HTTP_VERSION_NOT_SUPPORTED

public static final HttpStatus HTTP_VERSION_NOT_SUPPORTED

INSUFFICIENT_STORAGE

public static final HttpStatus INSUFFICIENT_STORAGE
Constructor Detail

HttpStatus

protected HttpStatus(int code,
                     java.lang.String message)
Deprecated. 

Parameters:
code - status code
message - status message
Method Detail

valueOf

public static HttpStatus valueOf(int code)
Gets HttpStatus for given status code.

Parameters:
code - status code
Returns:
HttpStatus

valueOfStatusLine

public static HttpStatus valueOfStatusLine(java.lang.String statusLine)
Gets HttpStatus for given status line.

Parameters:
statusLine - status line
Returns:
HttpStatus

getCode

public int getCode()
Gets the status code.

Returns:
status code

getMessage

public java.lang.String getMessage()
Gets the status message.

Returns:
status message

getStatusLine

public java.lang.String getStatusLine()
Gets the status line like HTTP/1.1 404 Not Found.

Returns:
the status line

isError

public boolean isError()
Is this an error status.

Returns:
true if this status has code greater or equal to 400.

duplicate

public HttpStatus duplicate(java.lang.String message)
Duplicates this status with another status message.

Parameters:
message - new status message
Returns:
new HttpStatus

clone

public HttpStatus clone()
Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object httpStatus)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2009 The Apache Software Foundation. All Rights Reserved.