AdroitLogic UltraESB v1.7.0

org.adroitlogic.as2.manager
Class AS2Manager

java.lang.Object
  extended by org.adroitlogic.as2.manager.AS2Manager
All Implemented Interfaces:
AS2Manager

public class AS2Manager
extends java.lang.Object
implements AS2Manager

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

Refer to samples # 350 and # 351 for sample configuration and use


Constructor Summary
AS2Manager(java.lang.String userAgentName, java.lang.String as2Identifier, java.lang.String emailAddress, KeystoreManager ksManager, FileCache fileCache)
          Create the AS2Manager instance without any persistence
AS2Manager(java.lang.String userAgentName, java.lang.String as2Identifier, java.lang.String emailAddress, KeystoreManager ksManager, FileCache fileCache, PersistenceService pService)
          Create the AS2Manager instance
 
Method Summary
 SendInfo prepareAS2MessageForSend(Message msg, Partner partner)
          Create an AS2 message using the current Message and its attachments, to be sent to the specified 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 of the partner.
 void prepareAsyncMDNForSend(Message asyncMdn, ReceiveInfo rcvInfo)
          Prepare the async MDN message to be sent by populating the payload (i.e.
 AsyncMDNInfo processAsyncMDN(Message msg)
          Routine to process a new Async MDN received
 void processAsyncMDNSendResult(Message msg)
          Notify the outcome of the async MDN send operation
 ReceiveInfo processIncomingAS2Message(Message msg)
          Routine to process a new AS2 message received over HTTP/S, and parse it and take necessary AS2 protocol level action on it, and populate the current message with the attachments for subsequent processing
 SyncResponseInfo processSyncResponse(Message msg)
          Routine to process sync response received (sync MDN or transport ack or nack)
 void recordSendFailure(Message msg)
          Record AS2 message send as failed
 void setAsyncURLForMDN(java.lang.String asyncURLForMDN)
          Set the URL for asynchronous MDNs - should be the externally visible URL (default http://localhost:8280/service/AS2Receiver)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AS2Manager

public AS2Manager(java.lang.String userAgentName,
                  java.lang.String as2Identifier,
                  java.lang.String emailAddress,
                  KeystoreManager ksManager,
                  FileCache fileCache,
                  PersistenceService pService)
Create the AS2Manager instance

Parameters:
userAgentName - the User agent name to assign
as2Identifier - the local AS2 identifier
emailAddress - the local email address
ksManager - the reference to the KeystoreManager
fileCache - the reference to the FileCache
pService - persisitence service to be used

AS2Manager

public AS2Manager(java.lang.String userAgentName,
                  java.lang.String as2Identifier,
                  java.lang.String emailAddress,
                  KeystoreManager ksManager,
                  FileCache fileCache)
Create the AS2Manager instance without any persistence

Parameters:
userAgentName - the User agent name to assign
as2Identifier - the local AS2 identifier
emailAddress - the local email address
ksManager - the reference to the KeystoreManager
fileCache - the reference to the FileCache
Method Detail

processIncomingAS2Message

public ReceiveInfo processIncomingAS2Message(Message msg)
Routine to process a new AS2 message received over HTTP/S, and parse it and take necessary AS2 protocol level action on it, and populate the current message with the attachments for subsequent processing

Specified by:
processIncomingAS2Message in interface AS2Manager
Parameters:
msg - message containing raw HTTP/S level AS2 message
Returns:
receive information

prepareAS2MessageForSend

public SendInfo prepareAS2MessageForSend(Message msg,
                                         java.lang.String partnerID)
Create an AS2 message using the current Message and its attachments, and sets the destination URL of the partner. Send this message to a "DEFAULT" endpoint to perform the actual send and invoke the "processSyncResponse" in the outSequence of the proxy service to process the synchronous response

Specified by:
prepareAS2MessageForSend in interface AS2Manager
Parameters:
msg - the current Message
partnerID - the AS2 identifier of the destination partner, when a PersistenceService is provided
Returns:
send information

prepareAS2MessageForSend

public SendInfo prepareAS2MessageForSend(Message msg,
                                         Partner partner)
Create an AS2 message using the current Message and its attachments, to be sent to the specified Partner

Specified by:
prepareAS2MessageForSend in interface AS2Manager
Parameters:
msg - the current Message
partner - the destination partner
Returns:
send information
Throws:
ProcessingException - on errors encountered in message preparation

prepareAsyncMDNForSend

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

Specified by:
prepareAsyncMDNForSend in interface AS2Manager
Parameters:
asyncMdn - the message to be populated with the async MDN information
rcvInfo - the AS2 receive information bean containing the information for the async MDN creation

processAsyncMDNSendResult

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

Specified by:
processAsyncMDNSendResult in interface AS2Manager
Parameters:
msg - the response message received or the failed message (for an error handler)

recordSendFailure

public void recordSendFailure(Message msg)
Record AS2 message send as failed

Specified by:
recordSendFailure in interface AS2Manager
Parameters:
msg - the response message received or the failed message (for an error handler)

processAsyncMDN

public AsyncMDNInfo processAsyncMDN(Message msg)
Routine to process a new Async MDN received

Specified by:
processAsyncMDN in interface AS2Manager
Parameters:
msg - message containing raw HTTP/S level Async MDN message
Returns:
MDN information received

processSyncResponse

public SyncResponseInfo processSyncResponse(Message msg)
Routine to process sync response received (sync MDN or transport ack or nack)

Specified by:
processSyncResponse in interface AS2Manager
Parameters:
msg - message containing raw HTTP/S level response
Returns:
MDN information received - if any

setAsyncURLForMDN

public void setAsyncURLForMDN(java.lang.String asyncURLForMDN)
Set the URL for asynchronous MDNs - should be the externally visible URL (default http://localhost:8280/service/AS2Receiver)

Parameters:
asyncURLForMDN - the externally visible URL for asynchronous MDNs to be used by Partners

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