Enum Class ResponseCode

java.lang.Object
java.lang.Enum<ResponseCode>
dev.getelements.elements.rt.ResponseCode
All Implemented Interfaces:
Serializable, Comparable<ResponseCode>, Constable

public enum ResponseCode extends Enum<ResponseCode>
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.
  • Enum Constant Details

    • OK

      public static final ResponseCode OK
      The response was okay. The only ResponseCode with a code value of 0.
    • BAD_REQUEST_RETRY

      public static final ResponseCode BAD_REQUEST_RETRY
      The request was bad, malformed but could be re-attempted.
    • BAD_REQUEST_FATAL

      public static final ResponseCode BAD_REQUEST_FATAL
      The request failed and should not be retried.
    • BAD_REQUEST_INVALID_CONTENT

      public static final ResponseCode BAD_REQUEST_INVALID_CONTENT
      The content supplied in the request has invalid content or payload.
    • DUPLICATE_RESOURCE

      public static final ResponseCode DUPLICATE_RESOURCE
      Indicates that we were trying to insert or create a duplicate resource.
    • DUPLICATE_TASK

      public static final ResponseCode DUPLICATE_TASK
      Indicates that we were trying to register a task twice for the same task ID
    • TASK_NOT_FOUND

      public static final ResponseCode TASK_NOT_FOUND
      Indicates that the supplied task was not found.
    • TASK_KILLED

      public static final ResponseCode TASK_KILLED
      Indicates that the supplied task was killed.
    • RESOURCE_NOT_FOUND

      public static final ResponseCode RESOURCE_NOT_FOUND
      A particular path or resource ID could not be found.
    • RESOURCE_DESTROYED

      public static final ResponseCode RESOURCE_DESTROYED
      A resource was destroyed while waiting for a response.
    • RESOURCE_DEAD

      public static final ResponseCode RESOURCE_DEAD
      A resource has been destroyed and the client code is now operating with a dead handle to a Resource.
    • ASSET_NOT_FOUND

      public static final ResponseCode ASSET_NOT_FOUND
      Indicates that the requested asset is not found.
    • MANIFEST_NOT_FOUND

      public static final ResponseCode MANIFEST_NOT_FOUND
      Indicates that the manifest was not found.
    • MODULE_NOT_FOUND

      public static final ResponseCode MODULE_NOT_FOUND
      A module was not found by the resource loader
    • METHOD_NOT_FOUND

      public static final ResponseCode METHOD_NOT_FOUND
      A particular method could not be found at the requested path.
    • SERVICE_NOT_FOUND

      public static final ResponseCode SERVICE_NOT_FOUND
      A particular service could not be found at the requested path.
    • MODEL_NOT_FOUND

      public static final ResponseCode MODEL_NOT_FOUND
      A particular service could not be found at the requested path.
    • PARAMETER_NOT_FOUND

      public static final ResponseCode PARAMETER_NOT_FOUND
      Indicates that the parameter is not found.
    • OPERATION_NOT_FOUND

      public static final ResponseCode OPERATION_NOT_FOUND
      A particular operation, (eg HTTP Operation) could not be found.
    • NODE_NOT_FOUND

      public static final ResponseCode NODE_NOT_FOUND
      The system could not contact the app node with the given address.
    • VERB_NOT_SUPPORTED

      public static final ResponseCode VERB_NOT_SUPPORTED
      No HTTP Operation for the particular HTTP Verb could be matched.
    • UNACCEPTABLE_CONTENT

      public static final ResponseCode UNACCEPTABLE_CONTENT
      No HTTP Operation for the supplied Accept headers is available to service the request.
    • UNSUPPORTED_MEDIA_TYPE

      public static final ResponseCode UNSUPPORTED_MEDIA_TYPE
      No HTTP Operation for the supplied Content-Type header is available to service the request.
    • NOT_FOUND

      public static final ResponseCode NOT_FOUND
      Used to relay a not found condition, other than method or path.
    • USER_CANCELED_FATAL

      public static final ResponseCode USER_CANCELED_FATAL
      The request was canceled by the user.
    • FAILED_AUTH_RETRY

      public static final ResponseCode FAILED_AUTH_RETRY
      Auth failed, the request should be re-attempted with new authentication credentails
    • FAILED_AUTH_FATAL

      public static final ResponseCode FAILED_AUTH_FATAL
      Auth failed, the request should be abandoned.
    • TOO_BUSY_FATAL

      public static final ResponseCode TOO_BUSY_FATAL
      indicates that the server cannot handle the current load
    • TIMEOUT_RETRY

      public static final ResponseCode 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

      public static final ResponseCode INTERNAL_ERROR_FATAL
      Indicates that the server encountered an unknown error.
    • INTERNAL_ERROR_BAD_MANIFEST_FATAL

      public static final ResponseCode INTERNAL_ERROR_BAD_MANIFEST_FATAL
      Indicates the server encountered a bad manifest and the
    • ROUTING_EXCEPTION

      public static final ResponseCode ROUTING_EXCEPTION
      Indicates that there was a problem routing calls to a remote node.
    • INVALID_NODE_ID

      public static final ResponseCode INVALID_NODE_ID
      Indicates that a type has an invalid NodeId
    • HANDLER_TIMEOUT

      public static final ResponseCode HANDLER_TIMEOUT
      Indicates that a handler reached a timeout condition.
    • ASYNC_OPERATION_CANCELED

      public static final ResponseCode ASYNC_OPERATION_CANCELED
      Async operation was canceled.
    • CUSTOM

      public static final ResponseCode CUSTOM
      Indicates a custom response code. A custom code is any code that is not masked by the SYSTEM_RESERVED_MASK.
    • UNKNOWN

      public static final ResponseCode UNKNOWN
      Indicates an unknown code. A code is UNKNOWN when it is masked by the SYSTEM_RESERVED_MASK but cannot be identified using getCode().
  • Field Details

    • SYSTEM_RESERVED_MASK

      public static final int SYSTEM_RESERVED_MASK
      Masks ResponseCode values that are considered reserved by the system.
      See Also:
  • Method Details

    • values

      public static ResponseCode[] 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

      public static ResponseCode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Gets the actual code as returned by code.
      Returns:
      the response code
    • getDescription

      public String getDescription()
      Gets a descriptive string representing this ResponseCode.
      Returns:
      the ResponseCode
    • getCodeForValue

      public static ResponseCode getCodeForValue(int code)
      Gets the code for the value.
      Parameters:
      code - the ResponseCode for the provided code value.
      Returns:
      the ResponseCode
    • isReserved

      public static boolean isReserved(int code)
      Checks if the supplied
      Parameters:
      code -
      Returns:
    • getDescriptionFromCode

      public static String getDescriptionFromCode(int code)
      Returns a human readable description of the code. This should always return a value.
      Parameters:
      code - the code
      Returns:
      the description of the code