Interface IAS2HttpResponseHandler

  • All Known Implementing Classes:
    AS2HttpResponseHandlerSocket
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface IAS2HttpResponseHandler
    Abstract HTTP response handler. This abstraction layer may be used to either write to a socket directly or to e.g. send an HTTP response via a servlet.
    Author:
    Philip Helger
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void sendHttpResponse​(int nHttpResponseCode, com.helger.commons.http.HttpHeaderMap aHeaders, com.helger.commons.io.IWriteToStream aData)
      Added an HTTP header to the response.
    • Method Detail

      • sendHttpResponse

        void sendHttpResponse​(@Nonnegative
                              int nHttpResponseCode,
                              @Nonnull
                              com.helger.commons.http.HttpHeaderMap aHeaders,
                              @Nonnull @WillNotClose
                              com.helger.commons.io.IWriteToStream aData)
                       throws IOException
        Added an HTTP header to the response. This method must be called before any output is written.
        Parameters:
        nHttpResponseCode - The HTTP response code. E.g. 200 for "HTTP OK". Must be > 0.
        aHeaders - Headers to use. May not be null.
        aData - Data to send as response body. May not be null but may be empty.
        Throws:
        IOException - In case of error