com.ibm.j2ca.extension.commandpattern
Class Command

java.lang.Object
  extended bycom.ibm.j2ca.extension.commandpattern.Command

public abstract class Command
extends java.lang.Object

Command This class is designed to represent a node level operation on a data object structure. An adapter generally has several implementation of Command; one for each possible kind of operation. For instance, an adapter implementing CUD operations will generally have three command implemntations: EisCreateCommand, EisDeleteCommand, and EisUpdateCommand.


Field Summary
static int AFTER_PARENT
           
static int BEFORE_PARENT
           
 
Constructor Summary
Command()
          This is the default constructor for Command
Command(commonj.sdo.DataObject dataObject)
          This constructor takes a data object.
 
Method Summary
 void execute()
          Execute This execute method is called from the object that's executing the command.
abstract  commonj.sdo.DataObject execute(commonj.sdo.DataObject inputObject)
          Execute This method executes the command.
 commonj.sdo.ChangeSummary getChangeSummary()
           
 java.util.ArrayList getChildCommands()
           
 java.lang.Object getConnection()
           
 commonj.sdo.DataObject getDataObject()
           
 java.lang.Object getEisRepresentation()
           
 int getExecutionOrder()
           
 LogUtils getLogUtils()
           
 Command getParentCommand()
           
 commonj.sdo.DataObject getParentDataObject()
           
 boolean isDelta()
           
 void setConnection(java.lang.Object connection)
           
 void setEisRepresentation(java.lang.Object eisRepresentation)
           
 void setExecutionOrder(int executionOrder)
           
 void setLogUtils(LogUtils logUtils)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEFORE_PARENT

public static final int BEFORE_PARENT
See Also:
Constant Field Values

AFTER_PARENT

public static final int AFTER_PARENT
See Also:
Constant Field Values
Constructor Detail

Command

public Command()
This is the default constructor for Command


Command

public Command(commonj.sdo.DataObject dataObject)
This constructor takes a data object.

Method Detail

execute

public void execute()
             throws javax.resource.ResourceException
Execute This execute method is called from the object that's executing the command. Usually this is the Interpreter.

Throws:
javax.resource.ResourceException

execute

public abstract commonj.sdo.DataObject execute(commonj.sdo.DataObject inputObject)
                                        throws javax.resource.ResourceException
Execute This method executes the command. An adapter developer must implement this method in every command type. Generally the execute applies to a single node of a Data Object structure. If this is an update command, the execute method should call the EIS API to update the inputObject.

Parameters:
inputObject - the object that this command operates on
Returns:
the result of the operation, including side-effects. For most operations, you may update the object in place and return it. In other cases, such as in performing a "RetrieveAll" operation, you need to create a new data object structure and return that.
Throws:
javax.resource.ResourceException - you may throw a ResourceException when the command execution fails.

getConnection

public java.lang.Object getConnection()
Returns:
Returns the connection.

setConnection

public void setConnection(java.lang.Object connection)
Parameters:
connection - The connection to set.

getParentDataObject

public commonj.sdo.DataObject getParentDataObject()
Returns:
the data object in the parent command.

getParentCommand

public Command getParentCommand()
Returns:
Parent Command

getChildCommands

public java.util.ArrayList getChildCommands()
Returns:
List of child Commands

getExecutionOrder

public int getExecutionOrder()
Returns:
Returns the executionOrder.

setExecutionOrder

public void setExecutionOrder(int executionOrder)
Parameters:
executionOrder - The executionOrder to set.

getEisRepresentation

public java.lang.Object getEisRepresentation()
Returns:
Returns the eisRepresentation.

setEisRepresentation

public void setEisRepresentation(java.lang.Object eisRepresentation)
Parameters:
eisRepresentation - The eisRepresentation to set.

getChangeSummary

public commonj.sdo.ChangeSummary getChangeSummary()
Returns:
Returns the changeSummary.

isDelta

public boolean isDelta()
Returns:
Returns the isDelta.

getDataObject

public commonj.sdo.DataObject getDataObject()
Returns:
Returns the dataObject.

getLogUtils

public LogUtils getLogUtils()
Returns:
Returns the logUtils.

setLogUtils

public void setLogUtils(LogUtils logUtils)
Parameters:
logUtils - The logUtils to set.