AdroitLogic UltraESB v1.7.0

org.adroitlogic.as2.api
Interface AS2Manager

All Known Implementing Classes:
AS2Manager

public interface AS2Manager

Manages the AS2 configuration, and acts as the interface between the AS2 support and the UltraESB

Receiving Files

Configure the HTTP/S protocol and authentication as required. When a raw HTTP/S based AS2 message is accepted by the transport level, invoke the AS2Manager.processIncomingAS2Message(org.adroitlogic.ultraesb.api.Message)

ReceiveInfo rcvInfo = mediation.getAS2Manager().processIncomingAS2Message(msg);

The ReceiveInfo bean will hold information about the AS2 aspects of the message, and the status about the MDN being sent back already (i.e. if a synchronous MDN was used) or state as pending

Sending back sync MDN responses and closure of the transport level

The AS2Manager.processIncomingAS2Message(org.adroitlogic.ultraesb.api.Message) call will close the incoming HTTP/S transport as per AS2 semantics and send back a synchronous MDN if one has been requested

Sending back async MDN responses

If an async MDN has been requested, invoke the following to send back the async MDN via a "default" type address endpoint

if (rcvInfo.isAsyncMDNRequested() && !rcvInfo.isMDNSent()) { Message asyncMdn = msg.cloneMessage(); mediation.getAS2Manager().prepareAsyncMDNForSend(asyncMdn, rcvInfo); mediation.sendToEndpoint(asyncMdn, "async-mdn-ep"); } ...

To process the transport level response received for the async MDN (e.g. 200, 500 etc) or to record any failure sending back the async MDN, the outSequence and the errorSequence should call AS2Manager.processAsyncMDNSendResult(org.adroitlogic.ultraesb.api.Message) and the AS2Manager.recordSendFailure(org.adroitlogic.ultraesb.api.Message) respectively

outSequence => mediation.getAS2Manager().processAsyncMDNSendResult(msg); errorSequence => mediation.getAS2Manager().recordSendFailure(msg);

Sending Files

Invoke the AS2Manager.prepareAS2MessageForSend(org.adroitlogic.ultraesb.api.Message, Partner)

or the AS2Manager.prepareAS2MessageForSend(org.adroitlogic.ultraesb.api.Message, String) methods, and then send the result message via a "default" address endpoint (i.e. the destination URL of the partner would be already set in the message as the default URL) mediation.getAS2Manager().prepareAS2MessageForSend(msg, partner); mediation.getAS2Manager().prepareAS2MessageForSend(msg, "");

An outSequence must then process the synchronous response (possibly including a sync MDN) and the transport return status by invoking AS2Manager.processSyncResponse(org.adroitlogic.ultraesb.api.Message)

SyncResponseInfo srInfo = mediation.getAS2Manager().processSyncResponse(msg);

If a send failure occurs, notify the AS2 manager of it by invoking AS2Manager.recordSendFailure(org.adroitlogic.ultraesb.api.Message)

mediation.getAS2Manager().recordSendFailure(msg);

Processing Asynchronous MDNs

If the partner is expected to send an async MDN, create a Proxy service accordingly and specify its public URL to the partner when sending the message. The proxy receiving an async MDN must then invoke the AS2Manager.processAsyncMDN(org.adroitlogic.ultraesb.api.Message) to record the receipt of an async MDN

AsyncMDNInfo mdnInfo = mediation.getAS2Manager().processAsyncMDN(msg);

Refer to samples # 350, 351, 352 etc for sample configurations and use


