ReceiverFrameworkInterface

This interface specifies the methods available in the Receiver Framework, which are as follows:

Method

remove

Method description

Called by the receiver when it detects a nonrecoverable condition. The receiver calls this method only if it cannot continue receiving. The framework marks this receiver for removal and returns immediately. Later the stopReceiving method will be called on the receiver object.

Syntax

public void remove(String transportType)
                   throws BCGReceiverException

Parameters

transportType
A string identifying the receiver by the transport it supports

Method

preProcess

Method description

Called by the receiver to preprocess the document. The Receiver Framework invokes preprocessing handlers configured in the Community Console for this target. The framework invokes the applies method of the handlers (by passing the request document as input) one after the other (in the same sequence as they are configured in the Community Console), until a handler's applies method returns true. The Receiver Framework executes this handler's process method to process the request document. This method returns an array of receiver documents.

Syntax

public ReceiverDocumentInterface[] preProcess(
                                    String transportType,
                                    String target, 
                                    ReceiverDocumentInterface request)
               throws BCGReceiverException

Parameters

transportType
A string identifying the receiver by the transport it supports
target
A string identifying the target
request
The request document to be processed

Method

syncCheck

Method description

Called by the receiver to determine whether the received document can be processed synchronously or asynchronously. The Receiver Framework invokes syncCheck handlers configured in the Community Console for this target. The framework invokes the applies method of each handler one after the other (in the same sequence as they are configured in Community Console), until a handler's applies method returns true. The Receiver Framework executes this handler's syncCheck method to determine whether the request document can be processed synchronously or asynchronously. A value of true indicates that the request is synchronous. A value of false indicates that the request is configured to be asynchronous or that there are no syncCheck handlers configured for this receiver; the request is handled asynchronously.

Syntax

public boolean syncCheck(String transportType, String target,
                                 ReceiverDocumentInterface request)
                   throws BCGReceiverException

Parameters

transportType
A string identifying the receiver by the transport it supports
target
A string identifying the target
request
The request document to be processed

Method

postProcess

Method description

In the case of a synchronous request, the receiver calls the Receiver Framework to postprocess the response document. The Receiver Framework invokes postprocessing handlers configured in the Community Console for this target. The framework invokes each handler's applies method by passing the response document as input one after the other (in the same sequence that they are configured in the Community Console), until the applies method of a handler returns true. The Receiver Framework executes this handler's process method to process the response document.

Syntax

public ReceiverDocumentInterface[] postProcess(
                                    String receiverType,
                                    String target, 
                                    ReceiverDocumentInterface request)
               throws BCGReceiverException

Parameters

receiverType
A string identifying the receiver
target
A string identifying the target
request
The response document to be processed

Method

process

Method description

When this method is called, the framework checks for the Universal Unique ID (UUID) in the request document. If the UUID has not been set, the framework generates the UUID. The framework checks the router_in and sync_in folders for a pre-existing file with the same name as the newly generated UUID (<UUID>.vcm). If the framework finds a pre-existing file with that UUID, it regenerates the UUID. The receiver document is then introduced into the WebSphere Partner Gateway Document Manager. The method has three distinct signatures, depending on the type of processing required: asynchronous, blocking synchronous, or nonblocking synchronous.

Note: The method takes only one request document at a time. If multiple documents exist as a result of preprocessing, the receiver can call this method for each received document.

Syntax

Asynchronous request

public void process(String transportType, ReceiverDocumentInterface request)
                throws BCGReceiverException

This method returns immediately after introducing the document into WebSphere Partner Gateway Document Manager.

Blocking synchronous request

public void process(String transportType, 
                    ReceiverDocumentInterface request, 
                    ReceiverDocumentInterface response)
                throws BCGReceiverException

This method introduces the document into the WebSphere Partner Gateway Document Manager. The method does not return until a response is available.

Nonblocking synchronous request

public void process(String transportType, 
                    ReceiverDocumentInterface request, 
                    ResponseCorrelation responseCorr)
                throws BCGReceiverException

This method returns immediately after introducing the document into the WebSphere Partner Gateway Document Manager. When a response is available, the Receiver Framework invokes the processResponse method on the receiver that made the process call. The Receiver Framework passes the correlation object that was passed in the process method. The receiver can use the response correlation object to correlate the request with the response document.

Parameters

transportType
A string identifying the receiver
request
The input document
response
The blank document to hold the response from Document Manager
responseCorr
The response correlation object that holds information allowing the receiver to synchronize the original request document with the response document to be returned from Document Manager.

Method

setResponseStatus

Method description

Notifies the Receiver Framework of the status of the synchronous response document after it has been returned to the trading partner

Syntax

public void setResponseStatus(String documentUUID, 
                       boolean status, String statusMessage)
              throws BCGReceiverException

Parameters

documentUUID
The document's unique ID
status
A Boolean value that represents the state of the response document
statusMessage
Information related to the status of the response document

Copyright IBM Corp. 2003, 2005