Class Phase4PeppolSendingReport

java.lang.Object
com.helger.phase4.peppol.Phase4PeppolSendingReport

@NotThreadSafe public class Phase4PeppolSendingReport extends Object
This class contains the structured information about what happens on Peppol sending.
Since:
3.0.5
Author:
Philip Helger
  • Constructor Details

    • Phase4PeppolSendingReport

      public Phase4PeppolSendingReport(@NonNull com.helger.peppol.sml.ISMLInfo aSMLInfo)
  • Method Details

    • getCurrentDateTimeUTC

      public @NonNull OffsetDateTime getCurrentDateTimeUTC()
      Returns:
      The date and time for which the sending report is created. Never null.
      Since:
      4.2.0
    • getSMLDNSZone

      @Nonempty public @NonNull @Nonempty String getSMLDNSZone()
      Returns:
      The SML DNS zone on which the message exchange takes place. Neither null nor empty.
      Since:
      4.2.0
    • getSBDHParseException

      public @Nullable Exception getSBDHParseException()
      Returns:
      The specific exception that occurred during parsing of a provided SBDH. May be null.
      Since:
      4.2.0
    • hasSBDHParseException

      public boolean hasSBDHParseException()
    • setSBDHParseException

      public void setSBDHParseException(@Nullable Exception e)
      Remember any specific exception that occurred during parsing of a provided SBDH.
      Parameters:
      e - The exception that was caught. May be null.
    • getSenderID

      public @Nullable com.helger.peppolid.IParticipantIdentifier getSenderID()
      Returns:
      The sending participant identifier. May be null.
      Since:
      4.2.0
    • hasSenderID

      public boolean hasSenderID()
    • setSenderID

      public void setSenderID(@Nullable com.helger.peppolid.IParticipantIdentifier a)
      Remember the senders Peppol Participant ID (C1 ID).
      Parameters:
      a - Peppol Participant ID. May be null.
    • getReceiverID

      public @Nullable com.helger.peppolid.IParticipantIdentifier getReceiverID()
      Returns:
      The receiving participant identifier. May be null.
      Since:
      4.2.0
    • hasReceiverID

      public boolean hasReceiverID()
    • setReceiverID

      public void setReceiverID(@Nullable com.helger.peppolid.IParticipantIdentifier a)
      Remember the receivers Peppol Participant ID (C4 ID).
      Parameters:
      a - Peppol Participant ID. May be null.
    • getDocTypeID

      public @Nullable com.helger.peppolid.IDocumentTypeIdentifier getDocTypeID()
      Returns:
      The exchanged document type identifier. May be null.
      Since:
      4.2.0
    • hasDocTypeID

      public boolean hasDocTypeID()
    • setDocTypeID

      public void setDocTypeID(@Nullable com.helger.peppolid.IDocumentTypeIdentifier a)
      Remember the Peppol Document Type ID that was exchanged.
      Parameters:
      a - Document Type ID. May be null.
    • getProcessID

      public @Nullable com.helger.peppolid.IProcessIdentifier getProcessID()
      Returns:
      The exchanged process identifier. May be null.
      Since:
      4.2.0
    • hasProcessID

      public boolean hasProcessID()
    • setProcessID

      public void setProcessID(@Nullable com.helger.peppolid.IProcessIdentifier a)
      Remember the Peppol Process ID that was exchanged.
      Parameters:
      a - Process ID. May be null.
    • getCountryC1

      public @Nullable String getCountryC1()
      Returns:
      The sender (C1) Country Code. May be null.
      Since:
      4.2.0
    • hasCountryC1

      public boolean hasCountryC1()
    • setCountryC1

      public void setCountryC1(@Nullable String s)
      Remember the senders (C1) Country Code (2 letter code).
      Parameters:
      s - C1 country code. May be null.
    • getSenderPartyID

      public @Nullable String getSenderPartyID()
      Returns:
      The sender party (C3) ID. May be null.
      Since:
      4.2.0
    • hasSenderPartyID

      public boolean hasSenderPartyID()
    • setSenderPartyID

      public void setSenderPartyID(@Nullable String s)
      Remember the sender party ID (the ID of C3).
      Parameters:
      s - Sender party ID. May be null.
    • getTransportProfileID

      public @Nullable String getTransportProfileID()
      Returns:
      The transport profile ID. May be null.
      Since:
      4.2.0
    • hasTransportProfileID

      public boolean hasTransportProfileID()
    • setTransportProfileID

      public void setTransportProfileID(@Nullable String s)
      Remember the transport profile ID.
      Parameters:
      s - Transport profile ID. May be null.
    • getSBDHInstanceIdentifier

      public @Nullable String getSBDHInstanceIdentifier()
      Returns:
      The SBDH Instance Identifier. May be null.
      Since:
      4.2.0
    • hasSBDHInstanceIdentifier

      public boolean hasSBDHInstanceIdentifier()
    • setSBDHInstanceIdentifier

      public void setSBDHInstanceIdentifier(@Nullable String s)
      Remember the SBDH Instance Identifier. That is the identifier, that uniquely identifies the specific transmission and is referred to by MLR and MLS.
      Parameters:
      s - SBDH instance identifier. May be null.
    • getC3SMPURL

      public @Nullable String getC3SMPURL()
      Returns:
      The SMP URL of C3 determined by the DNS lookup. May be null.
      Since:
      4.3.2
    • hasC3SMPURL

      public boolean hasC3SMPURL()
      Returns:
      true if a C3 SMP URL is present, false if not.
      Since:
      4.3.2
    • setC3SMPURL

      public void setC3SMPURL(@Nullable String s)
      Remember the SMP URL of C3 determined by the SMP lookup.
      Parameters:
      s - C3 SMP URL. May be null.
      Since:
      4.3.2
    • getC3EndpointURL

      public @Nullable String getC3EndpointURL()
      Returns:
      The AP endpoint URL of C3 determined by the SMP lookup. May be null.
      Since:
      4.2.0
    • hasC3EndpointURL

      public boolean hasC3EndpointURL()
    • setC3EndpointURL

      public void setC3EndpointURL(@Nullable String s)
      Remember the AP endpoint URL of C3 determined by the SMP lookup.
      Parameters:
      s - C3 endpoint URL. May be null.
    • getC3Cert

      public @Nullable X509Certificate getC3Cert()
      Returns:
      The public Peppol AP certificate of C3 determined by the SMP lookup. May be null.
      Since:
      4.2.0
    • hasC3Cert

      public boolean hasC3Cert()
    • hasC3CertSubjectCN

      public boolean hasC3CertSubjectCN()
    • hasC3CertSubjectO

      public boolean hasC3CertSubjectO()
    • hasC3CertSubjectC

      public boolean hasC3CertSubjectC()
    • setC3Cert

      public void setC3Cert(@Nullable X509Certificate a)
      Remember the public Peppol AP certificate of C3 determined by the SMP lookup.
      Parameters:
      a - C3 public Peppol AP certificate. May be null.
    • getC3CertCheckDT

      public @Nullable OffsetDateTime getC3CertCheckDT()
      Returns:
      The date and time, when the Peppol AP certificate of C3, as retrieved from the SMP, was checked for revocation. May be null.
      Since:
      4.2.0
    • hasC3CertCheckDT

      public boolean hasC3CertCheckDT()
    • setC3CertCheckDT

      public void setC3CertCheckDT(@Nullable OffsetDateTime a)
      Remember the date and time, when the Peppol AP certificate of C3, as retrieved from the SMP, was checked for revocation.
      Parameters:
      a - The Peppol AP Certificate check date time. May be null.
    • getC3CertCheckResult

      public @Nullable com.helger.security.certificate.ECertificateCheckResult getC3CertCheckResult()
      Returns:
      The result of checking the Peppol AP certificate of C3, as retrieved from the SMP, for validity. May be null.
      Since:
      4.2.0
    • hasC3CertCheckResult

      public boolean hasC3CertCheckResult()
    • setC3CertCheckResult

      public void setC3CertCheckResult(@Nullable com.helger.security.certificate.ECertificateCheckResult e)
      Remember the result of checking the Peppol AP certificate of C3, as retrieved from the SMP, for validity.
      Parameters:
      e - The Peppol AP Certificate check result. May be null.
    • getC3TechnicalContact

      public @Nullable String getC3TechnicalContact()
      Returns:
      The technical contact information retrieved from the SMP endpoint. May be null.
      Since:
      4.2.0
    • hasC3TechnicalContact

      public boolean hasC3TechnicalContact()
      Returns:
      true if a C3 technical contact is present, false if not.
      Since:
      4.2.0
    • setC3TechnicalContact

      public void setC3TechnicalContact(@Nullable String s)
      Remember the technical contact information retrieved from the SMP endpoint. This might be helpful to quickly find support.
      Parameters:
      s - The technical contact URL to use. May be null.
      Since:
      4.2.0
    • getLookupError

      public @Nullable String getLookupError()
    • hasLookupError

      public boolean hasLookupError()
    • setLookupError

      public void setLookupError(@Nullable String s)
    • getLookupException

      public @Nullable Exception getLookupException()
    • hasLookupException

      public boolean hasLookupException()
    • setLookupException

      public void setLookupException(@Nullable Exception a)
    • getLookupDurationMillis

      public long getLookupDurationMillis()
    • hasLookupDurationMillis

      public boolean hasLookupDurationMillis()
    • setLookupDurationMillis

      public void setLookupDurationMillis(long n)
    • getAS4MessageID

      public @Nullable String getAS4MessageID()
      Returns:
      The AS4 Message ID used to send out the message. May be null.
      Since:
      4.2.0
    • hasAS4MessageID

      public boolean hasAS4MessageID()
    • setAS4MessageID

      public void setAS4MessageID(@Nullable String s)
      Remember the AS4 Message ID used to send out the message.
      Parameters:
      s - The AS4 Message ID. May be null.
    • getAS4ConversationID

      public @Nullable String getAS4ConversationID()
      Returns:
      The AS4 Conversation ID used to send out the message. May be null.
      Since:
      4.2.0
    • hasAS4ConversationID

      public boolean hasAS4ConversationID()
    • setAS4ConversationID

      public void setAS4ConversationID(@Nullable String s)
      Remember the AS4 Conversation ID used to send out the message.
      Parameters:
      s - The AS4 Conversation ID. May be null.
    • getAS4SendingDT

      public @Nullable OffsetDateTime getAS4SendingDT()
      Returns:
      The AS4 sending date time. May be null.
      Since:
      4.2.0
    • hasAS4SendingDT

      public boolean hasAS4SendingDT()
    • setAS4SendingDT

      public void setAS4SendingDT(@Nullable OffsetDateTime a)
      Remember the AS4 sending date time, as the correlation basis for MLS.
      Parameters:
      a - The sending date time.
      Since:
      3.1.0
    • getRawHttpResponse

      public @Nullable com.helger.phase4.client.AS4ClientSentMessage<byte[]> getRawHttpResponse()
      Returns:
      The raw HTTP response message received from the other side. This is only emitted in case of non-success. May be null.
      Since:
      4.2.3
    • hasRawHttpResponse

      public boolean hasRawHttpResponse()
      Returns:
      true if a raw response is present, false if not.
      Since:
      4.2.3
    • setRawHttpResponse

      public void setRawHttpResponse(@Nullable com.helger.phase4.client.AS4ClientSentMessage<byte[]> aRawHttpResponse)
      Set the raw HTTP response message received from the other side. This is only emitted in case of non-success.
      Parameters:
      aRawHttpResponse - The raw response to use. May be null to explicit state that it should not be part of the sending report.
      Since:
      4.2.3
    • getAS4ReceivedSignalMsg

      public @Nullable com.helger.phase4.ebms3header.Ebms3SignalMessage getAS4ReceivedSignalMsg()
      Returns:
      The synchronously received AS4 Signal Message from C3. May be null.
      Since:
      4.2.0
    • getAS4ReceivedErrors

      @ReturnsMutableObject public @Nullable com.helger.collection.commons.ICommonsList<com.helger.phase4.ebms3header.Ebms3Error> getAS4ReceivedErrors()
      Returns:
      The list of AS4 EBMS errors received from C3. May be null or empty.
      Since:
      4.2.0
    • hasAS4ReceivedSignalMsg

      public boolean hasAS4ReceivedSignalMsg()
    • hasAS4ResponseErrors

      public boolean hasAS4ResponseErrors()
    • setAS4ReceivedSignalMsg

      public void setAS4ReceivedSignalMsg(@Nullable com.helger.phase4.ebms3header.Ebms3SignalMessage a)
      Remember the synchronously received AS4 Signal Message from C3.
      Parameters:
      a - The parsed AS4 Signal Message. May be null.
    • getAS4SendingResult

      public @Nullable com.helger.phase4.sender.EAS4UserMessageSendResult getAS4SendingResult()
      Returns:
      The overall AS4 sending result. May be null.
      Since:
      4.2.0
    • hasAS4SendingResult

      public boolean hasAS4SendingResult()
    • hasUnsuccessfulAS4SendingResult

      public boolean hasUnsuccessfulAS4SendingResult()
    • setAS4SendingResult

      public void setAS4SendingResult(@Nullable com.helger.phase4.sender.EAS4UserMessageSendResult e)
      Remember the overall AS4 sending result.
      Parameters:
      e - The AS4 sending result. May be null.
    • getAS4SendingError

      public @Nullable String getAS4SendingError()
    • hasAS4SendingError

      public boolean hasAS4SendingError()
    • setAS4SendingError

      public void setAS4SendingError(@Nullable String s)
    • getAS4SendingException

      public @Nullable Exception getAS4SendingException()
      Returns:
      The exception that eventually occurred on AS4 sending. May be null.
      Since:
      4.2.0
    • hasAS4SendingException

      public boolean hasAS4SendingException()
    • setAS4SendingException

      public void setAS4SendingException(@Nullable Exception e)
      Remember any exception that eventually occurred on AS4 sending.
      Parameters:
      e - The exception from AS4 sending. May be null.
    • getAS4SendingDurationMillis

      public long getAS4SendingDurationMillis()
    • hasAS4SendingDurationMillis

      public boolean hasAS4SendingDurationMillis()
    • setAS4SendingDurationMillis

      public void setAS4SendingDurationMillis(long n)
    • getOverallDurationMillis

      public long getOverallDurationMillis()
      Returns:
      The overall duration it took to perform the lookup and sending process.
      Since:
      4.2.0
    • setOverallDurationMillis

      public void setOverallDurationMillis(@Nonnegative long n)
      Remember the overall duration it took to perform the lookup and sending process.
      Parameters:
      n - The overall milliseconds needed. Must be ≥ 0.
    • isSendingSuccess

      public boolean isSendingSuccess()
      Returns:
      true if sending was done successful.
      Since:
      4.2.0
    • setSendingSuccess

      public void setSendingSuccess(boolean b)
      Remember the overall sending success.
      Parameters:
      b - true on success, false on failure.
    • isOverallSuccess

      public boolean isOverallSuccess()
      Returns:
      true if sending and all follow up activities was done successful.
      Since:
      4.2.0
    • setOverallSuccess

      public void setOverallSuccess(boolean b)
      Remember the overall success. This may differ from the sending success, if e.g. sending succeeded but storing the record for Peppol reporting failed.
      Parameters:
      b - true on success, false on failure.
    • getAsJsonObject

      public @NonNull com.helger.json.IJsonObject getAsJsonObject()
      Get the whole report as one big JSON structure. Only elements that were provided, are contained in the report.
      Returns:
      The sending report as a JSON object. May not be null.
    • getAsJsonString

      public @NonNull String getAsJsonString()
      Returns:
      The JSON representation of the sending report, as a formatted string. Never null.
    • getAsJsonString

      public @NonNull String getAsJsonString(@NonNull com.helger.json.serialize.IJsonWriterSettings aJWS)
      Parameters:
      aJWS - The JSON writer settings to use. May not be null.
      Returns:
      The JSON representation of the sending report, as a string. Never null.
    • getAsMicroElement

      public @NonNull com.helger.xml.microdom.IMicroElement getAsMicroElement(@Nullable String sNamespaceURI, @Nonempty @NonNull @Nonempty String sTagName)
      Get the sending report as a MicroDOM element. Only elements that were provided, are contained in the report.
      Parameters:
      sNamespaceURI - The namespace URI to be used. May be null.
      sTagName - The tag name to use for the root element. May neither be null nor empty.
      Returns:
      The created micro element and never null.
    • getAsXMLString

      public @NonNull String getAsXMLString()
    • getAsXMLString

      public @NonNull String getAsXMLString(@Nullable String sNamespaceURI, @NonNull com.helger.xml.serialize.write.IXMLWriterSettings aXWS)