public class RemoveExpiredCommand extends RemoveCommand
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_ID |
protected Long |
lifespan |
protected TimeService |
timeService |
notifier, value, valueEquivalence, valueMatcher
commandInvocationId
key
flags
Constructor and Description |
---|
RemoveExpiredCommand() |
RemoveExpiredCommand(Object key,
Object value,
Long lifespan,
CacheNotifier notifier,
Equivalence valueEquivalence,
TimeService timeService,
CommandInvocationId commandInvocationId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Set<Flag> |
getFlags() |
boolean |
hasFlag(Flag flag)
Check whether a particular flag is present in the command
|
int |
hashCode() |
boolean |
ignoreCommandOnStatus(ComponentStatus status)
Similar to
VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor . |
void |
init(CacheNotifier notifier,
Configuration configuration,
TimeService timeService) |
boolean |
isConditional()
Certain commands only work based on a certain condition or state of the cache.
|
void |
notify(InvocationContext ctx,
Object removedValue,
Metadata removedMetadata,
boolean isPre) |
Object |
perform(InvocationContext ctx)
Performs an expiration on a specified entry
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
acceptVisitor, getValue, getValueMatcher, init, isNonExistent, isReturnValueExpected, isSuccessful, performRemove, readsExistingValues, setValue, setValueMatcher, updateStatusFromRemoteResponse
canBlock, getAffectedKeys, getKeyLockOwner, getKeysToLock, hasSkipLocking, hasZeroLockAcquisition
getKey, setKey, shouldInvoke
getMetadata, getTopologyId, setMetadata, setTopologyId
setFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isWriteOnly
alwaysReadsExistingValues, shouldInvoke
getTopologyId, setTopologyId
getParameters, setParameters
getMetadata, setMetadata
addFlag, addFlags, setFlags, setFlags
getKey
public static final int COMMAND_ID
protected Long lifespan
protected TimeService timeService
public RemoveExpiredCommand()
public RemoveExpiredCommand(Object key, Object value, Long lifespan, CacheNotifier notifier, Equivalence valueEquivalence, TimeService timeService, CommandInvocationId commandInvocationId)
public void init(CacheNotifier notifier, Configuration configuration, TimeService timeService)
public Object perform(InvocationContext ctx) throws Throwable
perform
in interface ReplicableCommand
perform
in class RemoveCommand
ctx
- invocation contextThrowable
- in the event of problems.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 RemoveCommand
public void notify(InvocationContext ctx, Object removedValue, Metadata removedMetadata, boolean isPre)
notify
in class RemoveCommand
public byte getCommandId()
ReplicableCommand
getCommandId
in interface ReplicableCommand
getCommandId
in class RemoveCommand
public String toString()
toString
in class RemoveCommand
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.writeTo
in interface ReplicableCommand
writeTo
in class RemoveCommand
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
readFrom
in class RemoveCommand
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 ignoreCommandOnStatus(ComponentStatus status)
VisitableCommand
VisitableCommand.shouldInvoke(InvocationContext)
but evaluated by InvocationContextInterceptor
.
Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand
)ignoreCommandOnStatus
in interface VisitableCommand
ignoreCommandOnStatus
in class RemoveCommand
public boolean equals(Object o)
equals
in class RemoveCommand
public int hashCode()
hashCode
in class RemoveCommand
public Set<Flag> getFlags()
getFlags
in interface LocalFlagAffectedCommand
getFlags
in class AbstractLocalFlagAffectedCommand
LocalFlagAffectedCommand.setFlags(java.util.Set)
. The set should
not be modified directly, only via the LocalFlagAffectedCommand.setFlags(Set)
, LocalFlagAffectedCommand.addFlag(Flag)
and LocalFlagAffectedCommand.addFlags(Set)
methods.public boolean hasFlag(Flag flag)
LocalFlagAffectedCommand
flag
- to lookup in the commandCopyright © 2017 JBoss, a division of Red Hat. All rights reserved.