Class AS4MessageProcessorResult

java.lang.Object
com.helger.phase4.servlet.spi.AS4MessageProcessorResult
All Implemented Interfaces:
com.helger.commons.state.ISuccessIndicator
Direct Known Subclasses:
AS4SignalMessageProcessorResult

@Immutable public class AS4MessageProcessorResult extends Object implements com.helger.commons.state.ISuccessIndicator
This class represents the result of a message processor SPI implementation.
Note: cannot be serializable because WSS4JAttachment is not serializable
Author:
Philip Helger
  • Constructor Details

    • AS4MessageProcessorResult

      protected AS4MessageProcessorResult(@Nonnull com.helger.commons.state.ESuccess eSuccess, @Nullable String sErrorMsg, @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, @Nullable String sAsyncResponseURL)
      Parameters:
      eSuccess - Success or failure. May not be null.
      sErrorMsg - The error message to use. May be null.
      aAttachments - The response attachments. May be null.
      sAsyncResponseURL - The asynchronous response URLs. May be null.
  • Method Details

    • isSuccess

      public boolean isSuccess()
      Specified by:
      isSuccess in interface com.helger.commons.state.ISuccessIndicator
    • getErrorMessage

      @Nullable @Deprecated(forRemoval=true, since="2.3.0") public String getErrorMessage()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The error message. May be null, even in case of failure.
    • hasErrorMessage

      @Deprecated(forRemoval=true, since="2.3.0") public boolean hasErrorMessage()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAllAttachments

      @Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getAllAttachments()
    • hasAttachments

      public boolean hasAttachments()
    • addAllAttachmentsTo

      public void addAllAttachmentsTo(@Nonnull Collection<? super WSS4JAttachment> aTarget)
      Add all attachments contained in this object onto the provided target collection.
      Parameters:
      aTarget - The target collection. May not be null.
    • getAsyncResponseURL

      @Nullable public String getAsyncResponseURL()
      Returns:
      The asynchronous response URL. May be null.
    • hasAsyncResponseURL

      public boolean hasAsyncResponseURL()
      Returns:
      true if an asynchronous response URL is present, false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createSuccess

      @Nonnull public static AS4MessageProcessorResult createSuccess()
      Returns:
      A new success object. No attachments, no nothing.
    • createSuccessExt

      @Nonnull public static AS4MessageProcessorResult createSuccessExt(@Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aAttachments, @Nullable String sAsyncResponseURL)
      Create a success message with optional attachments. Usually you don't need this. Just call createSuccess() and you are fine.
      Parameters:
      aAttachments - Optional list of RESPONSE (!) attachments. Don't put the incoming attachments here.
      sAsyncResponseURL - The optional asynchronous response URL.
      Returns:
      Never null.
      Since:
      0.9.7
      See Also:
    • createFailure

      @Nonnull @Deprecated(forRemoval=true, since="2.3.0") public static AS4MessageProcessorResult createFailure(@Nullable String sErrorMsg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Create a negative response with the provided error message. This method is deprecated, because the error message is never used.
      Parameters:
      sErrorMsg - The error message to send back. May be null or empty since v1.3.1.
      Returns:
      Never null.
    • createFailure

      @Nonnull public static AS4MessageProcessorResult createFailure()
      Create a negative response.
      Returns:
      Never null.
      Since:
      2.3.0