IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Class OperationStep

java.lang.Object
  extended bycom.ibm.dse.base.OperationStep
All Implemented Interfaces:
OperationStepInterface
Direct Known Subclasses:
CompareAssertion, ExistsAssertion, NumOfElementsAssertion

public abstract class OperationStep
extends java.lang.Object
implements OperationStepInterface

This class enables you to break an operation into a set of operation steps. This provides an opportunity to reuse code when performing the same specific tasks within different operations. This class accepts the main Operation protocol so that pieces of code can be moved from the main operation flow to a specific operation step and the other way around without changing the code. Customized operation steps can be defined as children of this class for multiple purposes.


Field Summary
 KeyedCollection params
          The operation step parameters.
static int RC_ERROR
           
static int RC_OK
           
 
Constructor Summary
OperationStep()
           
 
Method Summary
 DataElement addElement(DataElement aDataElement)
          Adds the element aDataElement to the keyed collection of the operation.
abstract  int execute()
          This is an abstract method.
 java.lang.String getApplicationId()
          Returns the operation applicationId.
 Context getContext()
          Returns the operation context.
 DataElement getElementAt(java.lang.String aCompositeKey)
          Returns the DataElement identified by aCompositeKey.
 java.lang.Object getFormat(java.lang.String aFormatName)
          Returns the operation format named FormatName.
 Hashtable getFormats()
          Returns the operation formats Hashtable.
 KeyedCollection getKeyedCollection()
          Returns the context keyedCollection.
 java.lang.String getName()
          Returns the operation step name.
 Operation getOperation()
          Returns the operation attribute of operationStep.
 KeyedCollection getParams()
          Returns the parameters of the operation step.
 Context getParent()
          Returns the Context object defined as the parent context of the operation context.
 Service getService(java.lang.String aServiceName)
          Returns the operation service named aServiceName.
 java.lang.Object getValueAt(java.lang.String aCompositeKey)
          Returns the value of the data element identified by aConpositeKey.
 DataElement removeAt(java.lang.String aCompositeKey)
          Removes the data element identified by aCompositeKey from the context data collection.
 void setApplicationId(java.lang.String appId)
          Sets the operation application id to applicationId.
 void setName(java.lang.String aName)
          Sets the operation step name to name.
 void setOperation(Operation anOperation)
          Sets the operation attribute of operationStep.
 void setParams(KeyedCollection kc)
          Sets the parameters of the operation step.
 void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue)
          Sets the value of the data identified by aCompositeKey to aDataValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RC_OK

public static final int RC_OK
See Also:
Constant Field Values

RC_ERROR

public static final int RC_ERROR
See Also:
Constant Field Values

params

public KeyedCollection params
The operation step parameters.

Constructor Detail

OperationStep

public OperationStep()
Method Detail

addElement

public DataElement addElement(DataElement aDataElement)
                       throws DSEInvalidRequestException
Adds the element aDataElement to the keyed collection of the operation. Refer to the Context class addElement method for an example of implementing this method.

Specified by:
addElement in interface OperationStepInterface
Parameters:
aDataElement - com.ibm.dse.base.DataElement
Returns:
com.ibm.dse.base.DataElement
Throws:
DSEInvalidRequestException

execute

public abstract int execute()
                     throws java.lang.Exception
This is an abstract method.

Specified by:
execute in interface OperationStepInterface
Returns:
int
Throws:
java.lang.Exception

getApplicationId

public java.lang.String getApplicationId()
Returns the operation applicationId.

Specified by:
getApplicationId in interface OperationStepInterface

getContext

public Context getContext()
Returns the operation context. The value defaults to the name of the operation removing ClientOp/ServerOp and adding ClientOc/ServerOc.

Specified by:
getContext in interface OperationStepInterface
Returns:
com.ibm.dse.base.Context

getElementAt

public DataElement getElementAt(java.lang.String aCompositeKey)
                         throws DSEObjectNotFoundException
Returns the DataElement identified by aCompositeKey. Refer to the same method in KeyedCollection class for an example of implementing this method.

Specified by:
getElementAt in interface OperationStepInterface
Returns:
com.ibm.dse.base.DataElement
Throws:
DSEObjectNotFoundException

