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 enumAn enumeration representing the class of status code. -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription202 Accepted, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1502 Bad Gateway, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3">HTTP/1.1400 Bad Request, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1409 Conflict, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1201 Created, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1417 Expectation Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.18">HTTP/1.1403 Forbidden, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1302 Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3">HTTP/1.1504 Gateway Timeout, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5">HTTP/1.1410 Gone, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1505 HTTP Version Not Supported, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.6">HTTP/1.1500 Internal Server Error, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1411 Length Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.12">HTTP/1.1405 Method Not Allowed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6">HTTP/1.1301 Moved Permanently, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1511 Network Authentication Required, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-6">RFC204 No Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1406 Not Acceptable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1404 Not Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1501 Not Implemented, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">HTTP/1.1304 Not Modified, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1200 OK, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1206 Reset Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.7">HTTP/1.1402 Payment Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3">HTTP/1.1412 Precondition Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1428 Precondition required, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-3">RFC407 Proxy Authentication Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8">HTTP/1.1413 Request Entity Too Large, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14">HTTP/1.1431 Request Header Fields Too Large, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-5">RFC408 Request Timeout, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9">HTTP/1.1414 Request-URI Too Long, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.15">HTTP/1.1416 Requested Range Not Satisfiable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.17">HTTP/1.1205 Reset Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.6">HTTP/1.1303 See Other, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1503 Service Unavailable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1307 Temporary Redirect, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1429 Too Many Requests, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-4">RFC401 Unauthorized, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1415 Unsupported Media Type, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1305 Use Proxy, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.6">HTTP/1.1 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final Response.Status.Familyprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Response.StatusfromStatusCode(int statusCode) Convert a numerical status code into the corresponding Status.Get the class of status code.Get the reason phrase.intGet the associated status code.toString()Get the reason phrase.static Response.StatusReturns 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.Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface javax.ws.rs.core.Response.StatusType
toEnum
-
Enum Constant Details
-
OK
200 OK, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1">HTTP/1.1 -
CREATED
201 Created, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.2">HTTP/1.1 -
ACCEPTED
202 Accepted, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.3">HTTP/1.1 -
NO_CONTENT
204 No Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.5">HTTP/1.1 -
RESET_CONTENT
205 Reset Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.6">HTTP/1.1- Since:
- 2.0
-
PARTIAL_CONTENT
206 Reset Content, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.7">HTTP/1.1- Since:
- 2.0
-
MOVED_PERMANENTLY
301 Moved Permanently, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2">HTTP/1.1 -
FOUND
302 Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3">HTTP/1.1- Since:
- 2.0
-
SEE_OTHER
303 See Other, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.4">HTTP/1.1 -
NOT_MODIFIED
304 Not Modified, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5">HTTP/1.1 -
USE_PROXY
305 Use Proxy, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.6">HTTP/1.1- Since:
- 2.0
-
TEMPORARY_REDIRECT
307 Temporary Redirect, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8">HTTP/1.1 -
BAD_REQUEST
400 Bad Request, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1">HTTP/1.1 -
UNAUTHORIZED
401 Unauthorized, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2">HTTP/1.1 -
PAYMENT_REQUIRED
402 Payment Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.3">HTTP/1.1- Since:
- 2.0
-
FORBIDDEN
403 Forbidden, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.4">HTTP/1.1 -
NOT_FOUND
404 Not Found, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5">HTTP/1.1 -
METHOD_NOT_ALLOWED
405 Method Not Allowed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6">HTTP/1.1- Since:
- 2.0
-
NOT_ACCEPTABLE
406 Not Acceptable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.7">HTTP/1.1 -
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.8">HTTP/1.1- Since:
- 2.0
-
REQUEST_TIMEOUT
408 Request Timeout, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.9">HTTP/1.1- Since:
- 2.0
-
CONFLICT
409 Conflict, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.10">HTTP/1.1 -
GONE
410 Gone, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.11">HTTP/1.1 -
LENGTH_REQUIRED
411 Length Required, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.12">HTTP/1.1- Since:
- 2.0
-
PRECONDITION_FAILED
412 Precondition Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.13">HTTP/1.1 -
REQUEST_ENTITY_TOO_LARGE
413 Request Entity Too Large, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.14">HTTP/1.1- Since:
- 2.0
-
REQUEST_URI_TOO_LONG
414 Request-URI Too Long, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.15">HTTP/1.1- Since:
- 2.0
-
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.16">HTTP/1.1 -
REQUESTED_RANGE_NOT_SATISFIABLE
416 Requested Range Not Satisfiable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.17">HTTP/1.1- Since:
- 2.0
-
EXPECTATION_FAILED
417 Expectation Failed, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.18">HTTP/1.1- Since:
- 2.0
-
PRECONDITION_REQUIRED
428 Precondition required, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-3">RFC- Since:
- 2.1
-
TOO_MANY_REQUESTS
429 Too Many Requests, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-4">RFC- Since:
- 2.1
-
REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-5">RFC- Since:
- 2.1
-
INTERNAL_SERVER_ERROR
500 Internal Server Error, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.1">HTTP/1.1 -
NOT_IMPLEMENTED
501 Not Implemented, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.2">HTTP/1.1- Since:
- 2.0
-
BAD_GATEWAY
502 Bad Gateway, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.3">HTTP/1.1- Since:
- 2.0
-
SERVICE_UNAVAILABLE
503 Service Unavailable, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.4">HTTP/1.1 -
GATEWAY_TIMEOUT
504 Gateway Timeout, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.5">HTTP/1.1- Since:
- 2.0
-
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported, seedocumentation}.invalid @link
{@link <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.5.6">HTTP/1.1- Since:
- 2.0
-
NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required, see6585: Additional HTTP Status Codes}.invalid @link
{@link <a href="https://tools.ietf.org/html/rfc6585#section-6">RFC- Since:
- 2.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:
getFamilyin interfaceResponse.StatusType- Returns:
- the class of status code.
-
getStatusCode
public int getStatusCode()Get the associated status code.- Specified by:
getStatusCodein interfaceResponse.StatusType- Returns:
- the status code.
-
getReasonPhrase
Get the reason phrase.- Specified by:
getReasonPhrasein interfaceResponse.StatusType- Returns:
- the reason phrase.
-
toString
Get the reason phrase.- Overrides:
toStringin 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.
-