Package org.shoal.ha.cache.impl.command
Class Command<K,V>
- java.lang.Object
-
- org.shoal.ha.cache.impl.command.Command<K,V>
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
AcknowledgedCommand,LoadRequestCommand,LoadResponseCommand,NoOpCommand,RemoveExpiredCommand,RemoveExpiredResultCommand,ReplicationFramePayloadCommand,SimpleAckCommand,SizeRequestCommand,SizeResponseCommand,StaleCopyRemoveCommand
public abstract class Command<K,V> extends java.lang.Object implements java.io.Serializable- Author:
- Mahesh Kannan
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DataStoreContext<K,V>dscprotected java.lang.StringtargetInstanceName
-
Constructor Summary
Constructors Modifier Constructor Description protectedCommand(byte opcode)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanbeforeTransmit()protected static byte[]captureState(java.lang.Object obj)abstract voidexecute(java.lang.String initiator)protected CommandManager<K,V>getCommandManager()protected DataStoreContext<K,V>getDataStoreContext()KgetKey()java.lang.StringgetKeyMappingInfo()java.lang.StringgetName()bytegetOpcode()java.lang.StringgetTargetName()voidinitialize(DataStoreContext<K,V> rs)protected booleanisArtificialKey()voidonFailure()voidonSuccess()voidprepareTransmit(DataStoreContext<K,V> ctx)protected voidsetKey(K k)protected voidsetTargetName(java.lang.String val)java.lang.StringtoString()
-
-
-
Field Detail
-
dsc
protected transient DataStoreContext<K,V> dsc
-
targetInstanceName
protected transient java.lang.String targetInstanceName
-
-
Method Detail
-
initialize
public final void initialize(DataStoreContext<K,V> rs)
-
setKey
protected final void setKey(K k)
-
getKey
public final K getKey()
-
getDataStoreContext
protected final DataStoreContext<K,V> getDataStoreContext()
-
getCommandManager
protected final CommandManager<K,V> getCommandManager()
-
getTargetName
public java.lang.String getTargetName()
-
getOpcode
public final byte getOpcode()
-
setTargetName
protected void setTargetName(java.lang.String val)
-
prepareTransmit
public void prepareTransmit(DataStoreContext<K,V> ctx) throws java.io.IOException
- Throws:
java.io.IOException
-
captureState
protected static byte[] captureState(java.lang.Object obj) throws DataStoreException- Throws:
DataStoreException
-
getKeyMappingInfo
public java.lang.String getKeyMappingInfo()
-
getName
public final java.lang.String getName()
-
execute
public abstract void execute(java.lang.String initiator) throws DataStoreException- Throws:
DataStoreException
-
onSuccess
public void onSuccess()
-
onFailure
public void onFailure()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isArtificialKey
protected boolean isArtificialKey()
-
beforeTransmit
protected abstract boolean beforeTransmit() throws java.io.IOException- Throws:
java.io.IOException
-
-