org.jboss.soa.esb.util
Class AbstractCommandVehicle

java.lang.Object
  extended by org.jboss.soa.esb.util.AbstractCommandVehicle
All Implemented Interfaces:
java.io.Serializable

public abstract class AbstractCommandVehicle
extends java.lang.Object
implements java.io.Serializable

Auxiliary class that deals with implementation details of event messages handled by ESB aware applications.

The '_command' enumeration is inteded to contain all accepted command codes, and should be provided by all classes that extend AbstractCommandMessage
Values that this class is able to render are (arbitrarily) stored in a Map contained in the message body as a named Object with key getCommandValuesTag()

Author:
schifest@heuristica.com.ar
See Also:
Serialized Form

Field Summary
protected  java.lang.Enum _operator
           
protected  java.util.Map<java.lang.String,java.lang.Object> _values
           
 
Constructor Summary
protected AbstractCommandVehicle(java.lang.Enum command)
           
protected AbstractCommandVehicle(Message message)
          Populate this event's associated values contained in the ESB message
Values that this class is able to render are expected to be in a Map<String,Object> contained in the message body as a named Object (key=getCommandValuesTag())
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> cleanValues()
          Clean all values from this command object
Operator will still remain the same as before
abstract  java.lang.String getCommandOpcodeKey()
          The key for the command operation code in the command values map
abstract  java.lang.String getCommandValuesTag()
          Provide a name for the named object to look for in the ESB Message body.
 java.lang.Enum getOperator()
           
abstract  java.lang.Enum operatorFromString(java.lang.String value)
          Valid operator for this command vehicle, from String value
protected  void setOperator(java.lang.Enum operator)
           
protected  java.lang.Object setValue(java.lang.String key, java.lang.Object value)
           
 Message toCommandMessage()
          Instantiate a new message, and put values where they belong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_values

protected java.util.Map<java.lang.String,java.lang.Object> _values

_operator

protected java.lang.Enum _operator
Constructor Detail

AbstractCommandVehicle

protected AbstractCommandVehicle(java.lang.Enum command)

AbstractCommandVehicle

protected AbstractCommandVehicle(Message message)
Populate this event's associated values contained in the ESB message
Values that this class is able to render are expected to be in a Map<String,Object> contained in the message body as a named Object (key=getCommandValuesTag())

Parameters:
message - : Message - the vehicle of this command
Method Detail

getCommandValuesTag

public abstract java.lang.String getCommandValuesTag()
Provide a name for the named object to look for in the ESB Message body.

Returns:
String : intended to be used as the key in Message.getBody().get(arg)

getCommandOpcodeKey

public abstract java.lang.String getCommandOpcodeKey()
The key for the command operation code in the command values map

Returns:
String : intended to be used as the key in _values.get(arg)

operatorFromString

public abstract java.lang.Enum operatorFromString(java.lang.String value)
Valid operator for this command vehicle, from String value

Parameters:
value - - the String value of the operator
Returns:
the Enum value that represents arg0

getOperator

public java.lang.Enum getOperator()

setOperator

protected void setOperator(java.lang.Enum operator)

toCommandMessage

public Message toCommandMessage()
Instantiate a new message, and put values where they belong

Returns:
Message - a fresh Message, with the command values in the appropriate spot

cleanValues

public java.util.Map<java.lang.String,java.lang.Object> cleanValues()
Clean all values from this command object
Operator will still remain the same as before

Returns:
Map the old contents of _values

setValue

protected java.lang.Object setValue(java.lang.String key,
                                    java.lang.Object value)