Package org.infinispan.commands.write
Class RemoveExpiredCommand
- java.lang.Object
-
- org.infinispan.commands.read.AbstractDataCommand
-
- org.infinispan.commands.write.AbstractDataWriteCommand
-
- org.infinispan.commands.write.RemoveCommand
-
- org.infinispan.commands.write.RemoveExpiredCommand
-
- All Implemented Interfaces:
DataCommand
,FlagAffectedCommand
,MetadataAwareCommand
,ReplicableCommand
,SegmentSpecificCommand
,TopologyAffectedCommand
,VisitableCommand
,DataWriteCommand
,WriteCommand
,RemoteLockCommand
public class RemoveExpiredCommand extends RemoveCommand
Removes an entry that is expired from memory- Since:
- 8.0
- Author:
- William Burns
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Field Summary
Fields Modifier and Type Field Description static int
COMMAND_ID
-
Fields inherited from class org.infinispan.commands.write.RemoveCommand
metadata, notifier, successful, value, valueMatcher
-
Fields inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
commandInvocationId
-
Fields inherited from class org.infinispan.commands.read.AbstractDataCommand
key, segment
-
-
Constructor Summary
Constructors Constructor Description RemoveExpiredCommand()
RemoveExpiredCommand(Object key, Object value, Long lifespan, boolean maxIdle, CacheNotifier notifier, int segment, CommandInvocationId commandInvocationId, IncrementableEntryVersion nonExistentVersion)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
acceptVisitor(InvocationContext ctx, Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.boolean
equals(Object o)
byte
getCommandId()
Used by marshallers to convert this command into an id for streaming.long
getFlagsBitSet()
int
hashCode()
void
init(CacheNotifier notifier, IncrementableEntryVersion nonExistentVersion)
boolean
isConditional()
Certain commands only work based on a certain condition or state of the cache.boolean
isMaxIdle()
Whether this remove expired was fired because of max idlevoid
notify(InvocationContext ctx, Object removedValue, Metadata removedMetadata, boolean isPre)
Object
perform(InvocationContext ctx)
Performs an expiration on a specified entryvoid
readFrom(ObjectInput input)
Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput)
.String
toString()
void
writeTo(ObjectOutput output)
Writes this instance to theObjectOutput
.-
Methods inherited from class org.infinispan.commands.write.RemoveCommand
fail, getMetadata, getValue, getValueMatcher, init, isNonExistent, isReturnValueExpected, isSuccessful, loadType, performRemove, setMetadata, setValue, setValueMatcher
-
Methods inherited from class org.infinispan.commands.write.AbstractDataWriteCommand
canBlock, getAffectedKeys, getCommandInvocationId, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisition
-
Methods inherited from class org.infinispan.commands.read.AbstractDataCommand
getKey, getSegment, getTopologyId, printFlags, setFlagsBitSet, setKey, setTopologyId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.DataCommand
getKey
-
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
addFlag, addFlags, addFlags, getFlags, hasAnyFlag, hasFlag, setFlags, setFlagsBitSet
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
invoke, invokeAsync, setOrigin
-
Methods inherited from interface org.infinispan.commands.SegmentSpecificCommand
getSegment
-
Methods inherited from interface org.infinispan.commands.TopologyAffectedCommand
getTopologyId, setTopologyId
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
ignoreCommandOnStatus, shouldInvoke
-
Methods inherited from interface org.infinispan.commands.write.WriteCommand
isWriteOnly, updateStatusFromRemoteResponse
-
-
-
-
Field Detail
-
COMMAND_ID
public static final int COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RemoveExpiredCommand
public RemoveExpiredCommand()
-
RemoveExpiredCommand
public RemoveExpiredCommand(Object key, Object value, Long lifespan, boolean maxIdle, CacheNotifier notifier, int segment, CommandInvocationId commandInvocationId, IncrementableEntryVersion nonExistentVersion)
-
-
Method Detail
-
acceptVisitor
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
Description copied from interface:VisitableCommand
Accept a visitor, and return the result of accepting this visitor.- Specified by:
acceptVisitor
in interfaceVisitableCommand
- Overrides:
acceptVisitor
in classRemoveCommand
- Parameters:
ctx
- invocation contextvisitor
- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable
- in the event of problems
-
perform
public Object perform(InvocationContext ctx) throws Throwable
Performs an expiration on a specified entry- Specified by:
perform
in interfaceReplicableCommand
- Specified by:
perform
in interfaceVisitableCommand
- Overrides:
perform
in classRemoveCommand
- Parameters:
ctx
- invocation context- Returns:
- null
- Throws:
Throwable
- in the event of problems.
-
isConditional
public boolean isConditional()
Description copied from interface:WriteCommand
Certain 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:
isConditional
in interfaceWriteCommand
- Overrides:
isConditional
in classRemoveCommand
- Returns:
- true if the command is conditional, false otherwise
-
notify
public void notify(InvocationContext ctx, Object removedValue, Metadata removedMetadata, boolean isPre)
- Overrides:
notify
in classRemoveCommand
-
getCommandId
public byte getCommandId()
Description copied from interface:ReplicableCommand
Used by marshallers to convert this command into an id for streaming.- Specified by:
getCommandId
in interfaceReplicableCommand
- Overrides:
getCommandId
in classRemoveCommand
- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
-
toString
public String toString()
- Overrides:
toString
in classRemoveCommand
-
writeTo
public void writeTo(ObjectOutput output) throws IOException
Description copied from interface:ReplicableCommand
Writes this instance to theObjectOutput
.- Specified by:
writeTo
in interfaceReplicableCommand
- Overrides:
writeTo
in classRemoveCommand
- Parameters:
output
- the stream.- Throws:
IOException
- if an error occurred during the I/O.
-
readFrom
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
Description copied from interface:ReplicableCommand
Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput)
.- Specified by:
readFrom
in interfaceReplicableCommand
- Overrides:
readFrom
in classRemoveCommand
- Parameters:
input
- the stream to read.- Throws:
IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classRemoveCommand
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classRemoveCommand
-
getFlagsBitSet
public long getFlagsBitSet()
- Specified by:
getFlagsBitSet
in interfaceFlagAffectedCommand
- Overrides:
getFlagsBitSet
in classAbstractDataCommand
- Returns:
- The command flags. Flags can be modified with
FlagAffectedCommand.setFlagsBitSet(long)
,FlagAffectedCommand.addFlags(long)
andFlagAffectedCommand.addFlags(Set)
methods.
-
isMaxIdle
public boolean isMaxIdle()
Whether this remove expired was fired because of max idle- Returns:
- if this command is max idle based expiration
-
init
public void init(CacheNotifier notifier, IncrementableEntryVersion nonExistentVersion)
-
-