getFormat

public java.lang.Object getFormat(java.lang.String aFormatName)
Returns the operation format named FormatName.

Specified by:
getFormat in interface OperationStepInterface
Parameters:
aFormatName - java.lang.String
Returns:
java.lang.Object

getFormats

public Hashtable getFormats()
Returns the operation formats Hashtable.

Specified by:
getFormats in interface OperationStepInterface
Returns:
com.ibm.dse.base.Hashtable

getKeyedCollection

public KeyedCollection getKeyedCollection()
Returns the context keyedCollection. Refer to the Context class getKeyedCollection method for an example of implementing this method.

Specified by:
getKeyedCollection in interface OperationStepInterface
Returns:
com.ibm.dse.base.KeyedCollecion

getName

public java.lang.String getName()
Returns the operation step name.

Specified by:
getName in interface OperationStepInterface

getOperation

public Operation getOperation()
Returns the operation attribute of operationStep.

Specified by:
getOperation in interface OperationStepInterface
Returns:
com.ibm.dse.base.Operation

getParams

public KeyedCollection getParams()
Returns the parameters of the operation step.

Specified by:
getParams in interface OperationStepInterface
Returns:
com.ibm.dse.base.KeyedCollection

getParent

public Context getParent()
Returns the Context object defined as the parent context of the operation context.

Specified by:
getParent in interface OperationStepInterface

getService

public Service getService(java.lang.String aServiceName)
                   throws DSEObjectNotFoundException
Returns the operation service named aServiceName.

Specified by:
getService in interface OperationStepInterface
Parameters:
aServiceName - java.lang.String
Returns:
com.ibm.dse.base.Service
Throws:
DSEObjectNotFoundException

getValueAt

public java.lang.Object getValueAt(java.lang.String aCompositeKey)
                            throws DSEObjectNotFoundException
Returns the value of the data element identified by aConpositeKey. Refer to the same method of the KeyedCollection class for an example of implementing this method. This method throws a DSEObjectNotFoundException if the data element is not found.

Specified by:
getValueAt in interface OperationStepInterface
Parameters:
aCompositeKey - java.lang.String
Returns:
java.lang.Object
Throws:
DSEObjectNotFoundException

removeAt

public DataElement removeAt(java.lang.String aCompositeKey)
                     throws DSEInvalidRequestException,
                            DSEObjectNotFoundException
Removes the data element identified by aCompositeKey from the context data collection. Refer to the Context class removeAt method for an example of implementing this method. This method throws a DSEInvalidRequestException and a DSEObjectNotFoundException.

Specified by:
removeAt in interface OperationStepInterface
Parameters:
aCompositeKey - java.lang.String
Returns:
com.ibm.ds.ebase.DataElement
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

setApplicationId

public void setApplicationId(java.lang.String appId)
Sets the operation application id to applicationId.

Specified by:
setApplicationId in interface OperationStepInterface

setName

public void setName(java.lang.String aName)
Sets the operation step name to name.

Specified by:
setName in interface OperationStepInterface
Parameters:
aName - java.lang.String

setOperation

public void setOperation(Operation anOperation)
Sets the operation attribute of operationStep.

Specified by:
setOperation in interface OperationStepInterface
Parameters:
anOperation - com.ibm.dse.base.Operation

setParams

public void setParams(KeyedCollection kc)
Sets the parameters of the operation step.

Specified by:
setParams in interface OperationStepInterface
Parameters:
kc - com.ibm.dse.base.KeyedCollection

setValueAt

public void setValueAt(java.lang.String aCompositeKey,
                       java.lang.Object aDataValue)
                throws DSEObjectNotFoundException,
                       DSEInvalidArgumentException
Sets the value of the data identified by aCompositeKey to aDataValue. This method throws a DSEInvalidRequestException if the data type doesn't allow a setValue(). It throws a DSEObjectNotFoundException if the data is not found.

Specified by:
setValueAt in interface OperationStepInterface
Parameters:
aCompositeKey - java.lang.String
aDataValue - java.lang.Object
Throws:
DSEObjectNotFoundException
DSEInvalidArgumentException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005