Example usage for io.netty.handler.codec.memcache.binary BinaryMemcacheResponseStatus SUCCESS

List of usage examples for io.netty.handler.codec.memcache.binary BinaryMemcacheResponseStatus SUCCESS

Introduction

In this page you can find the example usage for io.netty.handler.codec.memcache.binary BinaryMemcacheResponseStatus SUCCESS.

Prototype

short SUCCESS

To view the source code for io.netty.handler.codec.memcache.binary BinaryMemcacheResponseStatus SUCCESS.

Click Source Link

Usage

From source file:com.couchbase.client.core.endpoint.binary.BinaryCodec.java

License:Open Source License

/**
 * Convert the binary protocol status in a typesafe enum that can be acted upon later.
 *
 * @param status the status to convert.//  w  ww .  j a  v  a  2s . c  om
 * @return the converted response status.
 */
private ResponseStatus convertStatus(short status) {
    switch (status) {
    case BinaryMemcacheResponseStatus.SUCCESS:
        return ResponseStatus.SUCCESS;
    case BinaryMemcacheResponseStatus.KEY_EEXISTS:
        return ResponseStatus.EXISTS;
    case BinaryMemcacheResponseStatus.KEY_ENOENT:
        return ResponseStatus.NOT_EXISTS;
    case 0x07: // Represents NOT_MY_VBUCKET
        return ResponseStatus.RETRY;
    default:
        return ResponseStatus.FAILURE;
    }
}