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>, CacheRpcCommand, ReplicableCommand, SegmentSpecificCommand, TopologyAffectedCommand, TracedCommand, VisitableCommand, DataWriteCommand, WriteCommand, VersionAware, 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 VisitableCommand
VisitableCommand.LoadType -
Field Summary
Fields inherited from class AbstractDataWriteCommand
commandInvocationIdFields inherited from class AbstractDataCommand
cacheName, key, origin, segment, spanAttributes, topologyIdFields inherited from interface VisitableCommand
log -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWriteKeyCommand(ByteString cacheName, Object key, ValueMatcher valueMatcher, int segment, CommandInvocationId id, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion) protectedAbstractWriteKeyCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flags, int topologyId, int segment, CommandInvocationId commandInvocationId, Params params, ValueMatcher valueMatcher, DataConversion keyDataConversion, DataConversion valueDataConversion, PrivateMetadata internalMetadata) -
Method Summary
Modifier and TypeMethodDescriptionvoidfail()Make subsequent invocations ofWriteCommand.isSuccessful()returnfalse.voidinit(ComponentRegistry componentRegistry) booleanIf true, a return value will be marshalled as aSuccessfulResponse, otherwise it will be marshalled as aUnsuccessfulResponse.voidsetInternalMetadata(PrivateMetadata internalMetadata) voidsetValueMatcher(ValueMatcher valueMatcher) toString()Methods inherited from class AbstractDataWriteCommand
getAffectedKeys, getCommandInvocationId, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisition, isReturnValueExpectedMethods inherited from class AbstractDataCommand
equals, getCacheName, getFlagsBitSet, getFlagsWithoutRemote, getKey, getOrigin, getSegment, getSpanAttributes, getTopologyId, getWrappedKey, hashCode, printFlags, setFlagsBitSet, setKey, setOrigin, setSpanAttributes, setTopologyIdMethods inherited from interface CacheRpcCommand
getCacheName, getOrigin, setOriginMethods inherited from interface DataCommand
getKeyMethods inherited from interface DataWriteCommand
getInternalMetadata, setInternalMetadataMethods inherited from interface FlagAffectedCommand
addFlags, getFlags, getFlagsBitSet, hasAllFlags, hasAnyFlag, setFlagsBitSetMethods inherited from interface FunctionalCommand
toMutationMethods inherited from interface ReplicableCommand
getCommandId, logThrowable, readFrom, supportedSince, writeToMethods inherited from interface SegmentSpecificCommand
getSegmentMethods inherited from interface TopologyAffectedCommand
getTopologyId, setTopologyIdMethods inherited from interface TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface VisitableCommand
acceptVisitor, invokeAsync, loadTypeMethods inherited from interface WriteCommand
isConditional, isWriteOnly, shouldReplicate
-
Constructor Details
-
AbstractWriteKeyCommand
protected AbstractWriteKeyCommand(ByteString cacheName, MarshallableObject<?> wrappedKey, long flags, int topologyId, int segment, CommandInvocationId commandInvocationId, Params params, ValueMatcher valueMatcher, DataConversion keyDataConversion, DataConversion valueDataConversion, PrivateMetadata internalMetadata) -
AbstractWriteKeyCommand
protected AbstractWriteKeyCommand(ByteString cacheName, Object key, ValueMatcher valueMatcher, int segment, CommandInvocationId id, Params params, DataConversion keyDataConversion, DataConversion valueDataConversion)
-
-
Method Details
-
init
- Specified by:
initin interfaceVisitableCommand
-
getParams
- Specified by:
getParamsin interfaceFunctionalCommand<K,V>
-
getValueMatcher
- Specified by:
getValueMatcherin interfaceWriteCommand- Returns:
- The current value matching policy.
-
getKeyDataConversion
- Specified by:
getKeyDataConversionin interfaceFunctionalCommand<K,V>
-
getValueDataConversion
- Specified by:
getValueDataConversionin interfaceFunctionalCommand<K,V>
-
getInternalMetadata
- Specified by:
getInternalMetadatain interfaceDataWriteCommand
-
setInternalMetadata
- Specified by:
setInternalMetadatain interfaceDataWriteCommand
-
setValueMatcher
- Specified by:
setValueMatcherin interfaceWriteCommand- Parameters:
valueMatcher- The new value matching policy.
-
isSuccessful
public boolean isSuccessful()Description copied from interface:ReplicableCommandIf true, a return value will be marshalled as aSuccessfulResponse, otherwise it will be marshalled as aUnsuccessfulResponse.- Specified by:
isSuccessfulin interfaceReplicableCommand- Specified by:
isSuccessfulin interfaceWriteCommand- Returns:
- true if the command completed successfully, false otherwise.
-
fail
public void fail()Description copied from interface:WriteCommandMake subsequent invocations ofWriteCommand.isSuccessful()returnfalse.- Specified by:
failin interfaceWriteCommand
-
toString
- Overrides:
toStringin classAbstractDataCommand
-