Package org.apache.guacamole.protocol
Enum GuacamoleStatus
- All Implemented Interfaces:
Serializable
,Comparable<GuacamoleStatus>
,java.lang.constant.Constable
All possible statuses returned by various Guacamole instructions, each having
a corresponding code.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe operation could not be performed because bad parameters were given.The client sent data of an unsupported or unexpected type.Permission was denied to perform the operation, and this operation will not be granted even if the user is authorized.The client sent too much data.The client took too long to respond.The operation failed because the current client is already using too many resources.Permission was denied to perform the operation, as the user is not yet authorized (not yet logged in, for example).The operation could not be performed as the requested resource is now closed.The operation could not be performed as the requested resource is already in use.The operation could not be performed as the requested resource does not exist.The operation could not be performed as the server is busy.The operation could not be performed due to an internal failure.The session within the upstream server has been forcibly terminated.The session within the upstream server has ended because it conflicted with another session.The session within the upstream server has ended because it appeared to be inactive.The operation succeeded.The requested operation is unsupported.The operation was unsuccessful due to an error or otherwise unexpected condition of the upstream server.The operation could not be performed because the upstream server does not appear to exist.The operation could not be performed because the upstream server is not responding.The operation could not be performed because the upstream server is not available to service the request. -
Method Summary
Modifier and TypeMethodDescriptionstatic GuacamoleStatus
fromGuacamoleStatusCode
(int code) Returns the GuacamoleStatus corresponding to the given Guacamole protocol status code.int
Returns the corresponding Guacamole protocol status code.int
Returns the most applicable HTTP error code.int
Returns the most applicable HTTP error code.abstract GuacamoleException
toException
(String message) Returns an instance of theGuacamoleException
subclass corresponding to this Guacamole protocol status code.static GuacamoleStatus
Returns the enum constant of this type with the specified name.static GuacamoleStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SUCCESS
The operation succeeded. -
UNSUPPORTED
The requested operation is unsupported. -
SERVER_ERROR
The operation could not be performed due to an internal failure. -
SERVER_BUSY
The operation could not be performed as the server is busy. -
UPSTREAM_TIMEOUT
The operation could not be performed because the upstream server is not responding. -
UPSTREAM_ERROR
The operation was unsuccessful due to an error or otherwise unexpected condition of the upstream server. -
RESOURCE_NOT_FOUND
The operation could not be performed as the requested resource does not exist. -
RESOURCE_CONFLICT
The operation could not be performed as the requested resource is already in use. -
RESOURCE_CLOSED
The operation could not be performed as the requested resource is now closed. -
UPSTREAM_NOT_FOUND
The operation could not be performed because the upstream server does not appear to exist. -
UPSTREAM_UNAVAILABLE
The operation could not be performed because the upstream server is not available to service the request. -
SESSION_CONFLICT
The session within the upstream server has ended because it conflicted with another session. -
SESSION_TIMEOUT
The session within the upstream server has ended because it appeared to be inactive. -
SESSION_CLOSED
The session within the upstream server has been forcibly terminated. -
CLIENT_BAD_REQUEST
The operation could not be performed because bad parameters were given. -
CLIENT_UNAUTHORIZED
Permission was denied to perform the operation, as the user is not yet authorized (not yet logged in, for example). As HTTP 401 has implications for HTTP-specific authorization schemes, this status continues to map to HTTP 403 ("Forbidden"). To do otherwise would risk unintended effects. -
CLIENT_FORBIDDEN
Permission was denied to perform the operation, and this operation will not be granted even if the user is authorized. -
CLIENT_TIMEOUT
The client took too long to respond. -
CLIENT_OVERRUN
The client sent too much data. -
CLIENT_BAD_TYPE
The client sent data of an unsupported or unexpected type. -
CLIENT_TOO_MANY
The operation failed because the current client is already using too many resources.
-
-
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
-
getHttpStatusCode
public int getHttpStatusCode()Returns the most applicable HTTP error code.- Returns:
- The most applicable HTTP error code.
-
getWebSocketCode
public int getWebSocketCode()Returns the most applicable HTTP error code.- Returns:
- The most applicable HTTP error code.
-
getGuacamoleStatusCode
public int getGuacamoleStatusCode()Returns the corresponding Guacamole protocol status code.- Returns:
- The corresponding Guacamole protocol status code.
-
fromGuacamoleStatusCode
Returns the GuacamoleStatus corresponding to the given Guacamole protocol status code. If no such GuacamoleStatus is defined, null is returned.- Parameters:
code
- The Guacamole protocol status code to translate into a GuacamoleStatus.- Returns:
- The GuacamoleStatus corresponding to the given Guacamole protocol status code, or null if no such GuacamoleStatus is defined.
-
toException
Returns an instance of theGuacamoleException
subclass corresponding to this Guacamole protocol status code. All status codes have a corresponding GuacamoleException except forSUCCESS
. The returned GuacamoleException will have the provided human-readable message.- Parameters:
message
- A human readable description of the error that occurred.- Returns:
- An instance of the
GuacamoleException
subclass that corresponds to this status code and has the provided human-readable message. - Throws:
IllegalStateException
- If invoked onSUCCESS
, which has no corresponding GuacamoleException.
-