Package com.helger.phase4.sender
Class AbstractAS4PullRequestBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>
java.lang.Object
com.helger.phase4.sender.AbstractAS4MessageBuilder<IMPLTYPE>
com.helger.phase4.sender.AbstractAS4PullRequestBuilder<IMPLTYPE>
- Type Parameters:
IMPLTYPE- The implementation type
- All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
- Direct Known Subclasses:
AS4Sender.BuilderPullRequest
@NotThreadSafe
public abstract class AbstractAS4PullRequestBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>
extends AbstractAS4MessageBuilder<IMPLTYPE>
Abstract builder base class for a Pull Request.
- Since:
- 0.12.0
- Author:
- Philip Helger
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IPModeprotected IAS4SignalMessageConsumerprotected IAS4SignalMessageValidationResultHandlerprotected IAS4UserMessageConsumerprotected Stringprotected Stringprotected StringFields 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 the following fields already set: -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidapplyToPullRequest(AS4ClientPullRequestMessage aPullRequestMsg) This method applies all builder parameters onto the Pull Request, except the attachments.final Stringfinal IMPLTYPEendpointURL(String sEndointURL) Set an receiver AS4 endpoint URL, independent of its usability.protected com.helger.commons.state.ESuccessInternal method that is invoked before the required field check is performed.booleanCheck if all mandatory fields are set.protected final voidSynchronously send the AS4 message.final Stringmpc()final IMPLTYPESet the MPC to be used in the Pull Request.final IPModepmode()final IMPLTYPESet the PMode to be used.final StringpmodeID()final IMPLTYPESet the optional PMode ID for packaging in the pull request.final IMPLTYPEsignalMsgConsumer(IAS4SignalMessageConsumer aSignalMsgConsumer) Set an optional Ebms3 Signal Message Consumer.final IMPLTYPEsignalMsgValidationResultHdl(IAS4SignalMessageValidationResultHandler aSignalMsgValidationResultHdl) Set an optional Ebms3 Signal Message validation result handler.final booleanuseLeg1()final IMPLTYPEuseLeg1(boolean bUseLeg1) Determine whether to use leg 1 or leg 2 of the PMode.final IAS4UserMessageConsumerfinal IMPLTYPEuserMsgConsumer(IAS4UserMessageConsumer aUserMsgConsumer) Set an optional Ebms3 User Message Consumer.Methods 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_aPMode
-
m_sPModeID
-
m_sMPC
-
m_sEndpointURL
-
m_aUserMsgConsumer
-
m_aSignalMsgConsumer
-
m_aSignalMsgValidationResultHdl
-
-
Constructor Details
-
AbstractAS4PullRequestBuilder
protected AbstractAS4PullRequestBuilder()Create a new builder, with the following fields already set:
-
-
Method Details
-
pmode
- Returns:
- The currently set P-Mode. May be
null.
-
pmode
Set the PMode to be used. By default a generic PMode is used.- Parameters:
aPMode- The PMode to be used. May benull.- Returns:
- this for chaining
-
pmodeID
- Returns:
- the current PMode ID. May be
null. - Since:
- 3.0.0
- See Also:
-
pmodeID
Set the optional PMode ID for packaging in the pull request.- Parameters:
s- PMode ID. May benull.- Returns:
- this for chaining
- Since:
- 3.0.0
-
useLeg1
public final boolean useLeg1()- Returns:
trueif PMode leg 1 is used,falseif leg 2 is used.- Since:
- 3.0.0
-
useLeg1
Determine whether to use leg 1 or leg 2 of the PMode.- Parameters:
bUseLeg1-trueto use leg 1,falseto use leg 2.- Returns:
- this for chaining
- Since:
- 2.7.8
-
mpc
- Returns:
- The currently set MPC. May be
null. - Since:
- 3.0.0
-
mpc
Set the MPC to be used in the Pull Request.- Parameters:
sMPC- The MPC to use. May benull.- Returns:
- this for chaining
-
endpointURL
- Returns:
- The receiver AS4 endpoint URL currently set. May be
null. - Since:
- 3.0.0
-
endpointURL
Set an receiver AS4 endpoint URL, independent of its usability.- Parameters:
sEndointURL- The endpoint URL to be used. May benull.- Returns:
- this for chaining
-
userMsgConsumer
- Returns:
- The optional Ebms3 User Message Consumer. May be
null. - Since:
- 3.0.0
-
userMsgConsumer
Set an optional Ebms3 User Message Consumer. This method is optional and must not be called prior to sending.- Parameters:
aUserMsgConsumer- The optional User Message consumer. May benull.- Returns:
- this for chaining
-
signalMsgConsumer
- Returns:
- The optional Ebms3 Signal Message Consumer. May be
null. - Since:
- 3.0.0
-
signalMsgConsumer
@Nonnull public final IMPLTYPE signalMsgConsumer(@Nullable IAS4SignalMessageConsumer aSignalMsgConsumer) Set an optional Ebms3 Signal Message Consumer. If this consumer is set, the response is trying to be parsed as a Signal Message. This method is optional and must not be called prior to sending.- Parameters:
aSignalMsgConsumer- The optional signal message consumer. May benull.- Returns:
- this for chaining
-
signalMsgValidationResultHdl
- Returns:
- The optional Ebms3 Signal Message validation result handled. May be
null. - Since:
- 3.0.1
-
signalMsgValidationResultHdl
@Nonnull public final IMPLTYPE signalMsgValidationResultHdl(@Nullable IAS4SignalMessageValidationResultHandler aSignalMsgValidationResultHdl) Set an optional Ebms3 Signal Message validation result handler. This handler is invoked, after the synchronous signal message references were evaluated. This handler cannot modify any message flow - it is an informational callback only.- Parameters:
aSignalMsgValidationResultHdl- The optional signal message consumer. May benull.- Returns:
- this for chaining
- Since:
- 3.0.1
-
finishFields
@Nonnull @OverridingMethodsMustInvokeSuper protected com.helger.commons.state.ESuccess finishFields() throws Phase4ExceptionDescription copied from class:AbstractAS4MessageBuilderInternal method that is invoked before the required field check is performed. Override to set additional dynamically created fields if necessary.
Don't add message properties in here, because if the required fields check fails than this method would be called again.
This is called beforeAbstractAS4MessageBuilder.isEveryRequiredFieldSet()- Overrides:
finishFieldsin classAbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>- Returns:
ESuccess- nevernull. Returning failure here stops sending the message.- Throws:
Phase4Exception- if something goes wrong
-
isEveryRequiredFieldSet
Description copied from class:AbstractAS4MessageBuilderCheck if all mandatory fields are set. This method is called afterAbstractAS4MessageBuilder.finishFields()and beforeAbstractAS4MessageBuilder.customizeBeforeSending()- Overrides:
isEveryRequiredFieldSetin classAbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>- Returns:
trueif all mandatory fields are set, and sending can continue.
-
applyToPullRequest
This method applies all builder parameters onto the Pull Request, except the attachments.- Parameters:
aPullRequestMsg- The Pull request the parameters should be applied to. May not benull.
-
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 AbstractAS4PullRequestBuilder<IMPLTYPE>>- Throws:
Phase4Exception- In case of any error
-