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
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
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)
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
Modifier and Type | Method and Description |
---|---|
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
|
ReceiveInfo processIncomingAS2Message(Message msg)
msg
- message containing raw HTTP/S level AS2 messagevoid prepareAsyncMDNForSend(Message asyncMdn, ReceiveInfo rcvInfo)
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 MDNvoid processAsyncMDNSendResult(Message msg)
msg
- the response message received for an asynchronous MDN reply sentvoid recordSendFailure(Message msg)
msg
- the message indicating the send failure at an error handlerSendInfo prepareAS2MessageForSend(Message msg, Partner partner)
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)msg
- the current Message containing the payload and attachments to send via AS2partner
- the destination partnerSendInfo prepareAS2MessageForSend(Message msg, java.lang.String partnerID)
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)msg
- the current Message containing the payload and attachments to send via AS2partnerID
- the destination partner AS2 identifier if an PersistenceService
is configuredSyncResponseInfo processSyncResponse(Message msg)
msg
- message containing raw HTTP/S level responseAsyncMDNInfo processAsyncMDN(Message msg)
msg
- message containing raw HTTP/S level Async MDN message