Class AbstractWriteManyCommand<K,V>
- java.lang.Object
-
- org.infinispan.commands.functional.AbstractWriteManyCommand<K,V>
-
- All Implemented Interfaces:
FlagAffectedCommand,FunctionalCommand<K,V>,ReplicableCommand,TopologyAffectedCommand,VisitableCommand,WriteCommand,RemoteLockCommand
- Direct Known Subclasses:
ReadWriteManyCommand,ReadWriteManyEntriesCommand,WriteOnlyManyCommand,WriteOnlyManyEntriesCommand
public abstract class AbstractWriteManyCommand<K,V> extends Object implements WriteCommand, FunctionalCommand<K,V>, RemoteLockCommand
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractWriteManyCommand()protectedAbstractWriteManyCommand(CommandInvocationId commandInvocationId, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)protectedAbstractWriteManyCommand(AbstractWriteManyCommand<K,V> command)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfail()Make subsequent invocations ofWriteCommand.isSuccessful()returnfalse.CommandInvocationIdgetCommandInvocationId()longgetFlagsBitSet()PrivateMetadatagetInternalMetadata(Object key)DataConversiongetKeyDataConversion()ObjectgetKeyLockOwner()It returns the lock owner of the key.ParamsgetParams()intgetTopologyId()DataConversiongetValueDataConversion()ValueMatchergetValueMatcher()booleanhasSkipLocking()It checks if this command should acquire locks.booleanhasZeroLockAcquisition()voidinit(ComponentRegistry componentRegistry)booleanisConditional()Certain commands only work based on a certain condition or state of the cache.booleanisForwarded()booleanisSuccessful()Some commands may want to provide information on whether the command was successful or not.voidsetFlagsBitSet(long bitSet)Set the flags, replacing any existing flags.voidsetForwarded(boolean forwarded)voidsetInternalMetadata(Object key, PrivateMetadata internalMetadata)voidsetParams(Params params)voidsetTopologyId(int topologyId)voidsetValueMatcher(ValueMatcher valueMatcher)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, hasAllFlags, hasAnyFlag, hasFlag, setFlags
-
Methods inherited from interface org.infinispan.commands.functional.FunctionalCommand
toMutation
-
Methods inherited from interface org.infinispan.util.concurrent.locks.RemoteLockCommand
getKeysToLock
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, getCommandId, invoke, invokeAsync, isReturnValueExpected, readFrom, setOrigin, writeTo
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, loadType
-
Methods inherited from interface org.infinispan.commands.write.WriteCommand
getAffectedKeys, isWriteOnly, updateStatusFromRemoteResponse
-
-
-
-
Constructor Detail
-
AbstractWriteManyCommand
protected AbstractWriteManyCommand(CommandInvocationId commandInvocationId, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
-
AbstractWriteManyCommand
protected AbstractWriteManyCommand(AbstractWriteManyCommand<K,V> command)
-
AbstractWriteManyCommand
protected AbstractWriteManyCommand()
-
-
Method Detail
-
init
public void init(ComponentRegistry componentRegistry)
- Specified by:
initin interfaceVisitableCommand
-
getTopologyId
public int getTopologyId()
- Specified by:
getTopologyIdin interfaceTopologyAffectedCommand
-
setTopologyId
public void setTopologyId(int topologyId)
- Specified by:
setTopologyIdin interfaceTopologyAffectedCommand
-
isForwarded
public boolean isForwarded()
-
setForwarded
public void setForwarded(boolean forwarded)
-
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.
-
isConditional
public boolean isConditional()
Description copied from interface:WriteCommandCertain commands only work based on a certain condition or state of the cache. For example,ConcurrentMap.putIfAbsent(Object, Object)only does anything if a condition is met, i.e., the entry in question is not already present. This method tests whether the command in question is conditional or not.- Specified by:
isConditionalin interfaceWriteCommand- Returns:
- true if the command is conditional, false otherwise
-
fail
public void fail()
Description copied from interface:WriteCommandMake subsequent invocations ofWriteCommand.isSuccessful()returnfalse.- Specified by:
failin interfaceWriteCommand
-
getFlagsBitSet
public long getFlagsBitSet()
- Specified by:
getFlagsBitSetin interfaceFlagAffectedCommand- Returns:
- The command flags. Flags can be modified with
FlagAffectedCommand.setFlagsBitSet(long),FlagAffectedCommand.addFlags(long)andFlagAffectedCommand.addFlags(Set)methods.
-
setFlagsBitSet
public void setFlagsBitSet(long bitSet)
Description copied from interface:FlagAffectedCommandSet the flags, replacing any existing flags.- Specified by:
setFlagsBitSetin interfaceFlagAffectedCommand
-
getParams
public Params getParams()
- Specified by:
getParamsin interfaceFunctionalCommand<K,V>
-
setParams
public void setParams(Params params)
-
getKeyLockOwner
public Object getKeyLockOwner()
Description copied from interface:RemoteLockCommandIt returns the lock owner of the key.Usually, in transaction caches it is the
GlobalTransactionand in non-transactional caches theCommandInvocationId.- Specified by:
getKeyLockOwnerin interfaceRemoteLockCommand- Returns:
- the lock owner of the key.
-
getCommandInvocationId
public CommandInvocationId getCommandInvocationId()
- Specified by:
getCommandInvocationIdin interfaceWriteCommand- Returns:
- the
CommandInvocationIdassociated to the command.
-
hasZeroLockAcquisition
public boolean hasZeroLockAcquisition()
- Specified by:
hasZeroLockAcquisitionin interfaceRemoteLockCommand- Returns:
- it the locks should be acquire with 0 (zero) acquisition timeout.
-
hasSkipLocking
public boolean hasSkipLocking()
Description copied from interface:RemoteLockCommandIt checks if this command should acquire locks.- Specified by:
hasSkipLockingin interfaceRemoteLockCommand- Returns:
trueif locks should be acquired for the keys inRemoteLockCommand.getKeysToLock().
-
getKeyDataConversion
public DataConversion getKeyDataConversion()
- Specified by:
getKeyDataConversionin interfaceFunctionalCommand<K,V>
-
getValueDataConversion
public DataConversion getValueDataConversion()
- Specified by:
getValueDataConversionin interfaceFunctionalCommand<K,V>
-
getInternalMetadata
public PrivateMetadata getInternalMetadata(Object key)
- Specified by:
getInternalMetadatain interfaceWriteCommand
-
setInternalMetadata
public void setInternalMetadata(Object key, PrivateMetadata internalMetadata)
- Specified by:
setInternalMetadatain interfaceWriteCommand
-
-