Package io.servicetalk.grpc.api
Enum GrpcStatusCode
- java.lang.Object
-
- java.lang.Enum<GrpcStatusCode>
-
- io.servicetalk.grpc.api.GrpcStatusCode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GrpcStatusCode>
public enum GrpcStatusCode extends java.lang.Enum<GrpcStatusCode>
Standard gRPC status codes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ABORTED
Aborted, typically due to a concurrency issue (think CAS).ALREADY_EXISTS
Some entity that we attempted to create already exists.CANCELLED
Cancelled (typically by caller).DATA_LOSS
Data corruption.DEADLINE_EXCEEDED
Deadline expired.FAILED_PRECONDITION
The action cannot be executed on the current system state.INTERNAL
Internal invariant violated.INVALID_ARGUMENT
Client specified an invalid argument.NOT_FOUND
Some requested entity not found.OK
Successful.OUT_OF_RANGE
Used for range errors.PERMISSION_DENIED
Permission denied for a particular client.RESOURCE_EXHAUSTED
Resource exhausted.UNAUTHENTICATED
Cannot authenticate the client.UNAVAILABLE
Service unavailable, similar to 503, client may retry.UNIMPLEMENTED
Unimplemented action.UNKNOWN
Unknown error.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static GrpcStatusCode
fromCodeValue(int codeValue)
Obtains the status code given an integer code value.static GrpcStatusCode
fromCodeValue(java.lang.CharSequence codeValue)
Obtains the status code given a code value.GrpcStatus
status()
Returns a standardGrpcStatus
with this status code.int
value()
Returns the integer code value.static GrpcStatusCode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static GrpcStatusCode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
OK
public static final GrpcStatusCode OK
Successful.
-
CANCELLED
public static final GrpcStatusCode CANCELLED
Cancelled (typically by caller).
-
UNKNOWN
public static final GrpcStatusCode UNKNOWN
Unknown error.
-
INVALID_ARGUMENT
public static final GrpcStatusCode INVALID_ARGUMENT
Client specified an invalid argument.
-
DEADLINE_EXCEEDED
public static final GrpcStatusCode DEADLINE_EXCEEDED
Deadline expired.
-
NOT_FOUND
public static final GrpcStatusCode NOT_FOUND
Some requested entity not found.
-
ALREADY_EXISTS
public static final GrpcStatusCode ALREADY_EXISTS
Some entity that we attempted to create already exists.
-
PERMISSION_DENIED
public static final GrpcStatusCode PERMISSION_DENIED
Permission denied for a particular client. Different fromUNAUTHENTICATED
.
-
RESOURCE_EXHAUSTED
public static final GrpcStatusCode RESOURCE_EXHAUSTED
Resource exhausted.
-
FAILED_PRECONDITION
public static final GrpcStatusCode FAILED_PRECONDITION
The action cannot be executed on the current system state. Client should not retry..
-
ABORTED
public static final GrpcStatusCode ABORTED
Aborted, typically due to a concurrency issue (think CAS). Client may retry the whole sequence..
-
OUT_OF_RANGE
public static final GrpcStatusCode OUT_OF_RANGE
Used for range errors.
-
UNIMPLEMENTED
public static final GrpcStatusCode UNIMPLEMENTED
Unimplemented action.
-
INTERNAL
public static final GrpcStatusCode INTERNAL
Internal invariant violated.
-
UNAVAILABLE
public static final GrpcStatusCode UNAVAILABLE
Service unavailable, similar to 503, client may retry.
-
DATA_LOSS
public static final GrpcStatusCode DATA_LOSS
Data corruption.
-
UNAUTHENTICATED
public static final GrpcStatusCode UNAUTHENTICATED
Cannot authenticate the client.
-
-
Method Detail
-
values
public static GrpcStatusCode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GrpcStatusCode c : GrpcStatusCode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GrpcStatusCode valueOf(java.lang.String name)
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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromCodeValue
public static GrpcStatusCode fromCodeValue(java.lang.CharSequence codeValue)
Obtains the status code given a code value.- Parameters:
codeValue
- code value.- Returns:
- status code associated with the code value, or
UNKNOWN
.
-
fromCodeValue
public static GrpcStatusCode fromCodeValue(int codeValue)
Obtains the status code given an integer code value.- Parameters:
codeValue
- integer code value.- Returns:
- status code associated with the code value, or
UNKNOWN
.
-
value
public int value()
Returns the integer code value.- Returns:
- the integer code value.
-
status
public GrpcStatus status()
Returns a standardGrpcStatus
with this status code.- Returns:
- a standard
GrpcStatus
with this status code.
-
-