
PublicAPIAccess
The AckFactory provides methods for generating acknowledgment messages.
Methods of the Interface AckFactory
| Name | Use |
|---|---|
|
ackNotSupported |
The adapter must specify for each message which acknowledgment types it does not support. In the example adapter, these are the application acknowledgment types. This method must not be called until the end of message processing once it is certain that no further exceptions will arise because then the Adapter Framework sends error delivery acknowledgments automatically. Note
Open CCIInteraction.java and search for the character string CS_ACKNS. |
|
deliveryAck |
The delivery acknowledgment displays whether a message has been successfully delivered to the message layer in the last node (the end point) in the communication chain. In the example adapter, this is assumed to be the case once the file has been written to the file system with the message. Note
Open CCIInteraction.java and search for the character string CS_ACKDEL. |
|
deliveryErrorAck |
If a message cannot be delivered to the end point and the adapter can recognize this status using the connected external protocol, it can send an asynchronous error delivery acknowledgment. If a Java exception is triggered during message processing, the Adapter Framework automatically sends an error delivery acknowledgment (if requested by XI) with an error text taken from the exception. In this case, the adapter must not call deliveryErrorAck() explicitly. Therefore, the error delivery acknowledgment is not set explicitly in the example adapter. |
|
applicationAck |
The application acknowledgment displays whether a message has been successfully processed by the application at the end point. Since the example adapter cannot recognize this, it does not support this type and declares this using the ackNotSupported method. |
|
applicationErrorAck |
The same as for application acknowledgment, but for the error case. |
To instantiate an AckFactory object, proceed in the same way as for MessageFactory. This is demonstrated in the example adapter in the XIMessageFactoryImpl class.
Open XIMessageFactoryImpl.java and search for the character string CS_MSGFCT.
API Methods
An adapter can use the following API methods to recognize an acknowledgment:
For more information, see the JavaDoc.
Message Direction in Acknowledgment Message
In the adapter implementation, the message direction in the key of the acknowledgment message must be the same as the message direction in the message that the acknowledgment message refers to.
Follow the implementation template for the example adapter:
MessageKey msgKey = msg.getMessageKey();
mf.deliveryAck(msgKey);
MessageKey msgKey = msg.getMessageKey();
MessageKey ackMsgKey = new MessageKey(msgKey.getMessageId(), MessageDirection.INBOUND);
MessageDirection