Package eu.domibus.connector.client
Interface DomibusConnectorClient
-
public interface DomibusConnectorClient
This is the interface containing methods to be implemented when the domibusConnectorClientLibrary is used. It is the main link between the domibusConnectorClientWSLink and the domibusConnectorClientBackend.- Author:
- Bernhard Rieder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
acknowledgeMessage(String messageTransportId, boolean result, String backendMessageId)
Method to acknowledge received messages via therequestNewMessagesFromConnector(Integer, boolean)
method if not acknowledged automatically.DomibusConnectorMessagesType
requestNewMessagesFromConnector()
Deprecated.Since this method is a single hit call that requests all messages pending at the domibusConnector.Map<String,DomibusConnectorMessageType>
requestNewMessagesFromConnector(Integer maxFetchCount, boolean acknowledgeAutomatically)
ReplacesrequestNewMessagesFromConnector()
Allows to limit the number of messages that are to be received at one call and also to either self-acknowledge messages to the domibusConnector, or do that in a seperate, asynchronous call viaacknowledgeMessage(String, boolean, String)
.void
submitNewMessageToConnector(DomibusConnectorMessageType message)
This message submits a new message from the client to the connector.void
triggerConfirmationForMessage(DomibusConnectorMessageType confirmationMessage)
Triggers the submission of a message confirmation at the domibusConnector.
-
-
-
Method Detail
-
submitNewMessageToConnector
void submitNewMessageToConnector(DomibusConnectorMessageType message) throws DomibusConnectorClientException
This message submits a new message from the client to the connector. Before submitted, theDomibusConnectorClientMessageHandler
is called.- Parameters:
message
- - TheDomibusConnectorMessageType
object containing the message information. May be built using theDomibusConnectorClientMessageBuilder
.- Throws:
DomibusConnectorClientException
- if the submission fails. Wrapped exception typeDCCConnectorAcknowledgementException
if the message was rejected by the connector or result from connector not available. Wrapped exception typeDomibusConnectorBackendWebServiceClientException
if the message could not be submitted to the connector.
-
requestNewMessagesFromConnector
@Deprecated DomibusConnectorMessagesType requestNewMessagesFromConnector() throws DomibusConnectorClientException
Deprecated.Since this method is a single hit call that requests all messages pending at the domibusConnector. Also, messages received via this method do not need acknowledgement and are therefore deleted permanently from the domibusConnector. UserequestNewMessagesFromConnector(Integer, boolean)
instead.Requests all new messages that are provided by the domibusConnector's backend. Before delivered, theDomibusConnectorClientMessageHandler
is called for each message received.- Returns:
- The
DomibusConnectorMessagesType
containing the new messages. - Throws:
DomibusConnectorClientException
- if the fetching of new messages from the connector fails
-
triggerConfirmationForMessage
void triggerConfirmationForMessage(DomibusConnectorMessageType confirmationMessage) throws DomibusConnectorClientException
Triggers the submission of a message confirmation at the domibusConnector.- Parameters:
confirmationMessage
- - The message that contains the details and confirmationType that should be submitted. Can be generated at the backend side using theDomibusConnectorClientMessageBuilder
.- Throws:
DomibusConnectorClientException
- if the triggering of the confirmation fails
-
requestNewMessagesFromConnector
Map<String,DomibusConnectorMessageType> requestNewMessagesFromConnector(Integer maxFetchCount, boolean acknowledgeAutomatically) throws DomibusConnectorClientException
ReplacesrequestNewMessagesFromConnector()
Allows to limit the number of messages that are to be received at one call and also to either self-acknowledge messages to the domibusConnector, or do that in a seperate, asynchronous call viaacknowledgeMessage(String, boolean, String)
.- Parameters:
maxFetchCount
- The number of messages to be received in one call. If there are more than that messages pending at the domibusConnector, the other messages exceeding this limit will be received with the next call. If null, all messages will be requested at once.acknowledgeAutomatically
- If true, the domibusConnector immediately acknowledges messages received to the domibusConnector. The messages acknowledged are then finished by the domibusConnector and cannot be sent again to the backend client. If false, messages have to be acknowledged manually by calling theacknowledgeMessage(String, boolean, String)
method.- Returns:
- a Map where the key is the messageTransportId required to acknowledge the message in a second step. The value is the message itself.
- Throws:
DomibusConnectorClientException
-
acknowledgeMessage
void acknowledgeMessage(String messageTransportId, boolean result, String backendMessageId)
Method to acknowledge received messages via therequestNewMessagesFromConnector(Integer, boolean)
method if not acknowledged automatically.- Parameters:
messageTransportId
- The key of the Map.Entry to the message returned fromrequestNewMessagesFromConnector(Integer, boolean)
result
- If true, the message will be treated as finished successfully by the domibusConnector. If false, the domibusConnector treats the message as failed.backendMessageId
- The message ID which the business message has been given by the backend.
-
-