Method Summary
 SendInfo prepareAS2MessageForSend(Message msg, Partner partner)
          Create an AS2 message using the current Message and its attachments, and sets the destination URL as of the selected partner.
 SendInfo prepareAS2MessageForSend(Message msg, java.lang.String partnerID)
          Create an AS2 message using the current Message and its attachments, and sets the destination URL as of the selected partner.
 void prepareAsyncMDNForSend(Message asyncMdn, ReceiveInfo rcvInfo)
          Prepare an asynchronous MDN message to be sent by populating the payload (i.e.
 AsyncMDNInfo processAsyncMDN(Message msg)
          Routine to process a new asynchronous MDN received for a message sent out by us, requesting an asynchronous MDN.
 void processAsyncMDNSendResult(Message msg)
          Notify the outcome of the asynchronous MDN send operation
 ReceiveInfo processIncomingAS2Message(Message msg)
          Routine to process a new AS2 message received over HTTP/S.
 SyncResponseInfo processSyncResponse(Message msg)
          Routine to process the synchronous response received for a AS2 send operation (i.e.
 void recordSendFailure(Message msg)
          Record an AS2 message send failure - to be used to notify about asynchronous MDN send failures as well as AS2 message send failures
 

Method Detail

processIncomingAS2Message

ReceiveInfo processIncomingAS2Message(Message msg)
Routine to process a new AS2 message received over HTTP/S. Parses it and takes necessary AS2 protocol level action on it such as issuing of a sync MDN and closure of the HTTP/S transport as per AS2 semantics. Populates the current message with the attachments for subsequent processing, and returns information about the processing performed

Parameters:
msg - message containing raw HTTP/S level AS2 message
Returns:
AS2 processing result information

prepareAsyncMDNForSend

void prepareAsyncMDNForSend(Message asyncMdn,
                            ReceiveInfo rcvInfo)
Prepare an asynchronous MDN message to be sent by populating the payload (i.e. containing the MDN), transport headers and async MDN URL of the partner set as the default destination. The message should then be sent via a 'default' address of an endpoint

Parameters:
asyncMdn - the message to be populated with the async MDN information (usually a clone with Message.cloneMessage())
rcvInfo - the AS2 receive information bean containing the information to create the asynchronous MDN

processAsyncMDNSendResult

void processAsyncMDNSendResult(Message msg)
Notify the outcome of the asynchronous MDN send operation

Parameters:
msg - the response message received for an asynchronous MDN reply sent

recordSendFailure

void recordSendFailure(Message msg)
Record an AS2 message send failure - to be used to notify about asynchronous MDN send failures as well as AS2 message send failures

Parameters:
msg - the message indicating the send failure at an error handler

prepareAS2MessageForSend

SendInfo prepareAS2MessageForSend(Message msg,
                                  Partner partner)
Create an AS2 message using the current Message and its attachments, and sets the destination URL as of the selected partner. Next, send this message to a "default" endpoint to perform the actual send, and invoke the AS2Manager.processSyncResponse(org.adroitlogic.ultraesb.api.Message) in the outSequence of the proxy service to process the synchronous response (synchronous MDN and/or transport closure)

Parameters:
msg - the current Message containing the payload and attachments to send via AS2
partner - the destination partner
Returns:
information about the pending send operation

prepareAS2MessageForSend

SendInfo prepareAS2MessageForSend(Message msg,
                                  java.lang.String partnerID)
Create an AS2 message using the current Message and its attachments, and sets the destination URL as of the selected partner. Next, send this message to a "default" endpoint to perform the actual send, and invoke the AS2Manager.processSyncResponse(org.adroitlogic.ultraesb.api.Message) in the outSequence of the proxy service to process the synchronous response (synchronous MDN and/or transport closure)

Parameters:
msg - the current Message containing the payload and attachments to send via AS2
partnerID - the destination partner AS2 identifier if an PersistenceService is configured
Returns:
information about the pending send operation

processSyncResponse

SyncResponseInfo processSyncResponse(Message msg)
Routine to process the synchronous response received for a AS2 send operation (i.e. a synchronous MDN or transport ack or nack). Returns information from the received response after processing

Parameters:
msg - message containing raw HTTP/S level response
Returns:
Synchronous response information received - if any

processAsyncMDN

AsyncMDNInfo processAsyncMDN(Message msg)
Routine to process a new asynchronous MDN received for a message sent out by us, requesting an asynchronous MDN. Closes the transport appropriately and returns information about the processed async MDN. This should be called usually from a new Proxy service setup to process asynchronous MDN responses, and the public URL of this proxy service should be configured as the "asyncURLForMDN" of the AS2Manager implementation, or configured as the asynchronous MDN URL for the partner

Parameters:
msg - message containing raw HTTP/S level Async MDN message
Returns:
information about the MDN information received

Copyright (c) 2010-2012 AdroitLogic Private Ltd. All rights reserved.