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.base.trait.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 Details

  • Constructor Details

    • AbstractAS4PullRequestBuilder

      protected AbstractAS4PullRequestBuilder()
      Create a new builder, with the following fields already set:
  • Method Details

    • pmode

      @Nullable public final IPMode pmode()
      Returns:
      The currently set P-Mode. May be null.
    • pmode

      @Nonnull public final IMPLTYPE pmode(@Nullable IPMode aPMode)
      Set the PMode to be used. By default a generic PMode is used.
      Parameters:
      aPMode - The PMode to be used. May be null.
      Returns:
      this for chaining
    • pmodeID

      @Nullable public final String pmodeID()
      Returns:
      the current PMode ID. May be null.
      Since:
      3.0.0
      See Also:
    • pmodeID

      @Nonnull public final IMPLTYPE pmodeID(@Nullable String s)
      Set the optional PMode ID for packaging in the pull request.
      Parameters:
      s - PMode ID. May be null.
      Returns:
      this for chaining
      Since:
      3.0.0
    • useLeg1

      public final boolean useLeg1()
      Returns:
      true if PMode leg 1 is used, false if leg 2 is used.
      Since:
      3.0.0
    • useLeg1

      @Nonnull public final IMPLTYPE useLeg1(boolean bUseLeg1)
      Determine whether to use leg 1 or leg 2 of the PMode.
      Parameters:
      bUseLeg1 - true to use leg 1, false to use leg 2.
      Returns:
      this for chaining
      Since:
      2.7.8
    • mpc

      @Nullable public final String mpc()
      Returns:
      The currently set MPC. May be null.
      Since:
      3.0.0
    • mpc

      @Nonnull public final IMPLTYPE mpc(@Nullable String sMPC)
      Set the MPC to be used in the Pull Request.
      Parameters:
      sMPC - The MPC to use. May be null.
      Returns:
      this for chaining
    • endpointURL

      @Nullable public final String endpointURL()
      Returns:
      The receiver AS4 endpoint URL currently set. May be null.
      Since:
      3.0.0
    • endpointURL

      @Nonnull public final IMPLTYPE endpointURL(@Nullable String sEndointURL)
      Set an receiver AS4 endpoint URL, independent of its usability.
      Parameters:
      sEndointURL - The endpoint URL to be used. May be null.
      Returns:
      this for chaining
    • userMsgConsumer

      @Nullable public final IAS4UserMessageConsumer userMsgConsumer()
      Returns:
      The optional Ebms3 User Message Consumer. May be null.
      Since:
      3.0.0
    • userMsgConsumer

      @Nonnull public final IMPLTYPE userMsgConsumer(@Nullable IAS4UserMessageConsumer aUserMsgConsumer)
      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 be null.
      Returns:
      this for chaining
    • signalMsgConsumer

      @Nullable public final IAS4SignalMessageConsumer 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 be null.
      Returns:
      this for chaining
    • signalMsgValidationResultHdl

      @Nullable public final IAS4SignalMessageValidationResultHandler 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 be null.
      Returns:
      this for chaining
      Since:
      3.0.1
    • finishFields

      @Nonnull @OverridingMethodsMustInvokeSuper protected com.helger.base.state.ESuccess finishFields(@Nonnull AS4ResourceHelper aResHelper) throws Phase4Exception
      Description copied from class: AbstractAS4MessageBuilder
      Internal 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 before AbstractAS4MessageBuilder.isEveryRequiredFieldSet()
      Overrides:
      finishFields in class AbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>
      Parameters:
      aResHelper - The AS4 resource helper to use. Never null.
      Returns:
      ESuccess - never null. Returning failure here stops sending the message.
      Throws:
      Phase4Exception - if something goes wrong
    • isEveryRequiredFieldSet

      @OverridingMethodsMustInvokeSuper public boolean isEveryRequiredFieldSet()
      Description copied from class: AbstractAS4MessageBuilder
      Check if all mandatory fields are set. This method is called after AbstractAS4MessageBuilder.finishFields(AS4ResourceHelper) and before AbstractAS4MessageBuilder.customizeBeforeSending()
      Overrides:
      isEveryRequiredFieldSet in class AbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>
      Returns:
      true if all mandatory fields are set, and sending can continue.
    • applyToPullRequest

      protected final void applyToPullRequest(@Nonnull AS4ClientPullRequestMessage aPullRequestMsg)
      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 be null.
    • mainSendMessage

      protected final void mainSendMessage() throws Phase4Exception
      Description copied from class: AbstractAS4MessageBuilder
      Synchronously send the AS4 message. This method is called after AbstractAS4MessageBuilder.customizeBeforeSending(). This method may only be called by AbstractAS4MessageBuilder.sendMessage().
      Specified by:
      mainSendMessage in class AbstractAS4MessageBuilder<IMPLTYPE extends AbstractAS4PullRequestBuilder<IMPLTYPE>>
      Throws:
      Phase4Exception - In case of any error