Class AbstractWriteKeyCommand<K,V>
- java.lang.Object
-
- org.infinispan.commands.read.AbstractDataCommand
-
- org.infinispan.commands.write.AbstractDataWriteCommand
-
- org.infinispan.commands.functional.AbstractWriteKeyCommand<K,V>
-
- All Implemented Interfaces:
DataCommand
,FlagAffectedCommand
,FunctionalCommand<K,V>
,ReplicableCommand
,SegmentSpecificCommand
,TopologyAffectedCommand
,VisitableCommand
,DataWriteCommand
,WriteCommand
,RemoteLockCommand
- Direct Known Subclasses:
ReadWriteKeyCommand
,ReadWriteKeyValueCommand
,WriteOnlyKeyCommand
,WriteOnlyKeyValueCommand
public abstract class AbstractWriteKeyCommand<K,V> extends AbstractDataWriteCommand implements FunctionalCommand<K,V>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Field Summary
-
Fields inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
commandInvocationId
-
Fields inherited from class org.infinispan.commands.read.AbstractDataCommand
key, segment
-
-
Constructor Summary
Constructors Constructor Description AbstractWriteKeyCommand()
AbstractWriteKeyCommand(Object key, ValueMatcher valueMatcher, int segment, CommandInvocationId id, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
fail()
Make subsequent invocations ofWriteCommand.isSuccessful()
returnfalse
.DataConversion
getKeyDataConversion()
Params
getParams()
DataConversion
getValueDataConversion()
ValueMatcher
getValueMatcher()
abstract void
init(ComponentRegistry componentRegistry)
boolean
isSuccessful()
Some commands may want to provide information on whether the command was successful or not.void
setValueMatcher(ValueMatcher valueMatcher)
String
toString()
-
Methods inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
canBlock, getAffectedKeys, getCommandInvocationId, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisition, isReturnValueExpected
-
Methods inherited from class org.infinispan.commands.read.AbstractDataCommand
equals, getFlagsBitSet, getKey, getSegment, getTopologyId, hashCode, printFlags, setFlagsBitSet, setKey, setTopologyId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.DataCommand
getKey
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, getFlagsBitSet, hasAnyFlag, hasFlag, setFlags, setFlagsBitSet
-
Methods inherited from interface org.infinispan.commands.functional.FunctionalCommand
toMutation
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
getCommandId, invoke, invokeAsync, readFrom, setOrigin, writeTo
-
Methods inherited from interface org.infinispan.commands.SegmentSpecificCommand
getSegment
-
Methods inherited from interface org.infinispan.commands.TopologyAffectedCommand
getTopologyId, setTopologyId
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, ignoreCommandOnStatus, loadType, perform, shouldInvoke
-
Methods inherited from interface org.infinispan.commands.write.WriteCommand
isConditional, isWriteOnly, updateStatusFromRemoteResponse
-
-
-
-
Constructor Detail
-
AbstractWriteKeyCommand
public AbstractWriteKeyCommand(Object key, ValueMatcher valueMatcher, int segment, CommandInvocationId id, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
-
AbstractWriteKeyCommand
public AbstractWriteKeyCommand()
-
-
Method Detail
-
getValueMatcher
public ValueMatcher getValueMatcher()
- Specified by:
getValueMatcher
in interfaceWriteCommand
- Returns:
- The current value matching policy.
-
setValueMatcher
public void setValueMatcher(ValueMatcher valueMatcher)
- Specified by:
setValueMatcher
in interfaceWriteCommand
- Parameters:
valueMatcher
- The new value matching policy.
-
isSuccessful
public boolean isSuccessful()
Description copied from interface:WriteCommand
Some commands may want to provide information on whether the command was successful or not. This is different from a failure, which usually would result in an exception being thrown. An example is a putIfAbsent() not doing anything because the key in question was present. This would result in a isSuccessful() call returning false.- Specified by:
isSuccessful
in interfaceReplicableCommand
- Specified by:
isSuccessful
in interfaceWriteCommand
- Returns:
- true if the command completed successfully, false otherwise.
-
getParams
public Params getParams()
- Specified by:
getParams
in interfaceFunctionalCommand<K,V>
-
fail
public void fail()
Description copied from interface:WriteCommand
Make subsequent invocations ofWriteCommand.isSuccessful()
returnfalse
.- Specified by:
fail
in interfaceWriteCommand
-
toString
public String toString()
- Overrides:
toString
in classAbstractDataCommand
-
getKeyDataConversion
public DataConversion getKeyDataConversion()
- Specified by:
getKeyDataConversion
in interfaceFunctionalCommand<K,V>
-
getValueDataConversion
public DataConversion getValueDataConversion()
- Specified by:
getValueDataConversion
in interfaceFunctionalCommand<K,V>
-
init
public abstract void init(ComponentRegistry componentRegistry)
-
-