Enum Class RpcStatus
- All Implemented Interfaces:
Serializable, Comparable<RpcStatus>, Constable
Встроенные RPC status code-ы для transport-слоя и общих service-level ошибок.
Built-in RPC status codes used by the transport and by shared service-level validation failures.
Числовые значения намеренно повторяют знакомую HTTP-style семантику, чтобы логи, метрики, дашборды и client-side обработка оставались интуитивными.
The numeric values intentionally follow familiar HTTP-style semantics so logs, metrics, dashboards, and client-side handling remain easy to interpret.
Диапазоны 4xx и 5xx зарезервированы библиотекой для built-in transport и
system meanings. Application-defined business code-ы должны использовать
значения >= 1000.
The library reserves the standard 4xx and 5xx ranges for built-in
transport/system meanings. Application-defined business codes must use
values >= 1000.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription202 Accepted / принято в обработку.208 Already Reported / уже сообщено.502 Bad Gateway / плохой gateway.400 Bad Request / некорректный запрос.409 Conflict / конфликт.100 Continue / продолжайте запрос.201 Created / создано.103 Early Hints / ранние подсказки.417 Expectation Failed / expectation не выполнена.424 Failed Dependency / ошибка зависимости.403 Forbidden / доступ запрещен.302 Found / временно найдено.504 Gateway Timeout / таймаут gateway.410 Gone / ресурс удален.505 HTTP Version Not Supported / версия HTTP не поддерживается.418 I'm a Teapot / шуточный HTTP статус.226 IM Used / использован IM.507 Insufficient Storage / недостаточно хранилища.500 Internal Server Error / внутренняя ошибка сервера.411 Length Required / нужен Content-Length.423 Locked / заблокировано.508 Loop Detected / обнаружен цикл.405 Method Not Allowed / метод не поддерживается.421 Misdirected Request / запрос адресован не туда.301 Moved Permanently / постоянно перемещено.207 Multi-Status / множественный статус.300 Multiple Choices / несколько вариантов.511 Network Authentication Required / требуется сетевая авторизация.204 No Content / нет тела ответа.203 Non-Authoritative Information / неавторитативная информация.406 Not Acceptable / неприемлемо.510 Not Extended / не продлено.404 Not Found / не найдено.501 Not Implemented / не реализовано.304 Not Modified / не изменено.200 OK / успех.206 Partial Content / частичное содержимое.413 Payload Too Large / payload слишком большой.402 Payment Required / требуется оплата.308 Permanent Redirect / постоянный редирект.412 Precondition Failed / precondition не выполнена.428 Precondition Required / требуется precondition.102 Processing / запрос обрабатывается.407 Proxy Authentication Required / нужна proxy-авторизация.416 Range Not Satisfiable / range невозможно удовлетворить.431 Request Header Fields Too Large / заголовки слишком большие.408 Request Timeout / таймаут запроса.205 Reset Content / сброс содержимого.303 See Other / смотри другое.503 Service Unavailable / сервис недоступен.101 Switching Protocols / переключение протокола.307 Temporary Redirect / временный редирект.425 Too Early / слишком рано.429 Too Many Requests / слишком много запросов.401 Unauthorized / не авторизовано.451 Unavailable For Legal Reasons / недоступно по юридическим причинам.422 Unprocessable Entity / невозможно обработать сущность.415 Unsupported Media Type / неподдерживаемый media type.426 Upgrade Required / требуется upgrade.414 URI Too Long / URI слишком длинный.305 Use Proxy / используй proxy.506 Variant Also Negotiates / variant некорректно negotiates. -
Method Summary
Modifier and TypeMethodDescriptionintcode()Returns the numeric status code.static RpcStatusfromCode(int code) Resolves a numeric code into a known status when possible.booleanReturns whether the status belongs to the 4xx client-error range.booleanReturns whether the status belongs to the 1xx informational range.booleanReturns whether the status belongs to the 3xx redirection range.booleanReturns whether the status is commonly retryable for transport callers.booleanReturns whether the status belongs to the 5xx server-error range.booleanReturns whether the status belongs to the 2xx success range.static RpcStatusReturns the enum constant of this class with the specified name.static RpcStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CONTINUE
100 Continue / продолжайте запрос. -
SWITCHING_PROTOCOLS
101 Switching Protocols / переключение протокола. -
PROCESSING
102 Processing / запрос обрабатывается. -
EARLY_HINTS
103 Early Hints / ранние подсказки. -
OK
200 OK / успех. -
CREATED
201 Created / создано. -
ACCEPTED
202 Accepted / принято в обработку. -
NON_AUTHORITATIVE_INFORMATION
203 Non-Authoritative Information / неавторитативная информация. -
NO_CONTENT
204 No Content / нет тела ответа. -
RESET_CONTENT
205 Reset Content / сброс содержимого. -
PARTIAL_CONTENT
206 Partial Content / частичное содержимое. -
MULTI_STATUS
207 Multi-Status / множественный статус. -
ALREADY_REPORTED
208 Already Reported / уже сообщено. -
IM_USED
226 IM Used / использован IM. -
MULTIPLE_CHOICES
300 Multiple Choices / несколько вариантов. -
MOVED_PERMANENTLY
301 Moved Permanently / постоянно перемещено. -
FOUND
302 Found / временно найдено. -
SEE_OTHER
303 See Other / смотри другое. -
NOT_MODIFIED
304 Not Modified / не изменено. -
USE_PROXY
305 Use Proxy / используй proxy. -
TEMPORARY_REDIRECT
307 Temporary Redirect / временный редирект. -
PERMANENT_REDIRECT
308 Permanent Redirect / постоянный редирект. -
BAD_REQUEST
400 Bad Request / некорректный запрос. -
UNAUTHORIZED
401 Unauthorized / не авторизовано. -
PAYMENT_REQUIRED
402 Payment Required / требуется оплата. -
FORBIDDEN
403 Forbidden / доступ запрещен. -
NOT_FOUND
404 Not Found / не найдено. -
METHOD_NOT_ALLOWED
405 Method Not Allowed / метод не поддерживается. -
NOT_ACCEPTABLE
406 Not Acceptable / неприемлемо. -
PROXY_AUTHENTICATION_REQUIRED
407 Proxy Authentication Required / нужна proxy-авторизация. -
REQUEST_TIMEOUT
408 Request Timeout / таймаут запроса. -
CONFLICT
409 Conflict / конфликт. -
GONE
410 Gone / ресурс удален. -
LENGTH_REQUIRED
411 Length Required / нужен Content-Length. -
PRECONDITION_FAILED
412 Precondition Failed / precondition не выполнена. -
PAYLOAD_TOO_LARGE
413 Payload Too Large / payload слишком большой. -
URI_TOO_LONG
414 URI Too Long / URI слишком длинный. -
UNSUPPORTED_MEDIA_TYPE
415 Unsupported Media Type / неподдерживаемый media type. -
RANGE_NOT_SATISFIABLE
416 Range Not Satisfiable / range невозможно удовлетворить. -
EXPECTATION_FAILED
417 Expectation Failed / expectation не выполнена. -
I_AM_A_TEAPOT
418 I'm a Teapot / шуточный HTTP статус. -
MISDIRECTED_REQUEST
421 Misdirected Request / запрос адресован не туда. -
UNPROCESSABLE_ENTITY
422 Unprocessable Entity / невозможно обработать сущность. -
LOCKED
423 Locked / заблокировано. -
FAILED_DEPENDENCY
424 Failed Dependency / ошибка зависимости. -
TOO_EARLY
425 Too Early / слишком рано. -
UPGRADE_REQUIRED
426 Upgrade Required / требуется upgrade. -
PRECONDITION_REQUIRED
428 Precondition Required / требуется precondition. -
TOO_MANY_REQUESTS
429 Too Many Requests / слишком много запросов. -
REQUEST_HEADER_FIELDS_TOO_LARGE
431 Request Header Fields Too Large / заголовки слишком большие. -
UNAVAILABLE_FOR_LEGAL_REASONS
451 Unavailable For Legal Reasons / недоступно по юридическим причинам. -
INTERNAL_SERVER_ERROR
500 Internal Server Error / внутренняя ошибка сервера. -
NOT_IMPLEMENTED
501 Not Implemented / не реализовано. -
BAD_GATEWAY
502 Bad Gateway / плохой gateway. -
SERVICE_UNAVAILABLE
503 Service Unavailable / сервис недоступен. -
GATEWAY_TIMEOUT
504 Gateway Timeout / таймаут gateway. -
HTTP_VERSION_NOT_SUPPORTED
505 HTTP Version Not Supported / версия HTTP не поддерживается. -
VARIANT_ALSO_NEGOTIATES
506 Variant Also Negotiates / variant некорректно negotiates. -
INSUFFICIENT_STORAGE
507 Insufficient Storage / недостаточно хранилища. -
LOOP_DETECTED
508 Loop Detected / обнаружен цикл. -
NOT_EXTENDED
510 Not Extended / не продлено. -
NETWORK_AUTHENTICATION_REQUIRED
511 Network Authentication Required / требуется сетевая авторизация.
-
-
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
-
code
public int code()Returns the numeric status code.- Returns:
- numeric status code
-
isInformational
public boolean isInformational()Returns whether the status belongs to the 1xx informational range.- Returns:
truefor informational statuses
-
isSuccess
public boolean isSuccess()Returns whether the status belongs to the 2xx success range.- Returns:
truefor success statuses
-
isRedirect
public boolean isRedirect()Returns whether the status belongs to the 3xx redirection range.- Returns:
truefor redirect-like statuses
-
isClientError
public boolean isClientError()Returns whether the status belongs to the 4xx client-error range.- Returns:
truefor client errors
-
isServerError
public boolean isServerError()Returns whether the status belongs to the 5xx server-error range.- Returns:
truefor server errors
-
isRetryable
public boolean isRetryable()Returns whether the status is commonly retryable for transport callers.- Returns:
truefor statuses that can reasonably be retried
-
fromCode
Resolves a numeric code into a known status when possible.- Parameters:
code- numeric status code- Returns:
- matching enum value or
nullfor custom codes
-