IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base.ws
Class WSAccessOp

java.lang.Object
  extended by com.ibm.btt.base.BTTOperation
      extended by com.ibm.btt.base.BTTServerOperation
          extended by com.ibm.btt.base.ws.WSAccessOp
All Implemented Interfaces:
Cacheable, Operation, ServerOperation, java.io.Externalizable, java.io.Serializable

@ATTR(value={"wsConnectorAlias#String#REQUIRED","wsOperationName#String#REQUIRED","wsSuccessEvent#String#IMPLIED","wsFaultEvent#String#IMPLIED"})
public class WSAccessOp
extends BTTServerOperation

This class provides access to a WebService from a Branch Transformation Toolkit application.

The module enables an application to invoke a specified WebService directly. To do this, the WSAccessOp obtains the alias of the service that will connect with the WebService, the input and output Formats, and the name of the WebService operation to be invoked.

See Also:
Serialized Form

Field Summary
static java.lang.String EXIT_EVENT_NAME
           
protected  java.lang.String wsConnectorAlias
          The WSConnector alias retrieved from the externalized definition
protected  java.lang.String wsFaultEvent
          The WS operation fault event retrieved from the externalized definition
protected  java.lang.String wsOperationName
          The WS operation name retrieved from the externalized definition
protected  java.lang.String wsSuccessEvent
          The WS operation success event retrieved from the externalized definition
 
Fields inherited from class com.ibm.btt.base.BTTOperation
aOperationRepliedListener, COMPID, externalizer
 
Constructor Summary
WSAccessOp()
           
 
Method Summary
 void execute()
          Executes the WebService operation associated with the operation using the protocol provided by the WSConnector service.
protected  java.lang.Class getClassObject(java.lang.Object dataElement)
          Returns the primitive type of the boxed class like Boolean, Float
protected  java.lang.String getExitEventName()
          Returns a String representing the exitEventName that will be sent to the automaton.
 java.lang.String getWsConnectorAlias()
          Returns the wsConnectorAlias property.
 java.lang.String getWsFaultEvent()
           
 java.util.List<WSMapperConverter> getWsInputMapFormats()
          Returns all the input mapper format instances specified in the XML file with wsInputMapFmt name.
 java.lang.String getWsOperationName()
          Returns the wsOperationName property.
 WSMapperConverter getWsOutputMapFormat()
          Returns an instance of the mapper specified in the XML file with wsOutputMapFmt name.
 java.lang.String getWsSuccessEvent()
           
protected  void handleWsAccessOpException(java.lang.Throwable e)
          Handle all Exceptions occurred during web services invocation.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes an WSAccessOp object with the aTag attributes.
protected  void postExecution(WSMapperConverter outputMapper, java.lang.Object ret)
          Copy the return data of web service operation to context.
protected  void prepareExecution(java.util.List<WSMapperConverter> inputMappers, java.lang.Class[] parameterClasses, java.lang.Object[] parameters)
          Prepare the parameters for the web services operation.
 void setWsConnectorAlias(java.lang.String newWsConnectorAlias)
          Sets the wsConnectorAlias property.
 void setWsFaultEvent(java.lang.String wsFaultEvent)
           
 void setWsOperationName(java.lang.String newWsOperationName)
          Sets the wsOperationName property.
 void setWsSuccessEvent(java.lang.String wsSuccessEvent)
           
protected  void signalReplyEvent(java.lang.String name, java.lang.String value)
           
 Vector toStrings()
          Returns a Vector with the String representation of the object.
 
Methods inherited from class com.ibm.btt.base.BTTServerOperation
createOperation, fireExitEvent, getCSReplyFormat, getCSRequestFormat, getOriginWorkstation, runInSession, setCSReplyFormat, setCSRequestFormat, setOriginWorkstation, updateContext, updateContext, validate, validate
 
Methods inherited from class com.ibm.btt.base.BTTOperation
addElement, addOperationRepliedListener, chainTo, clearKeyedCollection, close, externalizer, fireHandleOperationRepliedEvent, getApplicationId, getContext, getContextByType, getContextName, getContextNamed, getElementAt, getExternalizer, getFormat, getFormats, getHostReceiveFormat, getHostSendFormat, getInstanceOfOperationStep, getKeyedCollection, getName, getOperationStep, getOperationStepRC, getOperationSteps, getParent, getSelfDefinedOpTagInputStream, getService, getSessionId, getSgmlSelfDefinedOpFileName, getType, getValueAt, getXValidator, initializeFormatFrom, initializeKeyedCollectionValueFrom, initializeOpStep, initializeOpStepsFrom, isCacheable, isChained, postExecute, preExecute, prune, readExternal, readExternal, readObject, reinitialize, removeAt, removeExternal, removeOperationRepliedListener, setApplicationId, setContext, setContextName, setDefinedContext, setExternalizer, setHostReceiveFormat, setHostSendFormat, setKeyedCollection, setName, setSessionId, setType, setValueAt, setXValidator, toString, toTags, unchain, writeExternal, writeExternal, xValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.base.Operation
addElement, addOperationRepliedListener, chainTo, close, getApplicationId, getContext, getContextName, getElementAt, getFormat, getFormats, getKeyedCollection, getName, getParent, getService, getType, getValueAt, isChained, prune, removeAt, removeOperationRepliedListener, setApplicationId, setContext, setContextName, setKeyedCollection, setName, setType, setValueAt, unchain, xValidate
 
Methods inherited from interface com.ibm.btt.base.Cacheable
isCacheable, reinitialize
 

Field Detail

wsConnectorAlias

