Package com.helger.phase4.sender
Class AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE extends AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE>>
java.lang.Object
com.helger.phase4.sender.AbstractAS4MessageBuilder<IMPLTYPE>
com.helger.phase4.sender.AbstractAS4UserMessageBuilder<IMPLTYPE>
com.helger.phase4.sender.AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE>
- Type Parameters:
IMPLTYPE- The implementation type
- All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
- Direct Known Subclasses:
AS4Sender.BuilderUserMessage
@NotThreadSafe
public abstract class AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE extends AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE>>
extends AbstractAS4UserMessageBuilder<IMPLTYPE>
Abstract builder base class for a user messages that puts also the main
payload in a single MIME part and NOT in the SOAP body.
- Since:
- 0.10.0
- Author:
- Philip Helger
-
Field Summary
FieldsFields inherited from class com.helger.phase4.sender.AbstractAS4UserMessageBuilder
m_aAttachments, m_aMessageProperties, m_aPMode, m_aSignalMsgConsumer, m_aSignalMsgValidationResultHdl, m_bForceMimeMessage, m_sAction, m_sAgreementRef, m_sAgreementType, m_sConversationID, m_sEndpointURL, m_sFromPartyID, m_sFromPartyIDType, m_sFromRole, m_sPModeID, m_sService, m_sServiceType, m_sToPartyID, m_sToPartyIDType, m_sToRoleFields inherited from class com.helger.phase4.sender.AbstractAS4MessageBuilder
DEFAULT_LOCALE, m_aBuildMessageCallback, m_aCryptoFactoryCrypt, m_aCryptoFactorySign, m_aCryptParams, m_aCustomHttpPoster, m_aDecryptParameterModifier, m_aHttpClientFactory, m_aHttpRetrySettings, m_aIncomingDumper, m_aLocale, m_aOutgoingDumper, m_aResponseConsumer, m_aRetryCallback, m_aSendingDateTime, m_aSendingDTConsumer, m_aSigningParams, m_eSoapVersion, m_sAS4ProfileID, m_sMessageID, m_sRefToMessageID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new builder, with some fields already set as outlined inAbstractAS4UserMessageBuilder() -
Method Summary
Modifier and TypeMethodDescriptionprotected WSS4JAttachmentcreateMainAttachment(AS4OutgoingAttachment aPayload, AS4ResourceHelper aResHelper) Create the main attachment.protected WSS4JAttachmentcreateOtherAttachment(AS4OutgoingAttachment aPayload, AS4ResourceHelper aResHelper, int nAttachmentIndex) Create another attachment that is not "main".booleanCheck if all mandatory fields are set.protected final voidSynchronously send the AS4 message.final AS4OutgoingAttachmentpayload()Get the payload to be send out.final IMPLTYPEpayload(AS4OutgoingAttachment aPayload) Set the payload to be send out.final IMPLTYPEpayload(AS4OutgoingAttachment.Builder aBuilder) Set the payload to be send out.Methods inherited from class com.helger.phase4.sender.AbstractAS4UserMessageBuilder
action, action, addAttachment, addAttachment, addMessageProperty, addMessageProperty, addMessageProperty, agreementRef, agreementRef, agreementType, agreementType, applyToUserMessage, attachment, attachment, attachments, attachments, attachments, conversationID, conversationID, endpointURL, endpointURL, finishFields, forceMimeMessage, forceMimeMessage, fromPartyID, fromPartyID, fromPartyIDType, fromPartyIDType, fromRole, fromRole, getAllAttachments, getAllMessageProperties, messageProperties, messageProperties, messageProperties, messageProperty, messageProperty, messageProperty, pmode, pmode, pmodeID, pmodeID, receiverCertificate, receiverCertificateAlias, sendMessageAndCheckForReceipt, sendMessageAndCheckForReceipt, service, service, service, serviceType, signalMsgConsumer, signalMsgConsumer, signalMsgValidationResultHdl, signalMsgValidationResultHdl, toPartyID, toPartyID, toPartyIDType, toPartyIDType, toRole, toRoleMethods inherited from class com.helger.phase4.sender.AbstractAS4MessageBuilder
afterSuccessfulSending, as4ProfileID, as4ProfileID, buildMessageCallback, buildMessageCallback, cryptoFactory, cryptoFactoryCrypt, cryptoFactoryCrypt, cryptoFactorySign, cryptoFactorySign, cryptParams, customHttpPoster, customHttpPoster, customizeBeforeSending, decryptRequestDataModifier, decryptRequestDataModifier, httpClientFactory, httpClientFactory, httpClientFactory, httpRetrySettings, httpRetrySettings, incomingAttachmentFactory, incomingAttachmentFactory, incomingDumper, incomingDumper, incomingProfileSelector, incomingProfileSelector, locale, locale, messageID, messageID, outgoingDumper, outgoingDumper, pmodeResolver, pmodeResolver, rawResponseConsumer, rawResponseConsumer, refToMessageID, refToMessageID, retryCallback, retryCallback, senderInterrupt, senderInterrupt, sendingDateTime, sendingDateTime, sendingDateTimeConsumer, sendingDateTimeConsumer, sendMessage, signingParams, soapVersion, soapVersion, withCryptParams, withSigningParamsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsT
-
Field Details
-
m_aPayload
-
-
Constructor Details
-
AbstractAS4UserMessageBuilderMIMEPayload
protected AbstractAS4UserMessageBuilderMIMEPayload()Create a new builder, with some fields already set as outlined inAbstractAS4UserMessageBuilder()
-
-
Method Details
-
payload
Get the payload to be send out.- Returns:
- The currently set outgoing attachment payload. May be
null. - Since:
- 2.5.0
-
payload
Set the payload to be send out. The payload is translated into the first attachment to the user message.- Parameters:
aBuilder- The payload builder to be used. May benull.- Returns:
- this for chaining
-
payload
Set the payload to be send out.- Parameters:
aPayload- The payload to be used. May benull.- Returns:
- this for chaining
-
isEveryRequiredFieldSet
Description copied from class:AbstractAS4MessageBuilderCheck if all mandatory fields are set. This method is called afterAbstractAS4MessageBuilder.finishFields()and beforeAbstractAS4MessageBuilder.customizeBeforeSending()- Overrides:
isEveryRequiredFieldSetin classAbstractAS4UserMessageBuilder<IMPLTYPE extends AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE>>- Returns:
trueif all mandatory fields are set, and sending can continue.
-
createMainAttachment
@Nullable @OverrideOnDemand protected WSS4JAttachment createMainAttachment(@Nonnull AS4OutgoingAttachment aPayload, @Nonnull AS4ResourceHelper aResHelper) throws IOException Create the main attachment. This is mainly intended for ENTSOG/BDEW to add some custom properties.- Parameters:
aPayload- The outgoing main attachment as provided to the builder. Nevernull.saResHelper- The resource helper to use for temporary files etc. Nevernull.- Returns:
- May be
nullto indicate not to use the main payload - Throws:
IOException- in case of error- Since:
- 2.2.2
-
createOtherAttachment
@Nullable @OverrideOnDemand protected WSS4JAttachment createOtherAttachment(@Nonnull AS4OutgoingAttachment aPayload, @Nonnull AS4ResourceHelper aResHelper, @Nonnegative int nAttachmentIndex) throws IOException Create another attachment that is not "main". This is mainly intended for ENTSOG to add some custom properties.- Parameters:
aPayload- The outgoing main attachment as provided to the builder. Nevernull.saResHelper- The resource helper to use for temporary files etc. Nevernull.nAttachmentIndex- 0-based attachment index. Always ≥ 0.- Returns:
- May be
nullto indicate not to use the payload - Throws:
IOException- in case of error- Since:
- 2.4.0
-
mainSendMessage
Description copied from class:AbstractAS4MessageBuilderSynchronously send the AS4 message. This method is called afterAbstractAS4MessageBuilder.customizeBeforeSending(). This method may only be called byAbstractAS4MessageBuilder.sendMessage().- Specified by:
mainSendMessagein classAbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4UserMessageBuilderMIMEPayload<IMPLTYPE>>- Throws:
Phase4Exception- In case of any error
-