public final class ReadWriteManyEntriesCommand<K,V,T,R> extends AbstractWriteManyCommand<K,V>
VisitableCommand.LoadType
Modifier and Type | Field and Description |
---|---|
static byte |
COMMAND_ID |
Constructor and Description |
---|
ReadWriteManyEntriesCommand() |
ReadWriteManyEntriesCommand(Map<?,?> arguments,
BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f,
Params params,
CommandInvocationId commandInvocationId,
DataConversion keyDataConversion,
DataConversion valueDataConversion) |
ReadWriteManyEntriesCommand(ReadWriteManyEntriesCommand command) |
Modifier and Type | Method and Description |
---|---|
Object |
acceptVisitor(InvocationContext ctx,
Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.
|
Collection<?> |
getAffectedKeys() |
Map<?,?> |
getArguments() |
BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> |
getBiFunction() |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Collection<?> |
getKeysToLock()
It returns a
Collection with the keys to be lock. |
void |
init(ComponentRegistry componentRegistry) |
boolean |
isConditional()
Certain commands only work based on a certain condition or state of the cache.
|
boolean |
isForwarded() |
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
boolean |
isSuccessful()
Some commands may want to provide information on whether the command was successful or not.
|
VisitableCommand.LoadType |
loadType() |
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
void |
setArguments(Map<?,?> arguments) |
void |
setForwarded(boolean forwarded) |
Mutation<K,V,?> |
toMutation(Object key) |
String |
toString() |
ReadWriteManyEntriesCommand<K,V,T,R> |
withArguments(Map<?,?> entries) |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
fail, getCommandInvocationId, getFlagsBitSet, getInternalMetadata, getKeyDataConversion, getKeyLockOwner, getParams, getTopologyId, getValueDataConversion, getValueMatcher, hasSkipLocking, hasZeroLockAcquisition, setFlagsBitSet, setInternalMetadata, setParams, setTopologyId, setValueMatcher
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isWriteOnly, updateStatusFromRemoteResponse
addFlag, addFlags, addFlags, getFlags, hasAllFlags, hasAnyFlag, hasFlag, setFlags
canBlock, invoke, invokeAsync, setOrigin
public static final byte COMMAND_ID
public ReadWriteManyEntriesCommand(Map<?,?> arguments, BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> f, Params params, CommandInvocationId commandInvocationId, DataConversion keyDataConversion, DataConversion valueDataConversion)
public ReadWriteManyEntriesCommand(ReadWriteManyEntriesCommand command)
public ReadWriteManyEntriesCommand()
public void init(ComponentRegistry componentRegistry)
init
in interface VisitableCommand
init
in class AbstractWriteManyCommand<K,V>
public BiFunction<T,EntryView.ReadWriteEntryView<K,V>,R> getBiFunction()
public Map<?,?> getArguments()
public void setArguments(Map<?,?> arguments)
public byte getCommandId()
ReplicableCommand
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.output
- the stream.IOException
- if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommand
ReplicableCommand.writeTo(ObjectOutput)
.input
- the stream to read.IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.public boolean isForwarded()
isForwarded
in class AbstractWriteManyCommand<K,V>
public void setForwarded(boolean forwarded)
setForwarded
in class AbstractWriteManyCommand<K,V>
public boolean isReturnValueExpected()
ReplicableCommand
ResponseGenerator
may choose to simply return null to save on marshalling
costs.public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic boolean isSuccessful()
WriteCommand
isSuccessful
in interface ReplicableCommand
isSuccessful
in interface WriteCommand
isSuccessful
in class AbstractWriteManyCommand<K,V>
public boolean isConditional()
WriteCommand
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.isConditional
in interface WriteCommand
isConditional
in class AbstractWriteManyCommand<K,V>
public Collection<?> getAffectedKeys()
public VisitableCommand.LoadType loadType()
public Collection<?> getKeysToLock()
RemoteLockCommand
Collection
with the keys to be lock.
It may return an empty collection if no keys needs to be locked independently of the return value of RemoteLockCommand.hasSkipLocking()
. It may contains duplicated keys and null
is not a valid return value.
Collection
of keys to lock.Copyright © 2021 JBoss by Red Hat. All rights reserved.