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

      @Deprecated(forRemoval=true, since="4.5.1") public AS4ClientSentMessage(@NonNull AS4ClientBuiltMessage aBuiltMsg, @Nullable org.apache.hc.core5.http.message.StatusLine aResponseStatusLine, @NonNull com.helger.http.header.HttpHeaderMap aResponseHeaders, @Nullable T aResponseContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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

      public AS4ClientSentMessage(@NonNull AS4ClientBuiltMessage aBuiltMsg, @Nullable com.helger.collection.commons.ICommonsList<X509Certificate> aRemoteTlsPeerCerts, @Nullable org.apache.hc.core5.http.message.StatusLine aResponseStatusLine, @NonNull com.helger.http.header.HttpHeaderMap aResponseHeaders, @Nullable T aResponseContent)
      Parameters:
      aBuiltMsg - The built message with headers, payload and message ID. May not be null.
      aRemoteTlsPeerCerts - The remote TLS server certificates captured during the HTTPS handshake. May 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 com.helger.collection.commons.ICommonsList<X509Certificate> aRemoteTlsPeerCerts, @Nullable org.apache.hc.core5.http.message.StatusLine aResponseStatusLine, @NonNull com.helger.http.header.HttpHeaderMap aResponseHeaders, @Nullable T aResponseContent, @NonNull OffsetDateTime aSentDateTime)
      Parameters:
      aBuiltMsg - The built message with headers, payload and message ID. May not be null.
      aRemoteTlsPeerCerts - The remote TLS server certificates captured during the HTTPS handshake. May 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

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

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

      @ReturnsMutableObject public final @Nullable com.helger.collection.commons.ICommonsList<X509Certificate> getRemoteTlsPeerCerts()
      Returns:
      The remote TLS server certificate chain captured during the HTTPS handshake (index 0 = leaf/server certificate). May be null if no certificates were captured (e.g. plain HTTP, connection reuse without new handshake).
      Since:
      4.5.1
    • getResponseStatusLine

      public final @Nullable 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

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

      @ReturnsMutableObject public final @Nullable 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

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

      public String toString()
      Overrides:
      toString in class Object