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

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

      public final @NonNull 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

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

      public final @NonNull 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

      public final @NonNull 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

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

      public final @NonNull 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

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

      public final @NonNull 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

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

      public final @NonNull 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

      public final @Nullable IAS4SignalMessageConsumer signalMsgConsumer()
      Returns:
      The optional Ebms3 Signal Message Consumer. May be null.
      Since:
      3.0.0
    • signalMsgConsumer

      public final @NonNull 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

      public final @Nullable IAS4SignalMessageValidationResultHandler signalMsgValidationResultHdl()
      Returns:
      The optional Ebms3 Signal Message validation result handled. May be null.
      Since:
      3.0.1
    • signalMsgValidationResultHdl

      public final @NonNull 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

      @OverridingMethodsMustInvokeSuper protected @NonNull 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