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 Concrete Methods Modifier and Type Method Description voidfail()Make subsequent invocations ofWriteCommand.isSuccessful()returnfalse.PrivateMetadatagetInternalMetadata()DataConversiongetKeyDataConversion()ParamsgetParams()DataConversiongetValueDataConversion()ValueMatchergetValueMatcher()voidinit(ComponentRegistry componentRegistry)booleanisSuccessful()Some commands may want to provide information on whether the command was successful or not.voidsetInternalMetadata(PrivateMetadata internalMetadata)voidsetValueMatcher(ValueMatcher valueMatcher)StringtoString()-
Methods inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
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.write.DataWriteCommand
getInternalMetadata, setInternalMetadata
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, hasFlag, setFlags, setFlagsBitSet
-
Methods inherited from interface org.infinispan.commands.functional.FunctionalCommand
toMutation
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, 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, loadType
-
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
-
init
public void init(ComponentRegistry componentRegistry)
- Specified by:
initin interfaceVisitableCommand
-
getValueMatcher
public ValueMatcher getValueMatcher()
- Specified by:
getValueMatcherin interfaceWriteCommand- Returns:
- The current value matching policy.
-
setValueMatcher
public void setValueMatcher(ValueMatcher valueMatcher)
- Specified by:
setValueMatcherin interfaceWriteCommand- Parameters:
valueMatcher- The new value matching policy.
-
isSuccessful
public boolean isSuccessful()
Description copied from interface:WriteCommandSome 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:
isSuccessfulin interfaceReplicableCommand- Specified by:
isSuccessfulin interfaceWriteCommand- Returns:
- true if the command completed successfully, false otherwise.
-
getParams
public Params getParams()
- Specified by:
getParamsin interfaceFunctionalCommand<K,V>
-
fail
public void fail()
Description copied from interface:WriteCommandMake subsequent invocations ofWriteCommand.isSuccessful()returnfalse.- Specified by:
failin interfaceWriteCommand
-
toString
public String toString()
- Overrides:
toStringin classAbstractDataCommand
-
getKeyDataConversion
public DataConversion getKeyDataConversion()
- Specified by:
getKeyDataConversionin interfaceFunctionalCommand<K,V>
-
getValueDataConversion
public DataConversion getValueDataConversion()
- Specified by:
getValueDataConversionin interfaceFunctionalCommand<K,V>
-
getInternalMetadata
public PrivateMetadata getInternalMetadata()
- Specified by:
getInternalMetadatain interfaceDataWriteCommand
-
setInternalMetadata
public void setInternalMetadata(PrivateMetadata internalMetadata)
- Specified by:
setInternalMetadatain interfaceDataWriteCommand
-
-