Interface Command
-
- All Known Implementing Classes:
AbstractStoreCommand,StorePutCommand,StoreRemoveCommand
public interface Command- Author:
- Ludovic Orban
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.ObjectgetObjectKey()Get the key of the element this command is working onbooleanisPut(java.lang.Object key)Is this command represents adding a key to the storebooleanisRemove(java.lang.Object key)Is this command represents removing a key to the storebooleanprepare(Store store, SoftLockManager softLockManager, XidTransactionID transactionId, ElementValueComparator comparator)Prepare the commmand un the underlying storevoidrollback(Store store, SoftLockManager softLockManager)Rollback the prepared change
-
-
-
Method Detail
-
isPut
boolean isPut(java.lang.Object key)
Is this command represents adding a key to the store- Parameters:
key- the key- Returns:
- true, if this command would try to add an Element for key, otherwise false
-
isRemove
boolean isRemove(java.lang.Object key)
Is this command represents removing a key to the store- Parameters:
key- the key- Returns:
- true, if this command would try to remove an Element for key, otherwise false
-
prepare
boolean prepare(Store store, SoftLockManager softLockManager, XidTransactionID transactionId, ElementValueComparator comparator)
Prepare the commmand un the underlying store- Parameters:
store- the underdyling storesoftLockManager- the soft lock managertransactionId- the transaction IDcomparator- the element value comparator- Returns:
- true if prepare updated the store, false otherwise
-
rollback
void rollback(Store store, SoftLockManager softLockManager)
Rollback the prepared change- Parameters:
store- the underlying storesoftLockManager- the soft lock manager
-
getObjectKey
java.lang.Object getObjectKey()
Get the key of the element this command is working on- Returns:
- the element's key
-
-