net.spy.memcached.protocol.ascii
Class GetAndTouchOperationImpl

java.lang.Object
  extended by net.spy.memcached.compat.SpyObject
      extended by net.spy.memcached.protocol.BaseOperationImpl
          extended by net.spy.memcached.protocol.ascii.GetAndTouchOperationImpl
All Implemented Interfaces:
GetAndTouchOperation, KeyedOperation, Operation

public class GetAndTouchOperationImpl
extends BaseOperationImpl
implements GetAndTouchOperation

Implementation of the get and touch operation.


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.spy.memcached.ops.GetAndTouchOperation
GetAndTouchOperation.Callback
 
Field Summary
protected static byte[] CRLF
           
 
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
 
Constructor Summary
GetAndTouchOperationImpl(java.lang.String c, int e, GetAndTouchOperation.Callback cb, java.lang.String k)
           
 
Method Summary
 java.util.Collection<java.lang.String> getKeys()
          Get the keys this GetOperation is looking for.
protected  net.spy.memcached.protocol.ascii.OperationReadType getReadType()
           
 void handleLine(java.lang.String line)
           
 void handleRead(java.nio.ByteBuffer b)
          Handle a raw data read.
 void initialize()
          Initialize this operation.
protected  OperationStatus matchStatus(java.lang.String line, OperationStatus... statii)
          Match the status line provided against one of the given OperationStatus objects.
 void readFromBuffer(java.nio.ByteBuffer data)
          Read data from the given byte buffer and dispatch to the appropriate read mechanism.
protected  void setArguments(java.nio.ByteBuffer bb, java.lang.Object... args)
          Set some arguments for an operation into the given byte buffer.
protected  void setReadType(net.spy.memcached.protocol.ascii.OperationReadType to)
          Set the read type of this operation.
 java.lang.String toString()
           
protected  void wasCancelled()
          This is called on each subclass whenever an operation was cancelled.
 
Methods inherited from class net.spy.memcached.protocol.BaseOperationImpl
cancel, getBuffer, getCallback, getException, getHandlingNode, getState, handleError, hasErrored, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setHandlingNode, timeOut, transitionState, writeComplete, writing
 
Methods inherited from class net.spy.memcached.compat.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.spy.memcached.ops.KeyedOperation
getKeys
 
Methods inherited from interface net.spy.memcached.ops.Operation
cancel, getBuffer, getCallback, getException, getHandlingNode, getState, handleRead, hasErrored, initialize, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, readFromBuffer, setHandlingNode, timeOut, writeComplete, writing
 

Field Detail

CRLF

protected static final byte[] CRLF
Constructor Detail

GetAndTouchOperationImpl

public GetAndTouchOperationImpl(java.lang.String c,
                                int e,
                                GetAndTouchOperation.Callback cb,
                                java.lang.String k)
Method Detail

getKeys

public final java.util.Collection<java.lang.String> getKeys()
Get the keys this GetOperation is looking for.


handleLine

public final void handleLine(java.lang.String line)

handleRead

public final void handleRead(java.nio.ByteBuffer b)
Description copied from interface: Operation
Handle a raw data read.

Specified by:
handleRead in interface Operation
Overrides:
handleRead in class BaseOperationImpl

initialize

public final void initialize()
Description copied from interface: Operation
Initialize this operation. This is used to prepare output byte buffers and stuff.

Specified by:
initialize in interface Operation
Specified by:
initialize in class BaseOperationImpl

wasCancelled

protected final void wasCancelled()
Description copied from class: BaseOperationImpl
This is called on each subclass whenever an operation was cancelled.

Overrides:
wasCancelled in class BaseOperationImpl

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

matchStatus

protected final OperationStatus matchStatus(java.lang.String line,
                                            OperationStatus... statii)
Match the status line provided against one of the given OperationStatus objects. If none match, return a failure status with the given line.

Parameters:
line - the current line
statii - several status objects
Returns:
the appropriate status object

getReadType

protected final net.spy.memcached.protocol.ascii.OperationReadType getReadType()

setReadType

protected final void setReadType(net.spy.memcached.protocol.ascii.OperationReadType to)
Set the read type of this operation.


setArguments

protected final void setArguments(java.nio.ByteBuffer bb,
                                  java.lang.Object... args)
Set some arguments for an operation into the given byte buffer.


readFromBuffer

public void readFromBuffer(java.nio.ByteBuffer data)
                    throws java.io.IOException
Description copied from interface: Operation
Read data from the given byte buffer and dispatch to the appropriate read mechanism.

Specified by:
readFromBuffer in interface Operation
Specified by:
readFromBuffer in class BaseOperationImpl
Throws:
java.io.IOException


Copyright © 2006-2009 Dustin Sallings, 2009-2012 Couchbase, Inc.