Package org.simpleframework.http
Enum Class Status
- All Implemented Interfaces:
Serializable
,Comparable<Status>
,Constable
The
Status
enumeration is used to specify status codes
and the descriptions of those status codes. This is a convenience
enumeration that allows users to acquire the descriptions of codes
by simply providing the code. Also if the response state is known
the code and description can be provided to the client.
The official HTTP status codes are defined in RFC 2616 section 10. Each set of status codes belongs to a specific family. Each family describes a specific scenario. Although it is possible to use other status codes it is recommended that servers restrict their status code responses to those specified in this enumeration.
- Author:
- Niall Gallagher
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis is used to signify that the request has been accepted.This is used to tell the client that the gateway is invalid.This is used to tell the client they have send an invalid request.This is used to tell the client that there has been a conflict.This is used to signify that a resource was created successfully.This is used to tell the client that the expectation has failed.This is used to tell the client that the resource is forbidden.This is used to represent a resource that has been found.This is used to tell the client there was a gateway timeout.This is used to tell the client that the resource has gone.This is sent when the request has caused an internal server error.This is used to tell the client that a request length is needed.This is used to tell the client that the method is not allowed.This is used to represent a target resource that has moved.This is used to represent a response where there are choices.This represents a response that contains no response content.This is used to tell the client the request is not acceptable.This is used to tell the client that the resource is not found.This is used to tell the client the resource is not implemented.This is used in response to a target that has not been modified.This represents a successful response of a targeted request.This is used to represent a response that has partial content.This is used to tell the client that payment is required.This is used to tell the client that a precondition has failed.This is used to tell the client that authentication is required.This is used to tell the client that the request body is too big.This is used to tell the client that the request has timed out.This is used to tell the client that the request URI is too long.This is used to tell the client that the range is invalid.This is used to represent a response that resets the content.This is used to tell the client to see another HTTP resource.This is used to tell the client the resource is unavailable.This is used to redirect the client to a resource that has moved.This is used to tell the client that authorization is required.This is used to tell the client that the content type is invalid.This is used to tell the client that it should use a proxy.This is used to tell the client the request version is invalid. -
Method Summary
Modifier and TypeMethodDescriptionint
getCode()
This is used to acquire the code of the status object.This is used to provide the status description.static String
getDescription
(int code) This is used to provide the status description.static Status
Returns the enum constant of this class with the specified name.static Status[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OK
This represents a successful response of a targeted request. -
CREATED
This is used to signify that a resource was created successfully. -
ACCEPTED
This is used to signify that the request has been accepted. -
NO_CONTENT
This represents a response that contains no response content. -
RESET_CONTENT
This is used to represent a response that resets the content. -
PARTIAL_CONTENT
This is used to represent a response that has partial content. -
MULTIPLE_CHOICES
This is used to represent a response where there are choices. -
MOVED_PERMANENTLY
This is used to represent a target resource that has moved. -
FOUND
This is used to represent a resource that has been found. -
SEE_OTHER
This is used to tell the client to see another HTTP resource. -
NOT_MODIFIED
This is used in response to a target that has not been modified. -
USE_PROXY
This is used to tell the client that it should use a proxy. -
TEMPORARY_REDIRECT
This is used to redirect the client to a resource that has moved. -
BAD_REQUEST
This is used to tell the client they have send an invalid request. -
UNAUTHORIZED
This is used to tell the client that authorization is required. -
PAYMENT_REQUIRED
This is used to tell the client that payment is required. -
FORBIDDEN
This is used to tell the client that the resource is forbidden. -
NOT_FOUND
This is used to tell the client that the resource is not found. -
METHOD_NOT_ALLOWED
This is used to tell the client that the method is not allowed. -
NOT_ACCEPTABLE
This is used to tell the client the request is not acceptable. -
PROXY_AUTHENTICATION_REQUIRED
This is used to tell the client that authentication is required. -
REQUEST_TIMEOUT
This is used to tell the client that the request has timed out. -
CONFLICT
This is used to tell the client that there has been a conflict. -
GONE
This is used to tell the client that the resource has gone. -
LENGTH_REQUIRED
This is used to tell the client that a request length is needed. -
PRECONDITION_FAILED
This is used to tell the client that a precondition has failed. -
REQUEST_ENTITY_TOO_LARGE
This is used to tell the client that the request body is too big. -
REQUEST_URI_TOO_LONG
This is used to tell the client that the request URI is too long. -
UNSUPPORTED_MEDIA_TYPE
This is used to tell the client that the content type is invalid. -
REQUESTED_RANGE_NOT_SATISFIABLE
This is used to tell the client that the range is invalid. -
EXPECTATION_FAILED
This is used to tell the client that the expectation has failed. -
INTERNAL_SERVER_ERROR
This is sent when the request has caused an internal server error. -
NOT_IMPLEMENTED
This is used to tell the client the resource is not implemented. -
BAD_GATEWAY
This is used to tell the client that the gateway is invalid. -
SERVICE_UNAVAILABLE
This is used to tell the client the resource is unavailable. -
GATEWAY_TIMEOUT
This is used to tell the client there was a gateway timeout. -
VERSION_NOT_SUPPORTED
This is used to tell the client the request version is invalid.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
getCode
public int getCode()This is used to acquire the code of the status object. This is used in the HTTP response message to tell the client what kind of response this represents. Typically this is used to get a code for a known response state for convenience.- Returns:
- the code associated by this status instance
-
getDescription
This is used to provide the status description. The description is the textual description of the response state. It is used so that the response can be interpreted and is a required part of the HTTP response combined with the status code.- Returns:
- the description associated by this status instance
-
getDescription
This is used to provide the status description. The description is the textual description of the response state. It is used so that the response can be interpreted and is a required part of the HTTP response combined with the status code.- Parameters:
code
- this is the code to resolve the description for- Returns:
- the description associated by this status instance
-