IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Interface Operation

All Superinterfaces:
Cacheable
All Known Subinterfaces:
ClientOperation, ServerOperation
All Known Implementing Classes:
DSEClientOperation, DSEOperation, DSEServerOperation

public interface Operation
extends Cacheable

Operation interface. This is the generic interface for any operation. Any object implementing this interface must provide the corresponding protocol for initializing, executing, and closing the operation, as well as providing the corresponding context protocol to handle the operation as a context (get/set objects from/to its context, get formats and services, etc.).


Method Summary
 DataElement addElement(DataElement aDataElement)
          Adds an element "aDataElement" to the KeyedCollection of the operation.
 void addOperationRepliedListener(OperationRepliedListener newListener)
          Adds an operation replied listener.
 void chainTo(Context aContext)
          Sets the receiving context as a child of "aContext" and as the new current child.
 void chainToContextNamed(java.lang.String aContextName)
          Sets the context as a child of the context named aContextName in the hierarchy.
 void close()
          This method must include any housekeeping process before ending the operation process.
 void execute()
          This method must provide the whole operation flow process.
 java.lang.String getApplicationId()
          Returns the applicationId.
 Context getContext()
          Returns the operation context.
 java.lang.String getContextName()
          Returns the context name.
 DataElement getElementAt(java.lang.String aCompositeKey)
          Returns the DataElement identified by the aCompositeKey parameter.
 java.lang.Object getFormat(java.lang.String aFormatName)
          Returns the formatElement named aFormatName from the formats Hashtable.
 Hashtable getFormats()
          * Returns the operation formats Hashtable.
 KeyedCollection getKeyedCollection()
          Returns the context keyedCollection.
 java.lang.String getName()
          Returns the operation name.
 Context getParent()
          Returns the Context object defined as the parent context of the operation context.
 Service getService(java.lang.String aServiceName)
          Returns the service named aServiceName from the chain of contexts attached to the operation.
 Service getServiceByType(java.lang.String aServiceType)
          Returns the service of type aServiceType from the chain of contexts attached to the operation.
 java.lang.String getType()
          Returns the operation context type.
 java.lang.Object getValueAt(java.lang.String aCompositeKey)
          Returns value of the data element identified by aConpositeKey.
 boolean hasServices()
          Returns true if the operation context has any service defined.
 boolean isChained()
          Returns true if the operation context is chained to the hierarchy.
 void prune()
          Removes the operation context from the hierarchy.
 DataElement removeAt(java.lang.String aCompositeKey)
          Removes the data element identified by aCompositeKey from the context data collection.
 void removeOperationRepliedListener(OperationRepliedListener newListener)
          Removes the operation replied listener.
 void setApplicationId(java.lang.String appId)
          Sets the operation application id to applicationId.
 void setContext(Context aContext)
          Sets the operation context to aContext.
 void setContextName(java.lang.String aContextName)
          This method sets the context identifier to aContextName.
 void setKeyedCollection(KeyedCollection aKeyedCollection)
          Sets the operation context keyed collection to aKeyedCollection.
 void setName(java.lang.String name)
          Sets the operation name to name.
 void setType(java.lang.String aContextType)
          Sets the operation context type to aContextType.
 void setValueAt(java.lang.String aCompositeKey, java.lang.Object aDataValue)
          Sets the value of the data identified by aCompositeKey to aDataValue.
 void unchain()
          Removes the operation context from the context hierarchy.
 java.lang.String[] xValidate()
          Returns a String that indicates if the validation has been achieved successfully or not.
 
Methods inherited from interface com.ibm.dse.base.Cacheable
isCacheable, reinitialize
 

Method Detail

addElement

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

Throws:
DSEInvalidRequestException

addOperationRepliedListener

public void addOperationRepliedListener(OperationRepliedListener newListener)
Adds an operation replied listener.

Parameters:
newListener - com.ibm.dse.base.OperationRepliedListener

chainTo

public void chainTo(Context aContext)
             throws DSEInvalidRequestException
Sets the receiving context as a child of "aContext" and as the new current child. Refer to the Context class chainTo method for an example of implementing this method. This method throws a DSEInvalidRequestException.

Throws:
DSEInvalidRequestException

chainToContextNamed

public void chainToContextNamed(java.lang.String aContextName)
                         throws DSEInvalidRequestException,
                                DSEObjectNotFoundException
