Interface IAS4OutgoingDumper

All Known Implementing Classes:
AbstractAS4OutgoingDumperWithHeaders, AS4OutgoingDumperFileBased, AS4OutgoingDumperSingleUse

public interface IAS4OutgoingDumper
Interface for dumping outgoing requests
Since:
0.9.0
Author:
Philip Helger
  • Method Details

    • onBeginRequest

      @Nullable OutputStream onBeginRequest(@Nonnull EAS4MessageMode eMsgMode, @Nullable IAS4IncomingMessageMetadata aIncomingMessageMetadata, @Nullable IAS4IncomingMessageState aIncomingState, @Nonnull @Nonempty String sMessageID, @Nullable com.helger.commons.http.HttpHeaderMap aCustomHeaders, @Nonnegative int nTry) throws IOException
      Called for new requests. It's the responsibility of the caller to close the created output stream.
      Parameters:
      eMsgMode - Are we dumping a request or a response? Never null. Added in v1.2.0.
      aIncomingMessageMetadata - The incoming message metadata. This is always null for requests (outgoing messages) and always non-null for responses (incoming messages) - see eMsgMode parameter for differentiation. Added in v1.2.0.
      aIncomingState - The incoming message processing state. This is always null for requests and always non-null for responses - see eMsgMode parameter for differentiation. Added in v1.2.0.
      sMessageID - The AS4 message ID of the outgoing message. Neither null nor empty.
      aCustomHeaders - Custom headers to be added to the HTTP entity. May be null.
      nTry - The index of the try. The first try has always index 0, the first retry has index 1, the second retry has index 2 etc. Always ≥ 0.
      Returns:
      If null is returned, nothing is dumped, else each byte written to the target stream is also written to that output stream.
      Throws:
      IOException - in case of an error
    • onEndRequest

      void onEndRequest(@Nonnull EAS4MessageMode eMsgMode, @Nullable IAS4IncomingMessageMetadata aIncomingMessageMetadata, @Nullable IAS4IncomingMessageState aIncomingState, @Nonnull @Nonempty String sMessageID, @Nullable Exception aCaughtException)
      Called after the AS4 request is handled internally. Can e.g. be used to cleanup resources belonging to the message. This method may not throw an exception. This method is only called if the onBeginRequest method delivered a non-null OutputStream.
      Parameters:
      eMsgMode - Are we dumping a request or a response? Never null. Added in v1.2.0.
      aIncomingMessageMetadata - The incoming message metadata. This is always null for requests. This is always non-null for responses. Added in v1.2.0.
      aIncomingState - The incoming message processing state. This is always null for requests. This is always non-null for responses. Added in v1.2.0.
      sMessageID - The AS4 message ID of the outgoing message. Neither null nor empty.
      aCaughtException - An optional exception caught during processing. May be null. Added in v3.0.0.