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

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

Introduction

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

Prototype

short KEY_ENOENT

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

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.//from   ww  w  .jav a2  s  . c o m
 * @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;
    }
}