public class GetKeyValueCommand extends AbstractDataCommand implements RemoteFetchingCommand
Map.get(Object)
and
Map.containsKey(Object)
operationsModifier and Type | Field and Description |
---|---|
static byte |
COMMAND_ID |
key
flags
Constructor and Description |
---|
GetKeyValueCommand() |
GetKeyValueCommand(Object key,
Set<Flag> flags) |
Modifier and Type | Method and Description |
---|---|
Object |
acceptVisitor(InvocationContext ctx,
Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.
|
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
InternalCacheEntry |
getRemotelyFetchedValue()
If the cache needs to go remotely in order to obtain the value associated to this key, then the remote value
is stored in this field.
|
Object |
perform(InvocationContext ctx)
Performs the primary function of the command.
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
boolean |
readsExistingValues() |
void |
setRemotelyFetchedValue(InternalCacheEntry remotelyFetchedValue) |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
canBlock, equals, getKey, hashCode, ignoreCommandOnStatus, isReturnValueExpected, setKey, shouldInvoke
getMetadata, getTopologyId, setMetadata, setTopologyId
getFlags, setFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
alwaysReadsExistingValues
getTopologyId, setTopologyId
getParameters, setParameters
public static final byte COMMAND_ID
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
acceptVisitor
in interface VisitableCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic boolean readsExistingValues()
readsExistingValues
in interface VisitableCommand
true
if the command needs to read the previous values of the keys it acts on.public Object perform(InvocationContext ctx) throws Throwable
ReplicableCommand
perform
in interface ReplicableCommand
ctx
- invocation contextThrowable
- in the event of problems.public byte getCommandId()
ReplicableCommand
getCommandId
in interface ReplicableCommand
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.writeTo
in interface ReplicableCommand
output
- the stream.IOException
- if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommand
ReplicableCommand.writeTo(ObjectOutput)
.readFrom
in interface ReplicableCommand
input
- the stream to read.IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.public void setRemotelyFetchedValue(InternalCacheEntry remotelyFetchedValue)
setRemotelyFetchedValue
in interface RemoteFetchingCommand
getRemotelyFetchedValue()
public InternalCacheEntry getRemotelyFetchedValue()
getRemotelyFetchedValue
in interface RemoteFetchingCommand
public String toString()
toString
in class AbstractDataCommand
Copyright © 2021 JBoss, a division of Red Hat. All rights reserved.