|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommandsFactory
A factory to build commands, initializing and injecting dependencies accordingly. Commands built for a specific, named cache instance cannot be reused on a different cache instance since most commands contain the cache name it was built for along with references to other named-cache scoped components.
Method Summary | ||
---|---|---|
ApplyDeltaCommand |
buildApplyDeltaCommand(Object deltaAwareValueKey,
Delta delta,
Collection keys)
Builds a ApplyDeltaCommand used for applying Delta objects to DeltaAware containers stored in cache |
|
ClearCommand |
buildClearCommand(Set<Flag> flags)
Builds a ClearCommand |
|
ClusteredGetCommand |
buildClusteredGetCommand(Object key,
Set<Flag> flags,
boolean acquireRemoteLock,
GlobalTransaction gtx)
Builds a ClusteredGetCommand, which is a remote lookup command |
|
CommitCommand |
buildCommitCommand(GlobalTransaction gtx)
Builds a CommitCommand |
|
CompleteTransactionCommand |
buildCompleteTransactionCommand(Xid xid,
boolean commit)
Builds a CompleteTransactionCommand command. |
|
|
buildDistributedExecuteCommand(Callable<T> callable,
Address sender,
Collection keys)
Builds a DistributedExecuteCommand used for migration and execution of distributed Callables and Runnables. |
|
EntrySetCommand |
buildEntrySetCommand()
Builds a EntrySetCommand |
|
EvictCommand |
buildEvictCommand(Object key)
Builds an EvictCommand |
|
GetInDoubtTransactionsCommand |
buildGetInDoubtTransactionsCommand()
Builds a GetInDoubtTransactionsCommand . |
|
GetInDoubtTxInfoCommand |
buildGetInDoubtTxInfoCommand()
|
|
GetKeyValueCommand |
buildGetKeyValueCommand(Object key,
Set<Flag> flags)
Builds a GetKeyValueCommand |
|
InvalidateCommand |
buildInvalidateCommand(Object... keys)
Builds an InvalidateCommand |
|
InvalidateCommand |
buildInvalidateFromL1Command(Address origin,
boolean forRehash,
Collection<Object> keys)
|
|
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Collection<Object> keys)
Builds an InvalidateFromL1Command |
|
InvalidateCommand |
buildInvalidateFromL1Command(boolean forRehash,
Object... keys)
Builds an InvalidateFromL1Command |
|
KeySetCommand |
buildKeySetCommand()
Builds a KeySetCommand |
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags)
|
|
LockControlCommand |
buildLockControlCommand(Collection<Object> keys,
Set<Flag> flags,
GlobalTransaction gtx)
Builds a LockControlCommand to control explicit remote locking |
|
LockControlCommand |
buildLockControlCommand(Object key,
Set<Flag> flags,
GlobalTransaction gtx)
Same as buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys. |
|
MapReduceCommand |
buildMapReduceCommand(Mapper m,
Reducer r,
Address sender,
Collection keys)
Builds a MapReduceCommand used for migration and execution of MapReduce tasks. |
|
PrepareCommand |
buildPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhaseCommit)
Builds a PrepareCommand |
|
PutKeyValueCommand |
buildPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutKeyValueCommand |
|
PutMapCommand |
buildPutMapCommand(Map<?,?> map,
long lifespanMillis,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a PutMapCommand |
|
RemoveCommand |
buildRemoveCommand(Object key,
Object value,
Set<Flag> flags)
Builds a RemoveCommand |
|
ReplaceCommand |
buildReplaceCommand(Object key,
Object oldValue,
Object newValue,
long lifespanMillis,
long maxIdleTimeMillis,
Set<Flag> flags)
Builds a ReplaceCommand |
|
MultipleRpcCommand |
buildReplicateCommand(List<ReplicableCommand> toReplicate)
Builds an RpcCommand "envelope" containing multiple ReplicableCommands |
|
RollbackCommand |
buildRollbackCommand(GlobalTransaction gtx)
Builds a RollbackCommand |
|
SingleRpcCommand |
buildSingleRpcCommand(ReplicableCommand call)
Builds a SingleRpcCommand "envelope" containing a single ReplicableCommand |
|
SizeCommand |
buildSizeCommand()
Builds a SizeCommand |
|
StateTransferControlCommand |
buildStateTransferCommand(StateTransferControlCommand.Type subtype,
Address sender,
int viewId)
Builds a RehashControlCommand for coordinating a rehash event. |
|
StateTransferControlCommand |
buildStateTransferCommand(StateTransferControlCommand.Type subtype,
Address sender,
int viewId,
Collection<InternalCacheEntry> state,
Collection<LockInfo> lockInfo)
Builds a RehashControlCommand for coordinating a rehash event. |
|
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(long internalId)
|
|
TxCompletionNotificationCommand |
buildTxCompletionNotificationCommand(Xid xid,
GlobalTransaction globalTransaction)
Builds a TxCompletionNotificationCommand . |
|
ValuesCommand |
buildValuesCommand()
Builds a ValuesCommand |
|
VersionedCommitCommand |
buildVersionedCommitCommand(GlobalTransaction gtx)
Builds a VersionedCommitCommand |
|
VersionedPrepareCommand |
buildVersionedPrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
boolean onePhase)
Builds a VersionedPrepareCommand |
|
VersionedPutKeyValueCommand |
buildVersionedPutKeyValueCommand(Object key,
Object value,
long lifespanMillis,
long maxIdleTimeMillis,
EntryVersion version,
Set<Flag> flags)
Builds a special form of PutKeyValueCommand that also holds a reference to a version to be applied. |
|
String |
getCacheName()
Retrieves the cache name this CommandFactory is set up to construct commands for. |
|
void |
initializeReplicableCommand(ReplicableCommand command,
boolean isRemote)
Initializes a ReplicableCommand read from a data stream with components specific
to the target cache instance. |
Method Detail |
---|
PutKeyValueCommand buildPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags)
key
- key to putvalue
- value to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
VersionedPutKeyValueCommand buildVersionedPutKeyValueCommand(Object key, Object value, long lifespanMillis, long maxIdleTimeMillis, EntryVersion version, Set<Flag> flags)
PutKeyValueCommand
that also holds a reference to a version to be applied.
key
- key to putvalue
- value to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.version
- version to apply with this put
RemoveCommand buildRemoveCommand(Object key, Object value, Set<Flag> flags)
key
- key to removevalue
- value to check for ina conditional remove, or null for an unconditional remove.
InvalidateCommand buildInvalidateCommand(Object... keys)
keys
- keys to invalidate
InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Object... keys)
forRehash
- set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys
- keys to invalidate
InvalidateCommand buildInvalidateFromL1Command(boolean forRehash, Collection<Object> keys)
forRehash
- set to true if the invalidation is happening due to a new node taking ownership. False if it is due to a write, changing the state of the entry.keys
- keys to invalidate
InvalidateCommand buildInvalidateFromL1Command(Address origin, boolean forRehash, Collection<Object> keys)
buildInvalidateFromL1Command(org.infinispan.remoting.transport.Address, boolean, java.util.Collection)
ReplaceCommand buildReplaceCommand(Object key, Object oldValue, Object newValue, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags)
key
- key to replaceoldValue
- existing value to check for if conditional, null if unconditional.newValue
- value to replace withlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
SizeCommand buildSizeCommand()
GetKeyValueCommand buildGetKeyValueCommand(Object key, Set<Flag> flags)
key
- key to get
KeySetCommand buildKeySetCommand()
ValuesCommand buildValuesCommand()
EntrySetCommand buildEntrySetCommand()
PutMapCommand buildPutMapCommand(Map<?,?> map, long lifespanMillis, long maxIdleTimeMillis, Set<Flag> flags)
map
- map containing key/value entries to putlifespanMillis
- lifespan in milliseconds. -1 if lifespan is not used.maxIdleTimeMillis
- max idle time in milliseconds. -1 if maxIdle is not used.
ClearCommand buildClearCommand(Set<Flag> flags)
EvictCommand buildEvictCommand(Object key)
key
- key to evict
PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhaseCommit)
gtx
- global transaction associated with the preparemodifications
- list of modificationsonePhaseCommit
- is this a one-phase or two-phase transaction?
VersionedPrepareCommand buildVersionedPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, boolean onePhase)
gtx
- global transaction associated with the preparemodifications
- list of modificationsonePhase
-
CommitCommand buildCommitCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the commit
VersionedCommitCommand buildVersionedCommitCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the commit
RollbackCommand buildRollbackCommand(GlobalTransaction gtx)
gtx
- global transaction associated with the rollback
void initializeReplicableCommand(ReplicableCommand command, boolean isRemote)
ReplicableCommand
read from a data stream with components specific
to the target cache instance.
Implementations should also be deep, in that if the command contains other commands, these should be recursed
into.
command
- command to initialize. Cannot be null.isRemote
- MultipleRpcCommand buildReplicateCommand(List<ReplicableCommand> toReplicate)
toReplicate
- ReplicableCommands to include in the envelope
SingleRpcCommand buildSingleRpcCommand(ReplicableCommand call)
call
- ReplicableCommand to include in the envelope
ClusteredGetCommand buildClusteredGetCommand(Object key, Set<Flag> flags, boolean acquireRemoteLock, GlobalTransaction gtx)
key
- key to look up
LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags, GlobalTransaction gtx)
keys
- keys to lockgtx
-
LockControlCommand buildLockControlCommand(Object key, Set<Flag> flags, GlobalTransaction gtx)
buildLockControlCommand(Object, java.util.Set, org.infinispan.transaction.xa.GlobalTransaction)
but for locking a single key vs a collection of keys.
LockControlCommand buildLockControlCommand(Collection<Object> keys, Set<Flag> flags)
StateTransferControlCommand buildStateTransferCommand(StateTransferControlCommand.Type subtype, Address sender, int viewId)
subtype
- type of RehashControlCommandsender
- sender's AddressviewId
- the last view id on the sender
StateTransferControlCommand buildStateTransferCommand(StateTransferControlCommand.Type subtype, Address sender, int viewId, Collection<InternalCacheEntry> state, Collection<LockInfo> lockInfo)
String getCacheName()
GetInDoubtTransactionsCommand buildGetInDoubtTransactionsCommand()
GetInDoubtTransactionsCommand
.
TxCompletionNotificationCommand buildTxCompletionNotificationCommand(Xid xid, GlobalTransaction globalTransaction)
TxCompletionNotificationCommand
.
<T> DistributedExecuteCommand<T> buildDistributedExecuteCommand(Callable<T> callable, Address sender, Collection keys)
callable
- the callable tasksender
- sender's Addresskeys
- keys used in Callable
MapReduceCommand buildMapReduceCommand(Mapper m, Reducer r, Address sender, Collection keys)
m
- Mapper for MapReduceTaskr
- Reducer for MapReduceTasksender
- sender's Addresskeys
- keys used in MapReduceTask
GetInDoubtTxInfoCommand buildGetInDoubtTxInfoCommand()
GetInDoubtTxInfoCommand
CompleteTransactionCommand buildCompleteTransactionCommand(Xid xid, boolean commit)
xid
- the xid identifying the transaction we want to complete.commit
- commit(true) or rollback(false)?TxCompletionNotificationCommand buildTxCompletionNotificationCommand(long internalId)
internalId
- the internal id identifying the transaction to be removed.TxCompletionNotificationCommand
ApplyDeltaCommand buildApplyDeltaCommand(Object deltaAwareValueKey, Delta delta, Collection keys)
ApplyDeltaCommand
|
--> | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |