public class ResponseStatusConverter extends Object
Helper class to easily convert different handler status types to a common one.
Modifier and Type | Field and Description |
---|---|
static short |
BINARY_ERR_2BIG |
static short |
BINARY_ERR_BUSY |
static short |
BINARY_ERR_DELTA_BADVAL |
static short |
BINARY_ERR_EXISTS |
static short |
BINARY_ERR_INTERNAL |
static short |
BINARY_ERR_INVAL |
static short |
BINARY_ERR_NO_MEM |
static short |
BINARY_ERR_NOT_FOUND |
static short |
BINARY_ERR_NOT_MY_VBUCKET |
static short |
BINARY_ERR_NOT_STORED |
static short |
BINARY_ERR_NOT_SUPPORTED |
static short |
BINARY_ERR_TEMP_FAIL |
static short |
BINARY_ERR_UNKNOWN_COMMAND |
static short |
BINARY_SUCCESS |
static int |
HTTP_ACCEPTED |
static int |
HTTP_BAD_REQUEST |
static int |
HTTP_CREATED |
static int |
HTTP_INTERNAL_ERROR |
static int |
HTTP_NOT_FOUND |
static int |
HTTP_OK |
Constructor and Description |
---|
ResponseStatusConverter() |
Modifier and Type | Method and Description |
---|---|
static ResponseStatus |
fromBinary(short status)
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.
|
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_NOT_FOUND
public static final int HTTP_INTERNAL_ERROR
public static final short BINARY_SUCCESS
public static final short BINARY_ERR_NOT_FOUND
public static final short BINARY_ERR_EXISTS
public static final short BINARY_ERR_2BIG
public static final short BINARY_ERR_INVAL
public static final short BINARY_ERR_NOT_STORED
public static final short BINARY_ERR_DELTA_BADVAL
public static final short BINARY_ERR_NOT_MY_VBUCKET
public static final short BINARY_ERR_UNKNOWN_COMMAND
public static final short BINARY_ERR_NO_MEM
public static final short BINARY_ERR_NOT_SUPPORTED
public static final short BINARY_ERR_INTERNAL
public static final short BINARY_ERR_BUSY
public static final short BINARY_ERR_TEMP_FAIL
public static ResponseStatus fromBinary(short status)
Convert the binary protocol status in a typesafe enum that can be acted upon later.
status
- the status to convert.public static ResponseStatus fromHttp(int code)
Convert the http protocol status in a typesafe enum that can be acted upon later.
code
- the status to convert.Copyright © 2014 Couchbase, Inc.