public class ResponseStatusConverter extends Object
ResponseStatus
,
KeyValueStatus
Modifier and Type | Field and Description |
---|---|
static int |
HTTP_ACCEPTED |
static int |
HTTP_BAD_REQUEST |
static int |
HTTP_CONFLICT |
static int |
HTTP_CREATED |
static int |
HTTP_INTERNAL_ERROR |
static int |
HTTP_NOT_FOUND |
static int |
HTTP_OK |
static int |
HTTP_TOO_MANY_REQUESTS |
static int |
HTTP_UNAUTHORIZED |
Constructor and Description |
---|
ResponseStatusConverter() |
Modifier and Type | Method and Description |
---|---|
static ResponseStatusDetails |
detailsFromBinary(byte dataType,
ByteBuf content) |
static ResponseStatus |
fromBinary(short code)
Convert the binary protocol status in a typesafe enum that can be acted upon later.
|
static ResponseStatus |
fromHttp(int code)
Convert the http protocol status in a typesafe enum that can be acted upon later.
|
static ErrorMap |
getBinaryErrorMap()
Get the current error map used by the response status converter
|
static ErrorMap.ErrorCode |
readErrorCodeFromErrorMap(short code)
Get the error code from Key Value error map
|
static void |
updateBinaryErrorMap(ErrorMap map)
Updates the current error map in use for all uses of the response status converter.
|
public static final int HTTP_OK
public static final int HTTP_CREATED
public static final int HTTP_ACCEPTED
public static final int HTTP_BAD_REQUEST
public static final int HTTP_UNAUTHORIZED
public static final int HTTP_NOT_FOUND
public static final int HTTP_CONFLICT
public static final int HTTP_TOO_MANY_REQUESTS
public static final int HTTP_INTERNAL_ERROR
public static ResponseStatus fromBinary(short code)
code
- the status to convert.public static ErrorMap.ErrorCode readErrorCodeFromErrorMap(short code)
code
- the status to convert.public static ResponseStatus fromHttp(int code)
code
- the status to convert.public static ResponseStatusDetails detailsFromBinary(byte dataType, ByteBuf content)
public static void updateBinaryErrorMap(ErrorMap map)
map
- the map in use, it always uses the latest one.public static ErrorMap getBinaryErrorMap()
Copyright © 2021 Couchbase, Inc.. All rights reserved.