Class AbstractDataCommand
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
- All Implemented Interfaces:
DataCommand, FlagAffectedCommand, CacheRpcCommand, ReplicableCommand, SegmentSpecificCommand, TopologyAffectedCommand, TracedCommand, VisitableCommand, VersionAware
- Direct Known Subclasses:
AbstractDataWriteCommand, GetCacheEntryCommand, GetKeyValueCommand, ReadOnlyKeyCommand, TouchCommand
public abstract class AbstractDataCommand
extends Object
implements DataCommand, SegmentSpecificCommand
- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Sanne Grinovero <sanne@hibernate.org> (C) 2011 Red Hat Inc.
-
Nested Class Summary
Nested classes/interfaces inherited from interface VisitableCommand
VisitableCommand.LoadType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ByteStringprotected Objectprotected Addressprotected intprotected InfinispanSpanAttributesprotected intFields inherited from interface VisitableCommand
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataCommand(ByteString cacheName, Object key, int segment, long flagsBitSet) protectedAbstractDataCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flagsWithoutRemote, int topologyId, int segment) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlonglonggetKey()Get the origin of the commandintReturns the segment that this key maps to.intinthashCode()booleanIf true, a return value will be provided when performed remotely.protected final StringvoidsetFlagsBitSet(long bitSet) Set the flags, replacing any existing flags.voidvoidSet the origin of the commandvoidsetSpanAttributes(InfinispanSpanAttributes attributes) voidsetTopologyId(int topologyId) toString()Methods inherited from interface FlagAffectedCommand
addFlags, getFlags, hasAllFlags, hasAnyFlagMethods inherited from interface ReplicableCommand
getCommandId, isSuccessful, logThrowable, readFrom, supportedSince, writeToMethods inherited from interface TracedCommand
getOperationNameMethods inherited from interface VisitableCommand
acceptVisitor, init, invokeAsync, loadType
-
Field Details
-
cacheName
-
origin
-
key
-
topologyId
protected int topologyId -
segment
protected int segment -
spanAttributes
-
-
Constructor Details
-
AbstractDataCommand
protected AbstractDataCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flagsWithoutRemote, int topologyId, int segment) -
AbstractDataCommand
-
-
Method Details
-
getCacheName
- Specified by:
getCacheNamein interfaceCacheRpcCommand- Returns:
- the name of the cache that produced this command. This will also be the name of the cache this command is intended for.
-
getWrappedKey
-
getSegment
@ProtoField(3) public int getSegment()Description copied from interface:SegmentSpecificCommandReturns the segment that this key maps to. This must always return a number 0 or larger.- Specified by:
getSegmentin interfaceSegmentSpecificCommand- Returns:
- the segment of the key
-
getTopologyId
@ProtoField(4) public int getTopologyId()- Specified by:
getTopologyIdin interfaceTopologyAffectedCommand
-
setTopologyId
public void setTopologyId(int topologyId) - Specified by:
setTopologyIdin interfaceTopologyAffectedCommand
-
getFlagsWithoutRemote
@ProtoField(number=5, name="flags") public long getFlagsWithoutRemote() -
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(long)methods.
-
setFlagsBitSet
public void setFlagsBitSet(long bitSet) Description copied from interface:FlagAffectedCommandSet the flags, replacing any existing flags.- Specified by:
setFlagsBitSetin interfaceFlagAffectedCommand
-
getOrigin
Description copied from interface:CacheRpcCommandGet the origin of the command- Specified by:
getOriginin interfaceCacheRpcCommand
-
setOrigin
Description copied from interface:CacheRpcCommandSet the origin of the command- Specified by:
setOriginin interfaceCacheRpcCommand- Specified by:
setOriginin interfaceReplicableCommand- Parameters:
origin- the sender'sAddress
-
getKey
- Specified by:
getKeyin interfaceDataCommand
-
setKey
-
equals
-
hashCode
-
toString
-
isReturnValueExpected
public boolean isReturnValueExpected()Description copied from interface:ReplicableCommandIf true, a return value will be provided when performed remotely. Otherwise, a remoteResponseGeneratormay choose to simply return null to save on marshalling costs.- Specified by:
isReturnValueExpectedin interfaceReplicableCommand- Returns:
- true or false
-
printFlags
-
setSpanAttributes
- Specified by:
setSpanAttributesin interfaceTracedCommand
-
getSpanAttributes
- Specified by:
getSpanAttributesin interfaceTracedCommand
-