Class AS4ClientSentMessage<T>

java.lang.Object
com.helger.phase4.client.AS4ClientSentMessage<T>
Type Parameters:
T - The response type

@NotThreadSafe public class AS4ClientSentMessage<T> extends Object
This class correlates the built source message (AS4ClientBuiltMessage) with the HTTP response of the passed type (T).
Author:
Philip Helger
  • Constructor Details

    • AS4ClientSentMessage

      public AS4ClientSentMessage(@Nonnull AS4ClientBuiltMessage aBuiltMsg, @Nullable org.apache.hc.core5.http.message.StatusLine aResponseStatusLine, @Nonnull com.helger.commons.http.HttpHeaderMap aResponseHeaders, @Nullable T aResponseContent)
      Parameters:
      aBuiltMsg - The built message with headers, payload and message ID. May not be null.
      aResponseStatusLine - The HTTP response status line. May be null.
      aResponseHeaders - The HTTP response header. May not be null.
      aResponseContent - The response payload. May be null.
    • AS4ClientSentMessage

      protected AS4ClientSentMessage(@Nonnull AS4ClientBuiltMessage aBuiltMsg, @Nullable org.apache.hc.core5.http.message.StatusLine aResponseStatusLine, @Nonnull com.helger.commons.http.HttpHeaderMap aResponseHeaders, @Nullable T aResponseContent, @Nonnull OffsetDateTime aSentDateTime)
      Parameters:
      aBuiltMsg - The built message with headers, payload and message ID. May not be null.
      aResponseStatusLine - The HTTP response status line. May be null.
      aResponseHeaders - The HTTP response header. May not be null.
      aResponseContent - The response payload. May be null.
      aSentDateTime - The sending date time. May not be null.
  • Method Details

    • getBuiltMessage

      @Nonnull public final AS4ClientBuiltMessage getBuiltMessage()
      Returns:
      The built message as provided in the constructor. Never null.
    • getMessageID

      @Nonnull @Nonempty public final String getMessageID()
      Returns:
      The AS4 message ID of the sent out message. Neither null nor empty. This is a shortcut for getBuiltMessage().getMessageID ().
    • getResponseStatusLine

      @Nullable public final org.apache.hc.core5.http.message.StatusLine getResponseStatusLine()
      Returns:
      The HTTP response status line. It contains the HTTP version, the response code and the response reason (if present). May be null.
      Since:
      0.13.0
      See Also:
    • hasResponseStatusLine

      public final boolean hasResponseStatusLine()
      Returns:
      true if a response status line is present, false if not.
      Since:
      0.13.0
      See Also:
    • getResponseHeaders

      @Nonnull public final com.helger.commons.http.HttpHeaderMap getResponseHeaders()
      Returns:
      The HTTP response headers as a mutable map. Never null.
      Since:
      0.13.0
    • getResponseContent

      @Nullable @ReturnsMutableObject public final T getResponseContent()
      Returns:
      The response payload. May be null.
      See Also:
    • hasResponseContent

      public final boolean hasResponseContent()
      Returns:
      true if a response payload is present, false if not.
      See Also:
    • getSentDateTime

      @Nonnull public final OffsetDateTime getSentDateTime()
      Returns:
      The sent date time. Never null.
      Since:
      0.10.0
    • toString

      public String toString()
      Overrides:
      toString in class Object