Sets the context as a child of the context named aContextName in the hierarchy. The receiving context is set as the new curent child. If there is more than one context with this name, one of them is choosen at random. Refer to the Context class chainToContextNamed method for an example of implementing this method. This method throws a DSEInvalidRequestException generated by the chainTo method and throws a DSEObjectNotFoundException if context parent is not found.

Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

close

public void close()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
This method must include any housekeeping process before ending the operation process.

Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

execute

public void execute()
             throws java.lang.Exception
This method must provide the whole operation flow process.

Throws:
java.lang.Exception

getApplicationId

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


getContext

public Context getContext()
Returns the operation context.


getContextName

public java.lang.String getContextName()
Returns the context name.


getElementAt

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

Throws:
DSEObjectNotFoundException

getFormat

public java.lang.Object getFormat(java.lang.String aFormatName)
                           throws DSEInvalidArgumentException
Returns the formatElement named aFormatName from the formats Hashtable.

Throws:
DSEInvalidArgumentException

getFormats

public Hashtable getFormats()
* Returns the operation formats Hashtable.


getKeyedCollection

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


getName

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

Specified by:
getName in interface Cacheable
Returns:
String

getParent

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


getService

public Service getService(java.lang.String aServiceName)
                   throws DSEObjectNotFoundException
Returns the service named aServiceName from the chain of contexts attached to the operation. Refer to the Context class getService method for an example of implementing this method. This method throws a DSEObjectNotFoundException if the service is not found.

Throws:
DSEObjectNotFoundException

getServiceByType

public Service getServiceByType(java.lang.String aServiceType)
                         throws DSEObjectNotFoundException
Returns the service of type aServiceType from the chain of contexts attached to the operation. Refer to the Context class getServiceByType method for an example of implementing this method. This method throws a "DSEObjectNotFoundException" if the type of service is not found.

Throws:
DSEObjectNotFoundException

getType

public java.lang.String getType()
Returns the operation context type.


getValueAt

public java.lang.Object getValueAt(java.lang.String aCompositeKey)
                            throws DSEObjectNotFoundException
Returns 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.

Throws:
DSEObjectNotFoundException

hasServices

public boolean hasServices()
Returns true if the operation context has any service defined. Refer to the Context class hasServices method for an example of implementing this method.


isChained

public boolean isChained()
Returns true if the operation context is chained to the hierarchy.


prune

public void prune()
           throws DSEInvalidRequestException,
                  DSEObjectNotFoundException
Removes the operation context from the hierarchy. All of its descendants become orphans. Refer to the Context class prune method for an example of implementing this method. This method throws a "DSEInvalidRequestException" and throws a DSEObjectNotFoundException.

Throws:
DSEInvalidRequestException
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 throws a DSEObjectNotFoundException.

Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

removeOperationRepliedListener

public void removeOperationRepliedListener(OperationRepliedListener newListener)
Removes the operation replied listener.


setApplicationId

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


setContext

public void setContext(Context aContext)
Sets the operation context to aContext.


setContextName

public void setContextName(java.lang.String aContextName)
This method sets the context identifier to aContextName.


setKeyedCollection

public void setKeyedCollection(KeyedCollection aKeyedCollection)
Sets the operation context keyed collection to aKeyedCollection.


setName

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

Parameters:
name - java.lang.String

setType

public void setType(java.lang.String aContextType)
Sets the operation context type to aContextType.


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() and throws a DSEObjectNotFoundException if the data element is not found.

Throws:
DSEObjectNotFoundException
DSEInvalidArgumentException

unchain

public void unchain()
             throws DSEInvalidRequestException,
                    DSEObjectNotFoundException
Removes the operation context from the context hierarchy. The parent attribute is set to null and the operation context is removed from the children list in the parent context. The receiving context cannot have children. Refer to the Context class unchain method for an example of implementing this method. This method throws a DSEInvalidRequestException and throws a DSEObjectNotFoundException.

Throws:
DSEInvalidRequestException
DSEObjectNotFoundException

xValidate

public java.lang.String[] xValidate()
Returns a String that indicates if the validation has been achieved successfully or not. If method returns null the validation was successful. If the returned value is a String[], the validation was not successful and the returned String contains the error messages.

Returns:
String[] - the result of the validation (null or error messages).

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005