Package dev.getelements.elements.rt
Enum Class ResponseCode
- All Implemented Interfaces:
Serializable
,Comparable<ResponseCode>
,Constable
Enumeration of the various server reserved response codes. Each code is is essentially the ordinal of the enum, as
determined by
Enum.ordinal()
, or'd with the SYSTEM_RESERVED_MASK
. Client code shall not use error codes
that are masked by the SYSTEM_RESERVED_MASK
or this may interfere with remapping of errors.
The only exception to the SYSTEM_RESERVED_MASK
is the OK
status, with a value of 0 to universally
indicate that there is no error.
These codes may be mapped to other status codes (such as HTTP status codes), but are used to provide more
fine-grained information as to what exactly has failed internally. Client code is free to use their own custom
response code format, so long as it does not conflict with any of the SYSTEM_RESERVED_MASK
.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that the requested asset is not found.Async operation was canceled.The request failed and should not be retried.The content supplied in the request has invalid content or payload.The request was bad, malformed but could be re-attempted.Indicates a custom response code.Indicates that we were trying to insert or create a duplicate resource.Indicates that we were trying to register a task twice for the same task IDAuth failed, the request should be abandoned.Auth failed, the request should be re-attempted with new authentication credentailsIndicates that a handler reached a timeout condition.Indicates the server encountered a bad manifest and theIndicates that the server encountered an unknown error.Indicates that a type has an invalidNodeId
Indicates that the manifest was not found.A particular method could not be found at the requested path.A particular service could not be found at the requested path.A module was not found by the resource loaderThe system could not contact the app node with the given address.Used to relay a not found condition, other than method or path.The response was okay.A particular operation, (eg HTTP Operation) could not be found.Indicates that the parameter is not found.A resource has been destroyed and the client code is now operating with a dead handle to a Resource.A resource was destroyed while waiting for a response.A particular path or resource ID could not be found.Indicates that there was a problem routing calls to a remote node.A particular service could not be found at the requested path.Indicates that the supplied task was killed.Indicates that the supplied task was not found.The request timed out.indicates that the server cannot handle the current loadNo HTTP Operation for the supplied Accept headers is available to service the request.Indicates an unknown code.No HTTP Operation for the supplied Content-Type header is available to service the request.The request was canceled by the user.No HTTP Operation for the particular HTTP Verb could be matched. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
MasksResponseCode
values that are considered reserved by the system. -
Method Summary
Modifier and TypeMethodDescriptionint
getCode()
Gets the actual code as returned by code.static ResponseCode
getCodeForValue
(int code) Gets the code for the value.Gets a descriptive string representing thisResponseCode
.static String
getDescriptionFromCode
(int code) Returns a human readable description of the code.static boolean
isReserved
(int code) Checks if the suppliedstatic ResponseCode
Returns the enum constant of this class with the specified name.static ResponseCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
OK
The response was okay. The onlyResponseCode
with a code value of 0. -
BAD_REQUEST_RETRY
The request was bad, malformed but could be re-attempted. -
BAD_REQUEST_FATAL
The request failed and should not be retried. -
BAD_REQUEST_INVALID_CONTENT
The content supplied in the request has invalid content or payload. -
DUPLICATE_RESOURCE
Indicates that we were trying to insert or create a duplicate resource. -
DUPLICATE_TASK
Indicates that we were trying to register a task twice for the same task ID -
TASK_NOT_FOUND
Indicates that the supplied task was not found. -
TASK_KILLED
Indicates that the supplied task was killed. -
RESOURCE_NOT_FOUND
A particular path or resource ID could not be found. -
RESOURCE_DESTROYED
A resource was destroyed while waiting for a response. -
RESOURCE_DEAD
A resource has been destroyed and the client code is now operating with a dead handle to a Resource. -
ASSET_NOT_FOUND
Indicates that the requested asset is not found. -
MANIFEST_NOT_FOUND
Indicates that the manifest was not found. -
MODULE_NOT_FOUND
A module was not found by the resource loader -
METHOD_NOT_FOUND
A particular method could not be found at the requested path. -
SERVICE_NOT_FOUND
A particular service could not be found at the requested path. -
MODEL_NOT_FOUND
A particular service could not be found at the requested path. -
PARAMETER_NOT_FOUND
Indicates that the parameter is not found. -
OPERATION_NOT_FOUND
A particular operation, (eg HTTP Operation) could not be found. -
NODE_NOT_FOUND
The system could not contact the app node with the given address. -
VERB_NOT_SUPPORTED
No HTTP Operation for the particular HTTP Verb could be matched. -
UNACCEPTABLE_CONTENT
No HTTP Operation for the supplied Accept headers is available to service the request. -
UNSUPPORTED_MEDIA_TYPE
No HTTP Operation for the supplied Content-Type header is available to service the request. -
NOT_FOUND
Used to relay a not found condition, other than method or path. -
USER_CANCELED_FATAL
The request was canceled by the user. -
FAILED_AUTH_RETRY
Auth failed, the request should be re-attempted with new authentication credentails -
FAILED_AUTH_FATAL
Auth failed, the request should be abandoned. -
TOO_BUSY_FATAL
indicates that the server cannot handle the current load -
TIMEOUT_RETRY
The request timed out. This may not actually sent by the server but may be supplied by the client to indicate that the request timed out. -
INTERNAL_ERROR_FATAL
Indicates that the server encountered an unknown error. -
INTERNAL_ERROR_BAD_MANIFEST_FATAL
Indicates the server encountered a bad manifest and the -
ROUTING_EXCEPTION
Indicates that there was a problem routing calls to a remote node. -
INVALID_NODE_ID
Indicates that a type has an invalidNodeId
-
HANDLER_TIMEOUT
Indicates that a handler reached a timeout condition. -
ASYNC_OPERATION_CANCELED
Async operation was canceled. -
CUSTOM
Indicates a custom response code. A custom code is any code that is not masked by theSYSTEM_RESERVED_MASK
. -
UNKNOWN
Indicates an unknown code. A code isUNKNOWN
when it is masked by theSYSTEM_RESERVED_MASK
but cannot be identified usinggetCode()
.
-
-
Field Details
-
SYSTEM_RESERVED_MASK
public static final int SYSTEM_RESERVED_MASKMasksResponseCode
values that are considered reserved by the system.- See Also:
-
-
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()Gets the actual code as returned by code.- Returns:
- the response code
-
getDescription
Gets a descriptive string representing thisResponseCode
.- Returns:
- the
ResponseCode
-
getCodeForValue
Gets the code for the value.- Parameters:
code
- theResponseCode
for the provided code value.- Returns:
- the
ResponseCode
-
isReserved
public static boolean isReserved(int code) Checks if the supplied- Parameters:
code
-- Returns:
-
getDescriptionFromCode
Returns a human readable description of the code. This should always return a value.- Parameters:
code
- the code- Returns:
- the description of the code
-