org.infinispan.commands.write
Interface WriteCommand

All Superinterfaces:
FlagAffectedCommand, ReplicableCommand, VisitableCommand
All Known Subinterfaces:
DataWriteCommand
All Known Implementing Classes:
AbstractDataWriteCommand, ClearCommand, EvictCommand, InvalidateCommand, InvalidateL1Command, PutKeyValueCommand, PutMapCommand, RemoveCommand, ReplaceCommand

public interface WriteCommand
extends VisitableCommand, FlagAffectedCommand

A command that modifies the cache in some way

Since:
4.0
Author:
Manik Surtani

Method Summary
 Set<Object> getAffectedKeys()
           
 boolean isConditional()
          Certain commands only work based on a certain condition or state of the cache.
 boolean isSuccessful()
          Some commands may want to provide information on whether the command was successful or not.
 
Methods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor, ignoreCommandOnStatus, shouldInvoke
 
Methods inherited from interface org.infinispan.commands.ReplicableCommand
getCommandId, getParameters, perform, setParameters
 
Methods inherited from interface org.infinispan.commands.FlagAffectedCommand
getFlags, setFlags
 

Method Detail

isSuccessful

boolean isSuccessful()
Some commands may want to provide information on whether the command was successful or not. This is different from a failure, which usually would result in an exception being thrown. An example is a putIfAbsent() not doing anything because the key in question was present. This would result in a isSuccessful() call returning false.

Returns:
true if the command completed successfully, false otherwise.

isConditional

boolean isConditional()
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.

Returns:
true if the command is conditional, false otherwise

getAffectedKeys

Set<Object> getAffectedKeys()
Returns:
a collection of keys affected by this write command. Some commands - such as ClearCommand - may return an empty collection for this method.

-->

Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.