Package eu.domibus.connector.client
Interface DomibusConnectorClientMessageBuilder
-
public interface DomibusConnectorClientMessageBuilder
This interface is implemented by default. The implementation offers helper methods to create build theDomibusConnectorMessageType
.- Author:
- Bernhard Rieder
-
-
Method Summary
-
-
-
Method Detail
-
createNewMessage
DomibusConnectorMessageType createNewMessage(String backendMessageId, String ebmsMessageId, String conversationId, String businessService, String businessServiceType, String businessAction, String fromPartyId, String fromPartyIdType, String fromPartyRole, String toPartyId, String toPartyIdType, String toPartyRole, String finalRecipient, String originalSender)
This method creates a newDomibusConnectorMessageType
, adds theDomibusConnectorMessageDetailsType
and fills its attributes.- Parameters:
backendMessageId
- - The messageId as referenced on the backend sideebmsMessageId
- - The EBMS message id if given by the backend. May be null. Will be generated on eCodex level if null! If given by the backend, the id must be a worldwide unique one (for example by being generated using UUID).conversationId
- - The conversation id if given by the backend. May be null. Will be generated on eCodex level if null! If given by the backend, the id must be a worldwide unique one (for example by being generated using UUID).businessService
- - The business service this message is part of. Must be defined by the use case (PModes).businessServiceType
- - The business service type this message is part of. Must be defined by the use case (PModes).businessAction
- - The business action this message is part of. Must be defined by the use case (PModes).fromPartyId
- - The ID of the Party this message was sent from. May be null. Will be set by the connector, if properly configured.fromPartyIdType
- - The ID type of the Party this message was sent from. May be null. Will be set by the connector, if properly configured.fromPartyRole
- - The role of the Party this message should was sent from. May be null. Will be set by the connector, if properly configured.toPartyId
- - The ID of the Party this message should be sent to. Must be defined by the use case (PModes).toPartyIdType
- - The ID type of the Party this message should be sent to. Must be defined by the use case (PModes).toPartyRole
- - The role of the Party this message should be sent to. May be null. Will be set by the connector, if properly configured.finalRecipient
- - The electronic identifier of the final recipient of the message.originalSender
- - The electronic identifier of the original sender of the message.- Returns:
- A new message object with a
DomibusConnectorMessageDetailsType
added.
-
addBusinessContentXMLAsBinary
DomibusConnectorMessageType addBusinessContentXMLAsBinary(DomibusConnectorMessageType message, byte[] businessContent)
Adds a business content XML to theDomibusConnectorMessageType
. The message object needs to be instantiated first via the methodcreateNewMessage(String, String, String, String, String, String, String, String, String, String, String, String, String, String)
.- Parameters:
message
- - the message objectbusinessContent
- - the business content XML as bytes.- Returns:
- The message object with a
DomibusConnectorMessageContentType
added
-
addBusinessContentXMLAsStream
DomibusConnectorMessageType addBusinessContentXMLAsStream(DomibusConnectorMessageType message, Source businessContent)
Adds a business content XML to theDomibusConnectorMessageType
. The message object needs to be instantiated first via the methodcreateNewMessage(String, String, String, String, String, String, String, String, String, String, String, String, String, String)
.- Parameters:
message
- - the message objectbusinessContent
- - the business content XML as stream object.- Returns:
- The message object with a
DomibusConnectorMessageContentType
added
-
addBusinessDocumentAsBinary
DomibusConnectorMessageType addBusinessDocumentAsBinary(DomibusConnectorMessageType message, byte[] businessDocument, String businessDocumentName)
Adds the business document to theDomibusConnectorMessageType
. The message object needs to be instantiated first and a businessContent needs to be added via the methodaddBusinessContentXMLAsBinary(DomibusConnectorMessageType, byte[])
oraddBusinessContentXMLAsStream(DomibusConnectorMessageType, Source)
.- Parameters:
message
- - the message objectbusinessDocument
- - the business document as bytes.businessDocumentName
- - the name of the business document.- Returns:
- The message object with a
DomibusConnectorMessageDocumentType
added to itsDomibusConnectorMessageContentType
.
-
addBusinessDocumentAsStream
DomibusConnectorMessageType addBusinessDocumentAsStream(DomibusConnectorMessageType message, DataHandler businessDocument, String businessDocumentName)
Adds the business document to theDomibusConnectorMessageType
. The message object needs to be instantiated first and a businessContent needs to be added via the methodaddBusinessContentXMLAsBinary(DomibusConnectorMessageType, byte[])
oraddBusinessContentXMLAsStream(DomibusConnectorMessageType, Source)
.- Parameters:
message
- - the message objectbusinessDocument
- - the business document as stream object.businessDocumentName
- - the name of the business document.- Returns:
- The message object with a
DomibusConnectorMessageDocumentType
added to itsDomibusConnectorMessageContentType
.
-
addDetachedSignatureForBusinessDocument
DomibusConnectorMessageType addDetachedSignatureForBusinessDocument(DomibusConnectorMessageType message, byte[] detachedSignature, String detachedSignatureName, DomibusConnectorDetachedSignatureMimeType detachedSignatureType)
Generates and adds aDomibusConnectorDetachedSignatureType
to theDomibusConnectorMessageDocumentType
. A detached signature may be given to validate this signature on the business document. The validation happens in the domibusConnector.- Parameters:
message
- - the message objectdetachedSignature
- - the detached signature itself as bytes.detachedSignatureName
- - the name for this detached signature.detachedSignatureType
- - the mime type of the detached signature.- Returns:
- The message object with a
DomibusConnectorDetachedSignatureType
added to itsDomibusConnectorMessageDocumentType
.
-
addBusinessAttachmentAsBinaryToMessage
DomibusConnectorMessageType addBusinessAttachmentAsBinaryToMessage(DomibusConnectorMessageType message, String businessAttachmentIdentifier, byte[] businessAttachment, String businessAttachmentName, String businessAttachmentMimeType, String businessAttachmentDescription)
Generates and adds aDomibusConnectorMessageAttachmentType
to theDomibusConnectorMessageType
.- Parameters:
message
- - the message objectbusinessAttachmentIdentifier
- - The identifier of the given business attachment.businessAttachment
- - The business attachment as bytes.businessAttachmentName
- - The name of the business attachment.businessAttachmentMimeType
- - the mime type of the business attachmentbusinessAttachmentDescription
- - The description of the given business attachment.- Returns:
- The message object with a
DomibusConnectorMessageAttachmentType
added
-
addBusinessAttachmentAsStreamToMessage
DomibusConnectorMessageType addBusinessAttachmentAsStreamToMessage(DomibusConnectorMessageType message, String businessAttachmentIdentifier, DataHandler businessAttachment, String businessAttachmentName, String businessAttachmentMimeType, String businessAttachmentDescription)
Generates and adds aDomibusConnectorMessageAttachmentType
to theDomibusConnectorMessageType
.- Parameters:
message
- - the message objectbusinessAttachmentIdentifier
- - The identifier of the given business attachment.businessAttachment
- - The business attachment as stream object.businessAttachmentName
- - The name of the business attachment.businessAttachmentMimeType
- - the mime type of the business attachmentbusinessAttachmentDescription
- - The description of the given business attachment.- Returns:
- The message object with a
DomibusConnectorMessageAttachmentType
added
-
createNewConfirmationMessage
DomibusConnectorMessageType createNewConfirmationMessage(String ebmsMessageId, String conversationId, DomibusConnectorServiceType businessService, String businessAction, DomibusConnectorPartyType fromParty, DomibusConnectorPartyType toParty, String finalRecipient, String originalSender, DomibusConnectorConfirmationType confirmationType)
Creates a newDomibusConnectorMessageType
and adds theDomibusConnectorMessageDetailsType
. Also creates aDomibusConnectorMessageConfirmationType
, sets the confirmationType and adds it to the message. The confirmation itself will be generated by the domibusConnector. All additional parameters required for the message will also be set by the domibusConnector.- Parameters:
ebmsMessageId
- - The EBMS message id of the message this confirmationMessage refers to. Will be set as refToMessageId.conversationId
- - The conversation of the message this confirmationMessage refers to.businessService
- - TheDomibusConnectorServiceType
of the message this confirmationMessage refers to.businessAction
- - The business action representing the confirmationType of this confirmationMessage. Must be defined by the use case (PModes).fromParty
- - TheDomibusConnectorPartyType
of the receiving Party (toParty) of the message this confirmationMessage refers to.toParty
- - TheDomibusConnectorPartyType
of the sending Party (fromParty) of the message this confirmationMessage refers to.finalRecipient
- - The electronic identifier of the original sender of the message this confirmationMessage refers to.originalSender
- - The electronic identifier of the final recipient of the message this confirmationMessage refers to.confirmationType
- - The type of confirmation.- Returns:
- A new message object with a
DomibusConnectorMessageDetailsType
andDomibusConnectorMessageConfirmationType
added.
-
-