public abstract class AbstractVersionedDataCommand extends AbstractDataCommand implements VersionedDataCommand
DataCommand
which handles common behaviourModifier and Type | Field and Description |
---|---|
protected DataVersion |
dataVersion |
protected GlobalTransaction |
globalTransaction |
protected Notifier |
notifier |
dataContainer, fqn
Constructor and Description |
---|
AbstractVersionedDataCommand() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
DataVersion |
getDataVersion() |
GlobalTransaction |
getGlobalTransaction() |
Object[] |
getParameters()
Basic versions of these methods
|
int |
hashCode() |
void |
initialize(Notifier notifier,
DataContainer dataContainer) |
boolean |
isVersioned()
Has data version set? (i.e.
|
protected abstract boolean |
isVersionedId(int id) |
protected NodeSPI |
peekVersioned(InvocationContext ctx)
Utility method to peek a node and throw an exception if the version isn't what is expected.
|
void |
setDataVersion(DataVersion dataVersion)
Sets the DataVersion pertaining to this command.
|
void |
setGlobalTransaction(GlobalTransaction globalTransaction)
Sets a GlobalTransaction on this command.
|
void |
setParameters(int commandId,
Object[] args)
Basic versions of these methods
|
getFqn, initialize, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getFqn
acceptVisitor
getCommandId, perform
protected Notifier notifier
protected DataVersion dataVersion
protected GlobalTransaction globalTransaction
public void initialize(Notifier notifier, DataContainer dataContainer)
public DataVersion getDataVersion()
getDataVersion
in interface VersionedDataCommand
public void setDataVersion(DataVersion dataVersion)
VersionedDataCommand
setDataVersion
in interface VersionedDataCommand
dataVersion
- to setpublic GlobalTransaction getGlobalTransaction()
getGlobalTransaction
in interface WriteCommand
public void setGlobalTransaction(GlobalTransaction globalTransaction)
WriteCommand
setGlobalTransaction
in interface WriteCommand
globalTransaction
- global transaction to setpublic boolean isVersioned()
VersionedDataCommand
isVersioned
in interface VersionedDataCommand
public Object[] getParameters()
AbstractDataCommand
getParameters
in interface ReplicableCommand
getParameters
in class AbstractDataCommand
public void setParameters(int commandId, Object[] args)
AbstractDataCommand
setParameters
in interface ReplicableCommand
setParameters
in class AbstractDataCommand
commandId
- command id to set. This is usually unused but *could* be used in the event of a command having multiple IDs, such as PutKeyValueCommand
.args
- object array of argsprotected abstract boolean isVersionedId(int id)
public boolean equals(Object o)
equals
in class AbstractDataCommand
public int hashCode()
hashCode
in class AbstractDataCommand
protected NodeSPI peekVersioned(InvocationContext ctx)
ctx
- context to useDataVersioningException
- if there is a version mismatchCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.