Package javax.ws.rs.core
Enum Response.Status
- All Implemented Interfaces:
Serializable
,Comparable<Response.Status>
,Response.StatusType
- Enclosing class:
Response
Commonly used status codes defined by HTTP, see
documentation}
for the complete list. Additional status codes can be added by applications
by creating an implementation of
invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10">HTTP/1.1
Response.StatusType
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enumeration representing the class of status code. -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription202 Accepted, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1
400 Bad Request, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1
409 Conflict, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1
201 Created, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1
403 Forbidden, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1
410 Gone, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1
500 Internal Server Error, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1
301 Moved Permanently, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1
204 No Content, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1
406 Not Acceptable, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1
404 Not Found, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1
304 Not Modified, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1
200 OK, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1
412 Precondition Failed, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1
303 See Other, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1
503 Service Unavailable, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1
307 Temporary Redirect, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1
401 Unauthorized, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1
415 Unsupported Media Type, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private Response.Status.Family
private final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Response.Status
fromStatusCode
(int statusCode) Convert a numerical status code into the corresponding StatusGet the class of status codeGet the reason phraseint
Get the associated status codetoString()
Get the reason phrasestatic Response.Status
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 are declared.
-
Enum Constant Details
-
OK
200 OK, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1
-
CREATED
201 Created, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1
-
ACCEPTED
202 Accepted, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1
-
NO_CONTENT
204 No Content, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1
-
MOVED_PERMANENTLY
301 Moved Permanently, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1
-
SEE_OTHER
303 See Other, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1
-
NOT_MODIFIED
304 Not Modified, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1
-
TEMPORARY_REDIRECT
307 Temporary Redirect, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1
-
BAD_REQUEST
400 Bad Request, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1
-
UNAUTHORIZED
401 Unauthorized, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1
-
FORBIDDEN
403 Forbidden, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1
-
NOT_FOUND
404 Not Found, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1
-
NOT_ACCEPTABLE
406 Not Acceptable, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1
-
CONFLICT
409 Conflict, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1
-
GONE
410 Gone, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1
-
PRECONDITION_FAILED
412 Precondition Failed, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1
-
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1
-
INTERNAL_SERVER_ERROR
500 Internal Server Error, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1
-
SERVICE_UNAVAILABLE
503 Service Unavailable, seeinvalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1
-
-
Field Details
-
code
private final int code -
reason
-
family
-
-
Constructor Details
-
Status
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getFamily
Get the class of status code- Specified by:
getFamily
in interfaceResponse.StatusType
- Returns:
- the class of status code
-
getStatusCode
public int getStatusCode()Get the associated status code- Specified by:
getStatusCode
in interfaceResponse.StatusType
- Returns:
- the status code
-
getReasonPhrase
Get the reason phrase- Specified by:
getReasonPhrase
in interfaceResponse.StatusType
- Returns:
- the reason phrase
-
toString
Get the reason phrase- Overrides:
toString
in classEnum<Response.Status>
- Returns:
- the reason phrase
-
fromStatusCode
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
-