Interface IAS4ResponseAbstraction


public interface IAS4ResponseAbstraction
A synthetic wrapper for an AS4 HTTP response. By default AS4UnifiedResponse is the logical implementation, but the return types are different.
Since:
0.9.6
Author:
Philip Helger
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    setContent(byte[] aBytes, Charset aCharset)
    Set the response payload as a byte array with a certain character set.
    void
    setContent(com.helger.commons.http.HttpHeaderMap aHeaderMap, com.helger.commons.io.IHasInputStream aHasIS)
    Set the content as an input stream provider.
    void
    setMimeType(com.helger.commons.mime.IMimeType aMimeType)
    Set the MIME type (Content-Type) of the response.
    void
    setStatus(int nStatusCode)
    Set the HTTP status code to be returned.
    wrap(AS4UnifiedResponse aHttpResponse)
  • Method Details

    • setContent

      void setContent(@Nonnull byte[] aBytes, @Nonnull Charset aCharset)
      Set the response payload as a byte array with a certain character set. This is called, if the an XML response is sent back.
      Parameters:
      aBytes - The bytes to be set. May not be null.
      aCharset - The character set of the byte array. May not be null.
      Since:
      0.9.7 this was merged from setContent and setCharset
    • setContent

      void setContent(@Nonnull com.helger.commons.http.HttpHeaderMap aHeaderMap, @Nonnull com.helger.commons.io.IHasInputStream aHasIS)
      Set the content as an input stream provider. This is used if a MIME response is sent back.
      Parameters:
      aHeaderMap - Custom HTTP headers to be used. Never null but maybe empty.
      aHasIS - The input stream provider.
      Since:
      0.9.9 this was merged from addCustomResponseHeaders and setContent
    • setMimeType

      void setMimeType(@Nonnull com.helger.commons.mime.IMimeType aMimeType)
      Set the MIME type (Content-Type) of the response.
      Parameters:
      aMimeType - Mime type to use. May not be null.
    • setStatus

      void setStatus(int nStatusCode)
      Set the HTTP status code to be returned.
      Parameters:
      nStatusCode - The HTTP status code.
    • wrap

      Parameters:
      aHttpResponse - The unified response to be wrapped. May not be null.
      Returns:
      Never null.