protected java.lang.String wsConnectorAlias
The WSConnector alias retrieved from the externalized definition


wsOperationName

protected java.lang.String wsOperationName
The WS operation name retrieved from the externalized definition


wsSuccessEvent

protected java.lang.String wsSuccessEvent
The WS operation success event retrieved from the externalized definition


wsFaultEvent

protected java.lang.String wsFaultEvent
The WS operation fault event retrieved from the externalized definition


EXIT_EVENT_NAME

public static final java.lang.String EXIT_EVENT_NAME
See Also:
Constant Field Values
Constructor Detail

WSAccessOp

public WSAccessOp()
Method Detail

execute

public void execute()
             throws java.lang.Exception
Executes the WebService operation associated with the operation using the protocol provided by the WSConnector service.

To perform this, this method obtains the input and output WSMapperConverters instances from the operation formats' Hashtable, the wsOperationName from the operation tag attributes, and the WSConnector instance service, searching by the alias name, in the operation context hierarchy. Once it obtains all of these, it passes the required parameters (input and output instances mappers, the name of the WebService operation to execute, and the operation context) to the WSConnector service instance. If an error occurs during this process, this method throws an exception.

Specified by:
execute in interface Operation
Overrides:
execute in class BTTServerOperation
Throws:
java.lang.Exception - An error occurs.

handleWsAccessOpException

protected void handleWsAccessOpException(java.lang.Throwable e)
                                  throws java.lang.Exception
Handle all Exceptions occurred during web services invocation.

Throws:
java.lang.Exception

prepareExecution

protected void prepareExecution(java.util.List<WSMapperConverter> inputMappers,
                                java.lang.Class[] parameterClasses,
                                java.lang.Object[] parameters)
                         throws DSEInvalidRequestException,
                                DSEInvalidArgumentException,
                                DSEInvalidClassException
Prepare the parameters for the web services operation. Transform data from context to web service data one by one by WSMapperConverter.

Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
DSEInvalidClassException

postExecution

protected void postExecution(WSMapperConverter outputMapper,
                             java.lang.Object ret)
                      throws DSEInvalidRequestException,
                             DSEInvalidArgumentException,
                             DSEInvalidClassException
Copy the return data of web service operation to context.

Throws:
java.lang.Exception - An error occurs.
DSEInvalidRequestException
DSEInvalidArgumentException
DSEInvalidClassException

signalReplyEvent

protected void signalReplyEvent(java.lang.String name,
                                java.lang.String value)

getClassObject

protected java.lang.Class getClassObject(java.lang.Object dataElement)
                                  throws DSEInvalidArgumentException
Returns the primitive type of the boxed class like Boolean, Float

Returns:
Class the primitive type of the boxed class.
Throws:
DSEInvalidArgumentException

getExitEventName

protected java.lang.String getExitEventName()
Returns a String representing the exitEventName that will be sent to the automaton.

This method is called from the execute method before signaling the event of finalization of the operation. Applications that want to customize which event goes to be sent to the processor must overwrite this method. If this method is NOT overwritten, it will always return "ok".

Through the getContext() method, this method has access to the processor context and its hierarchy, which is updated at this stage with the results of the WebService operation execution.

Returns:
java.lang.String The name of the event that will be signaled to the automaton.

getWsConnectorAlias

public java.lang.String getWsConnectorAlias()
Returns the wsConnectorAlias property.

Returns:
com.ibm.btt.base.Operation - wsConnectorAlias property

getWsInputMapFormats

public java.util.List<WSMapperConverter> getWsInputMapFormats()
                                                       throws DSEInvalidRequestException
Returns all the input mapper format instances specified in the XML file with wsInputMapFmt name.

Returns:
List - The input WSMapperConverter instances.
Throws:
DSEInvalidRequestException

getWsOperationName

public java.lang.String getWsOperationName()
Returns the wsOperationName property.

Returns:
java.lang.String - wsOperationName property

getWsSuccessEvent

public java.lang.String getWsSuccessEvent()

setWsSuccessEvent

public void setWsSuccessEvent(java.lang.String wsSuccessEvent)

getWsFaultEvent

public java.lang.String getWsFaultEvent()

setWsFaultEvent

public void setWsFaultEvent(java.lang.String wsFaultEvent)

getWsOutputMapFormat

public WSMapperConverter getWsOutputMapFormat()
                                       throws DSEInvalidRequestException
Returns an instance of the mapper specified in the XML file with wsOutputMapFmt name.

Returns:
WSMapperConverter - The output WSMapperConverter instance.
Throws:
DSEInvalidRequestException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Initializes an WSAccessOp object with the aTag attributes. The tag contains the definitions for the input and output mappers, the WSConenctor service alias, the WebService operation name and the WebService invocation success or fault event.

Overrides:
initializeFrom in class BTTOperation
Parameters:
aTag - A Tag that contains the name and attributes of the object to be created
Returns:
Object - An instance of WSAccessOp
Throws:
java.io.IOException
DSEException

setWsConnectorAlias

public void setWsConnectorAlias(java.lang.String newWsConnectorAlias)
Sets the wsConnectorAlias property.

Parameters:
newWsConnectorAlias - java.lang.String

setWsOperationName

public void setWsOperationName(java.lang.String newWsOperationName)
Sets the wsOperationName property.

Parameters:
newWsOperationName - java.lang.String

toStrings

public Vector toStrings()
Returns a Vector with the String representation of the object. This method is an Externalizable interface method.

Overrides:
toStrings in class BTTOperation
Returns:
com.ibm.btt.base.Vector - Vector containing String representation of the object

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011