org.jboss.cache.commands.write
Class PutDataMapCommand

java.lang.Object
  extended by org.jboss.cache.commands.read.AbstractDataCommand
      extended by org.jboss.cache.commands.write.AbstractVersionedDataCommand
          extended by org.jboss.cache.commands.write.PutDataMapCommand
All Implemented Interfaces:
DataCommand, ReplicableCommand, VersionedDataCommand, VisitableCommand, WriteCommand
Direct Known Subclasses:
PessPutDataMapCommand

public class PutDataMapCommand
extends AbstractVersionedDataCommand

Implements functionality defined by Cache.put(String, java.util.Map).

Since:
2.2
Author:
Mircea.Markus@jboss.com

Field Summary
protected  Map data
           
protected  boolean erase
           
static int ERASE_METHOD_ID
           
static int ERASE_VERSIONED_METHOD_ID
           
protected static org.apache.commons.logging.Log log
           
static int METHOD_ID
           
protected static boolean trace
           
static int VERSIONED_METHOD_ID
           
 
Fields inherited from class org.jboss.cache.commands.write.AbstractVersionedDataCommand
dataVersion, globalTransaction, notifier
 
Fields inherited from class org.jboss.cache.commands.read.AbstractDataCommand
dataContainer, fqn
 
Constructor Summary
PutDataMapCommand()
           
PutDataMapCommand(GlobalTransaction globalTransaction, Fqn fqn, Map data)
           
 
Method Summary
 Object acceptVisitor(InvocationContext ctx, Visitor visitor)
          Accept a visitor, and return the result of accepting this visitor.
 boolean equals(Object o)
           
 int getCommandId()
          Used by marshallers to convert this command into an id for streaming.
 Map getData()
           
 Object[] getParameters()
          Basic versions of these methods
 int hashCode()
           
 boolean isErase()
          Returns a flag indicating the node data should be erased.
protected  boolean isVersionedId(int id)
           
 Object perform(InvocationContext ctx)
          Adds the provided data map to the data map in the node referenced by the specified Fqn.
 void setData(Map data)
           
 void setErase(boolean erase)
          Sets a flag indicating the node data should be erased.
 void setParameters(int commandId, Object[] args)
          Basic versions of these methods
 String toString()
           
 
Methods inherited from class org.jboss.cache.commands.write.AbstractVersionedDataCommand
getDataVersion, getGlobalTransaction, initialize, isVersioned, peekVersioned, setDataVersion, setGlobalTransaction
 
Methods inherited from class org.jboss.cache.commands.read.AbstractDataCommand
getFqn, initialize
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.commands.DataCommand
getFqn
 

Field Detail

METHOD_ID

public static final int METHOD_ID
See Also:
Constant Field Values

ERASE_METHOD_ID

public static final int ERASE_METHOD_ID
See Also:
Constant Field Values

VERSIONED_METHOD_ID

public static final int VERSIONED_METHOD_ID
See Also:
Constant Field Values

ERASE_VERSIONED_METHOD_ID

public static final int ERASE_VERSIONED_METHOD_ID
See Also:
Constant Field Values

log

protected static final org.apache.commons.logging.Log log

trace

protected static final boolean trace

data

protected Map data

erase

protected boolean erase
Constructor Detail

PutDataMapCommand

public PutDataMapCommand(GlobalTransaction globalTransaction,
                         Fqn fqn,
                         Map data)

PutDataMapCommand

public PutDataMapCommand()
Method Detail

perform

public Object perform(InvocationContext ctx)
Adds the provided data map to the data map in the node referenced by the specified Fqn.

Parameters:
ctx - invocation context
Returns:
arbitrary return value generated by performing this command

acceptVisitor

public Object acceptVisitor(InvocationContext ctx,
                            Visitor visitor)
                     throws Throwable
Description copied from interface: VisitableCommand
Accept a visitor, and return the result of accepting this visitor.

Parameters:
ctx - invocation context
visitor - visitor to accept
Returns:
arbitrary return value
Throws:
Throwable - in the event of problems

getData

public Map getData()

setData

public void setData(Map data)

getCommandId

public int getCommandId()
Description copied from interface: ReplicableCommand
Used by marshallers to convert this command into an id for streaming.

Returns:
the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.

getParameters

public Object[] getParameters()
Description copied from class: AbstractDataCommand
Basic versions of these methods

Specified by:
getParameters in interface ReplicableCommand
Overrides:
getParameters in class AbstractVersionedDataCommand
Returns:
an object array of arguments, compatible with pre-2.2.0 MethodCall args.

setParameters

public void setParameters(int commandId,
                          Object[] args)
Description copied from class: AbstractDataCommand
Basic versions of these methods

Specified by:
setParameters in interface ReplicableCommand
Overrides:
setParameters in class AbstractVersionedDataCommand
Parameters:
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 args

isVersionedId

protected boolean isVersionedId(int id)
Specified by:
isVersionedId in class AbstractVersionedDataCommand

equals

public boolean equals(Object o)
Overrides:
equals in class AbstractVersionedDataCommand

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractVersionedDataCommand

setErase

public void setErase(boolean erase)
Sets a flag indicating the node data should be erased.


isErase

public boolean isErase()
Returns a flag indicating the node data should be erased.


toString

public String toString()
Overrides:
toString in class AbstractDataCommand


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