Package net.spy.memcached.protocol.ascii
Class OperationImpl
java.lang.Object
net.spy.memcached.compat.SpyObject
net.spy.memcached.protocol.BaseOperationImpl
net.spy.memcached.protocol.ascii.OperationImpl
- All Implemented Interfaces:
Operation
- Direct Known Subclasses:
BaseGetOpImpl
,BaseStoreOperationImpl
,CASOperationImpl
,DeleteOperationImpl
,FlushOperationImpl
,MutatorOperationImpl
,StatsOperationImpl
,TouchOperationImpl
,UnlockOperationImpl
,VersionOperationImpl
Operations on a memcached connection.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteArrayOutputStream
private static final String
protected static final byte[]
private byte[]
private boolean
private OperationReadType
Fields inherited from class net.spy.memcached.protocol.BaseOperationImpl
callback, CANCELLED, notMyVbucketNodes, TIMED_OUT
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
-
Method Summary
Modifier and TypeMethodDescription(package private) OperationErrorType
classifyError
(String line) byte[]
Returns the raw bytes of the error message content.protected final OperationReadType
abstract void
handleLine
(String line) protected final OperationStatus
matchStatus
(String line, OperationStatus... statii) Match the status line provided against one of the given OperationStatus objects.void
readFromBuffer
(ByteBuffer data) Read data from the given byte buffer and dispatch to the appropriate read mechanism.protected final void
setArguments
(ByteBuffer bb, Object... args) Set some arguments for an operation into the given byte buffer.protected final void
Set the read type of this operation.Methods inherited from class net.spy.memcached.protocol.BaseOperationImpl
addClone, cancel, getBuffer, getCallback, getCloneCount, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleError, handleRead, hasErrored, initialize, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setBuffer, setCallback, setCloneCount, setHandlingNode, timeOut, transitionState, wasCancelled, writeComplete, writing
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.spy.memcached.ops.Operation
addClone, cancel, getBuffer, getCallback, getCloneCount, getException, getHandlingNode, getState, getWriteCompleteTimestamp, handleRead, hasErrored, initialize, isCancelled, isTimedOut, isTimedOut, isTimedOutUnsent, setCloneCount, setHandlingNode, timeOut, writeComplete, writing
-
Field Details
-
CRLF
protected static final byte[] CRLF -
CHARSET
- See Also:
-
byteBuffer
-
readType
-
foundCr
private boolean foundCr -
errorMsg
private byte[] errorMsg
-
-
Constructor Details
-
OperationImpl
protected OperationImpl() -
OperationImpl
-
-
Method Details
-
matchStatus
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 linestatii
- several status objects- Returns:
- the appropriate status object
-
getReadType
-
setReadType
Set the read type of this operation. -
setArguments
Set some arguments for an operation into the given byte buffer. -
classifyError
-
readFromBuffer
Description copied from interface:Operation
Read data from the given byte buffer and dispatch to the appropriate read mechanism.- Specified by:
readFromBuffer
in interfaceOperation
- Specified by:
readFromBuffer
in classBaseOperationImpl
- Throws:
IOException
-
handleLine
-
getErrorMsg
public byte[] getErrorMsg()Description copied from interface:Operation
Returns the raw bytes of the error message content.- Specified by:
getErrorMsg
in interfaceOperation
- Returns:
- the raw error message content.
-