Interface IAS4ServletMessageProcessorSPI


@IsSPIInterface public interface IAS4ServletMessageProcessorSPI
Implement this SPI interface to handle incoming messages appropriate.
Author:
Philip Helger
  • Method Details

    • processAS4UserMessage

      @Nonnull AS4MessageProcessorResult processAS4UserMessage(@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull com.helger.commons.http.HttpHeaderMap aHttpHeaders, @Nonnull Ebms3UserMessage aUserMessage, @Nonnull IPMode aPMode, @Nullable Node aPayload, @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> aIncomingAttachments, @Nonnull IAS4MessageState aState, @Nonnull com.helger.commons.collection.impl.ICommonsList<Ebms3Error> aProcessingErrorMessages)
      Process incoming AS4 user message
      Parameters:
      aMessageMetadata - Message metadata. Never null. Since v0.9.8.
      aHttpHeaders - The original HTTP headers. Never null.
      aUserMessage - The received user message. May not be null.
      aPMode - The source PMode used to parse the message.
      aPayload - Extracted, decrypted and verified payload node (e.g. SBDH). May be null. May also be null if a MIME message comes in - in that case the SOAP body MUST be empty and the main payload can be found in aIncomingAttachments[0].
      aIncomingAttachments - Extracted, decrypted and verified attachments. May be null or empty if no attachments are present.
      aState - The current message state. Can be used to determine all other things potentially necessary for processing the incoming message. Never null.
      aProcessingErrorMessages - List for error messages that occur during processing. Never null.
      Returns:
      A non-null result object. If a failure is returned, the message of the failure object itself is returned as an EBMS_OTHER error.
    • processAS4SignalMessage

      @Nonnull AS4SignalMessageProcessorResult processAS4SignalMessage(@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull com.helger.commons.http.HttpHeaderMap aHttpHeaders, @Nonnull Ebms3SignalMessage aSignalMessage, @Nullable IPMode aPMode, @Nonnull IAS4MessageState aState, @Nonnull com.helger.commons.collection.impl.ICommonsList<Ebms3Error> aProcessingErrorMessages)
      Process incoming AS4 signal message - pull-request and receipt.
      Attachment and Payload are not needed since they are allowed, but should not be added to a SignalMessage Because the will be ignored in the MSH - Processing.
      Parameters:
      aMessageMetadata - Request metadata. Never null. Since v0.9.8.
      aHttpHeaders - The original HTTP headers. Never null.
      aSignalMessage - The received signal message. May not be null.
      aPMode - PMode - only needed for pull-request. May be null.
      aState - The current message state. Can be used to determine all other things potentially necessary for processing the incoming message. Never null.
      aProcessingErrorMessages - List for error messages that occur during processing. Never null.
      Returns:
      A non-null result object. If a failure is returned, the message of the failure object itself is returned as an EBMS_OTHER error.
    • processAS4ResponseMessage

      default void processAS4ResponseMessage(@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull IAS4MessageState aState, @Nonnull @Nonempty String sResponseMessageID, @Nullable byte[] aResponseBytes, boolean bResponsePayloadIsAvailable)
      Optional callback to process a response message
      Parameters:
      aMessageMetadata - Incoming message metadata. Never null.
      aState - The current message state. Can be used to determine all other things potentially necessary for processing the response message. Never null.
      sResponseMessageID - The AS4 message ID of the response. Neither null nor empty. Since v1.2.0.
      aResponseBytes - The response bytes to be written. May be null for several reasons.
      bResponsePayloadIsAvailable - This indicates if a response payload is available at all. If this is false than the response bytes are null. Special case: if this is true and response bytes is null than most likely the response entity is not repeatable and cannot be handled more than once - that's why it is null here in this callback, but non-null in the originally returned message.
      Since:
      v0.9.8