Class AbstractAS4IncomingDumperWithHeaders

java.lang.Object
com.helger.phase4.dump.AbstractAS4IncomingDumperWithHeaders
All Implemented Interfaces:
IAS4IncomingDumper
Direct Known Subclasses:
AS4IncomingDumperFileBased, AS4IncomingDumperSingleUse

public abstract class AbstractAS4IncomingDumperWithHeaders extends Object implements IAS4IncomingDumper
Abstract version of IAS4IncomingDumper that emits all headers on the output stream.
Since:
0.9.7
Author:
Philip Helger
  • Field Details

    • DEFAULT_INCLUDE_HEADERS

      public static final boolean DEFAULT_INCLUDE_HEADERS
      See Also:
  • Constructor Details

    • AbstractAS4IncomingDumperWithHeaders

      public AbstractAS4IncomingDumperWithHeaders()
  • Method Details

    • isIncludeHeaders

      public final boolean isIncludeHeaders()
      Returns:
      true to include the headers in the dump, false if not. The default is DEFAULT_INCLUDE_HEADERS.
      Since:
      2.5.2
    • setIncludeHeaders

      public final void setIncludeHeaders(boolean b)
      Include or exclude the headers from the dump.
      Parameters:
      b - true to include the headers in the dump, false if not.
      Since:
      2.5.2
    • openOutputStream

      @Nullable protected abstract OutputStream openOutputStream(@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull com.helger.commons.http.HttpHeaderMap aHttpHeaderMap) throws IOException
      Create the output stream to which the data should be dumped.
      Parameters:
      aMessageMetadata - Request metadata. Never null. Since v0.9.8.
      aHttpHeaderMap - The HTTP headers of the incoming message. Never null.
      Returns:
      The output stream to dump to or null if no dumping should be performed.
      Throws:
      IOException - On IO error
    • onNewRequest

      @Nullable public OutputStream onNewRequest(@Nonnull IAS4IncomingMessageMetadata aMessageMetadata, @Nonnull com.helger.commons.http.HttpHeaderMap aHttpHeaderMap) throws IOException
      Description copied from interface: IAS4IncomingDumper
      Called for new incoming AS4 requests. It's the responsibility of the caller to close the created output stream.
      Specified by:
      onNewRequest in interface IAS4IncomingDumper
      Parameters:
      aMessageMetadata - Message metadata. Never null. Since v0.9.8.
      aHttpHeaderMap - The HTTP headers of the request. Never null.
      Returns:
      If null is returned, nothing is dumped, else each byte read from the source stream is written to that output stream. The OutputStream must be closed by the caller.
      Throws:
      IOException - in case of an error