javax.ws.rs.core
Enum Response.Status

java.lang.Object
  extended by java.lang.Enum<Response.Status>
      extended by javax.ws.rs.core.Response.Status
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Response.Status>
Enclosing class:
Response

public static enum Response.Status
extends java.lang.Enum<Response.Status>

Commonly used status codes defined by HTTP, see HTTP/1.1 documentation for the complete list.


Nested Class Summary
static class Response.Status.Family
          An enumeration representing the class of status code.
 
Enum Constant Summary
ACCEPTED
          202 Accepted, see HTTP/1.1 documentation.
BAD_REQUEST
          400 Bad Request, see HTTP/1.1 documentation.
CONFLICT
          409 Conflict, see HTTP/1.1 documentation.
CREATED
          201 Created, see HTTP/1.1 documentation.
FORBIDDEN
          403 Forbidden, see HTTP/1.1 documentation.
GONE
          410 Gone, see HTTP/1.1 documentation.
INTERNAL_SERVER_ERROR
          500 Internal Server Error, see HTTP/1.1 documentation.
MOVED_PERMANENTLY
          303 See Other, see HTTP/1.1 documentation.
NO_CONTENT
          204 No Content, see HTTP/1.1 documentation.
NOT_ACCEPTABLE
          406 Not Acceptable, see HTTP/1.1 documentation.
NOT_FOUND
          404 Not Found, see HTTP/1.1 documentation.
NOT_MODIFIED
          304 Not Modified, see HTTP/1.1 documentation.
OK
          200 OK, see HTTP/1.1 documentation.
PRECONDITION_FAILED
          412 Precondition Failed, see HTTP/1.1 documentation.
SEE_OTHER
          303 See Other, see HTTP/1.1 documentation.
SERVICE_UNAVAILABLE
          503 Service Unavailable, see HTTP/1.1 documentation.
TEMPORARY_REDIRECT
          307 Temporary Redirect, see HTTP/1.1 documentation.
UNAUTHORIZED
          401 Unauthorized, see HTTP/1.1 documentation.
UNSUPPORTED_MEDIA_TYPE
          415 Unsupported Media Type, see HTTP/1.1 documentation.
 
Method Summary
static Response.Status fromStatusCode(int statusCode)
          Convert a numerical status code into the corresponding Status
 Response.Status.Family getFamily()
          Get the class of status code
 int getStatusCode()
          Get the associated status code
 java.lang.String toString()
          Get the reason phrase
static Response.Status valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Response.Status[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

OK

public static final Response.Status OK
200 OK, see HTTP/1.1 documentation.


CREATED

public static final Response.Status CREATED
201 Created, see HTTP/1.1 documentation.


ACCEPTED

public static final Response.Status ACCEPTED
202 Accepted, see HTTP/1.1 documentation.


NO_CONTENT

public static final Response.Status NO_CONTENT
204 No Content, see HTTP/1.1 documentation.


MOVED_PERMANENTLY

public static final Response.Status MOVED_PERMANENTLY
303 See Other, see HTTP/1.1 documentation.


SEE_OTHER

public static final Response.Status SEE_OTHER
303 See Other, see HTTP/1.1 documentation.


NOT_MODIFIED

public static final Response.Status NOT_MODIFIED
304 Not Modified, see HTTP/1.1 documentation.


TEMPORARY_REDIRECT

public static final Response.Status TEMPORARY_REDIRECT
307 Temporary Redirect, see HTTP/1.1 documentation.


BAD_REQUEST

public static final Response.Status BAD_REQUEST
400 Bad Request, see HTTP/1.1 documentation.


UNAUTHORIZED

public static final Response.Status UNAUTHORIZED
401 Unauthorized, see HTTP/1.1 documentation.


FORBIDDEN

public static final Response.Status FORBIDDEN
403 Forbidden, see HTTP/1.1 documentation.


NOT_FOUND

public static final Response.Status NOT_FOUND
404 Not Found, see HTTP/1.1 documentation.


NOT_ACCEPTABLE

public static final Response.Status NOT_ACCEPTABLE
406 Not Acceptable, see HTTP/1.1 documentation.


CONFLICT

public static final Response.Status CONFLICT
409 Conflict, see HTTP/1.1 documentation.


GONE

public static final Response.Status GONE
410 Gone, see HTTP/1.1 documentation.


PRECONDITION_FAILED

public static final Response.Status PRECONDITION_FAILED
412 Precondition Failed, see HTTP/1.1 documentation.


UNSUPPORTED_MEDIA_TYPE

public static final Response.Status UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type, see HTTP/1.1 documentation.


INTERNAL_SERVER_ERROR

public static final Response.Status INTERNAL_SERVER_ERROR
500 Internal Server Error, see HTTP/1.1 documentation.


SERVICE_UNAVAILABLE

public static final Response.Status SERVICE_UNAVAILABLE
503 Service Unavailable, see HTTP/1.1 documentation.

Method Detail

values

public static final Response.Status[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Response.Status c : Response.Status.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Response.Status valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name

getFamily

public Response.Status.Family getFamily()
Get the class of status code

Returns:
the class of status code

getStatusCode

public int getStatusCode()
Get the associated status code

Returns:
the status code

toString

public java.lang.String toString()
Get the reason phrase

Overrides:
toString in class java.lang.Enum<Response.Status>
Returns:
the reason phrase

fromStatusCode

public static Response.Status fromStatusCode(int statusCode)
Convert a numerical status code into the corresponding Status

Parameters:
statusCode - the numerical status code
Returns:
the matching Status or null is no matching Status is defined


Copyright © 2009. All Rights Reserved.