Interface IAS4IncomingMessageState

All Known Implementing Classes:
AS4IncomingMessageState

public interface IAS4IncomingMessageState
Read-only AS4 message state for incoming messages.
Old name before v3: IAS4MessageState
Author:
Philip Helger
  • Method Details

    • getReceiptDT

      @Nonnull OffsetDateTime getReceiptDT()
      Returns:
      Date and time when the receipt started. This must be set in the implementation and never null.
    • getSoapVersion

      @Nonnull ESoapVersion getSoapVersion()
      Returns:
      The SOAP version of the current request as specified in the constructor. Never null.
      Since:
      v0.9.8
    • getResourceHelper

      @Nonnull AS4ResourceHelper getResourceHelper()
      Returns:
      The resource manager as specified in the constructor. Never null.
    • getLocale

      @Nonnull Locale getLocale()
      Returns:
      The request locale to use. Never null.
    • getMessaging

      @Nullable Ebms3Messaging getMessaging()
      Returns:
      The parent of the user message/signal message for further evaluation.
    • getEbmsUserMessage

      @Nullable default Ebms3UserMessage getEbmsUserMessage()
      Returns:
      The EBMS user message. May be null.
      Since:
      v0.9.7
    • getEbmsSignalMessage

      @Nullable default Ebms3SignalMessage getEbmsSignalMessage()
      Returns:
      The EBMS signal message. May be null.
      Since:
      v0.9.7
    • getEbmsError

      @Nullable default Ebms3Error getEbmsError()
      Returns:
      The EBMS signal message error. May be null.
      Since:
      v0.9.7
    • getEbmsPullRequest

      @Nullable default Ebms3PullRequest getEbmsPullRequest()
      Returns:
      The EBMS signal message pull request. May be null.
      Since:
      v0.9.7
    • getEbmsReceipt

      @Nullable default Ebms3Receipt getEbmsReceipt()
      Returns:
      The EBMS signal message receipt. May be null.
      Since:
      v0.9.7
    • getPMode

      @Nullable IPMode getPMode()
      Returns:
      the PMode that is used with the current message. May be null if none was found.
    • getOriginalSoapDocument

      @Nullable Document getOriginalSoapDocument()
      Returns:
      get the original SOAP document, only the entire document no attachment. This might by encrypted.
      Since:
      v0.9.8
      See Also:
    • hasOriginalSoapDocument

      default boolean hasOriginalSoapDocument()
      Returns:
      true if an original SOAP document is present, false if not.
      See Also:
    • getOriginalAttachments

      @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getOriginalAttachments()
      Returns:
      has saved the original attachment, can be encrypted or not depends if encryption is used or not.
      See Also:
    • hasOriginalAttachments

      default boolean hasOriginalAttachments()
      Returns:
      true if original attachments are present, false if not.
      See Also:
    • getDecryptedSoapDocument

      @Nullable Document getDecryptedSoapDocument()
      Returns:
      get the decrypted SOAP document, only the entire document no attachment
      Since:
      v0.9.8
      See Also:
    • hasDecryptedSoapDocument

      default boolean hasDecryptedSoapDocument()
      Returns:
      true of a decrypted SOAP document is present, false if not.
      See Also:
    • getEffectiveDecryptedSoapDocument

      @Nullable default Document getEffectiveDecryptedSoapDocument()
      Returns:
      The effectively decrypted SOAP document.
      Since:
      3.0.0
      See Also:
    • getDecryptedAttachments

      @Nullable com.helger.commons.collection.impl.ICommonsList<WSS4JAttachment> getDecryptedAttachments()
      Returns:
      Getting decrypted attachment, if there were encrypted attachments to begin with. May be null.
      See Also:
    • hasDecryptedAttachments

      default boolean hasDecryptedAttachments()
      Returns:
      true if a decrypted attachments are present, false if not.
    • getCompressedAttachmentIDs

      @Nullable com.helger.commons.collection.impl.ICommonsMap<String,EAS4CompressionMode> getCompressedAttachmentIDs()
      Returns:
      IDs from all compressed attachments and/or payload. May be null.
    • hasCompressedAttachmentIDs

      default boolean hasCompressedAttachmentIDs()
    • getAttachmentCompressionMode

      @Nullable default EAS4CompressionMode getAttachmentCompressionMode(@Nullable String sID)
      Parameters:
      sID - id to look up“. May be null.
      Returns:
      Looks up if a compression mode with the id sID exists and returns the mode else null
    • containsCompressedAttachmentID

      default boolean containsCompressedAttachmentID(@Nullable String sID)
      Parameters:
      sID - the id to look up. May be null.
      Returns:
      looks up if the compressed attachment contain the given ID
    • getMPC

      @Nullable IMPC getMPC()
      Returns:
      the MPC that is used in the current message exchange. May be null.
    • hasMPC

      default boolean hasMPC()
      Returns:
      true if an MPC is set, false if not.
      See Also:
    • isSoapBodyPayloadPresent

      boolean isSoapBodyPayloadPresent()
      Returns:
      true if a payload in the soap body is present, else false
      See Also:
    • getInitiatorID

      @Nullable String getInitiatorID()
      Returns:
      initiator set in the usermessage if the incoming message is a UserMessage. This is the content of the FromParty/PartyId element and in Peppol reflects the C2. May be null.
    • hasInitiatorID

      default boolean hasInitiatorID()
      Returns:
      true if an initiator ID was part of the UserMessage, false if not.
      See Also:
    • getResponderID

      @Nullable String getResponderID()
      Returns:
      responder set in the usermessage if the incoming message is a UserMessage. This is the content of the ToParty/PartyId element and in Peppol reflects the C3. May be null.
    • hasResponderID

      default boolean hasResponderID()
      Returns:
      true if a responder ID was part of the UserMessage, false if not.
      See Also:
    • getUsedCertificate

      @Nullable @Deprecated(forRemoval=true, since="3.0.5") X509Certificate getUsedCertificate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The first provided certificate in the incoming message. Usually the certificate that was used for signing. May be null.
      See Also:
    • hasUsedCertificate

      @Deprecated(forRemoval=true, since="3.0.5") default boolean hasUsedCertificate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      true if a certificate is provided, false if not.
      See Also:
    • getSigningCertificate

      @Nullable X509Certificate getSigningCertificate()
      Returns:
      The signing certificate in the incoming message. May be null.
      Since:
      3.0.5
      See Also:
    • hasSigningCertificate

      default boolean hasSigningCertificate()
      Returns:
      true if a signing certificate is provided, false if not.
      Since:
      3.0.5
      See Also:
    • getDecryptingCertificate

      @Nullable X509Certificate getDecryptingCertificate()
      Returns:
      The decrypting certificate in the incoming message. May be null.
      Since:
      3.0.5
      See Also:
    • hasDecryptingCertificate

      default boolean hasDecryptingCertificate()
      Returns:
      true if a decrypting certificate is provided, false if not.
      Since:
      3.0.5
      See Also:
    • getEffectivePModeLeg

      @Nullable PModeLeg getEffectivePModeLeg()
      Returns:
      The effective leg to use. May be leg 1 or leg 2 of the PMode. If no PMode was found, no PModeLeg is present.
      See Also:
    • getEffectivePModeLegNumber

      @CheckForSigned int getEffectivePModeLegNumber()
      Returns:
      1 or 2, depending on the used leg. Any other value indicates "undefined". If no PMode was found, no PModeLeg is present.
      See Also:
    • getSoapWSS4JSecurityActions

      @Nonnegative int getSoapWSS4JSecurityActions()
      Returns:
      A bit set of the WSS4J security action tags found. 0 for nothing. See class org.apache.wss4j.dom.WSContants line 326ff for the constants.
      Since:
      v0.9.8
    • isSoapSignatureChecked

      boolean isSoapSignatureChecked()
      Returns:
      true if the incoming message was signed and the signature was verified, false otherwise.
    • isSoapDecrypted

      boolean isSoapDecrypted()
      Returns:
      true if the incoming message was decrypted, false otherwise.
    • getSoapWSS4JException

      @Nullable Exception getSoapWSS4JException()
      Returns:
      An Exception that occurred during processing the incoming SOAP WS-Security handler. If this is a org.apache.wss4j.common.ext.WSSecurityException exception something happened on the security level.
      Since:
      0.9.11
    • hasSoapWSS4JException

      default boolean hasSoapWSS4JException()
      Returns:
      true if a SOAP WSS4J exception is present, false if not.
      See Also:
    • getProfileID

      @Nullable default String getProfileID()
      Returns:
      The phase4 profile ID to be used. May be null.
      Since:
      v0.9.7
    • getAS4Profile

      @Nullable IAS4Profile getAS4Profile()
      Returns:
      The phase4 profile to be used. May be null in case it could not be determined.
      Since:
      v2.5.3
    • getMessageID

      @Nullable String getMessageID()
      Returns:
      The AS4 message ID. Source is the MessageInfo element. May be null.
      Since:
      v0.9.7
    • getRefToMessageID

      @Nullable String getRefToMessageID()
      Returns:
      The AS4 "reference to message ID". This value is optional in the headers. Source is the MessageInfo element. May be null.
      Since:
      v1.2.0
    • getMessageTimestamp

      @Nullable com.helger.commons.datetime.XMLOffsetDateTime getMessageTimestamp()
      Returns:
      The AS4 provided message timestamp. This value is mandatory in the source MessageInfo element. May be null.
      Since:
      v1.2.0
    • isPingMessage

      boolean isPingMessage()
      Returns:
      true if the incoming message is an AS4 ping message, false otherwise.
      Since:
      v0.9.7
    • getSoapBodyPayloadNode

      @Nullable Node getSoapBodyPayloadNode()
      Returns:
      The child of the SOAP Body node or null. That is always decrypted.
      Since:
      v0.9.8
    • isSoapHeaderElementProcessingSuccessful

      boolean isSoapHeaderElementProcessingSuccessful()
      Returns:
      true if SOAP header element processing was successful, false if not. If not, than many other values are also not set and at least one error is in the error list.
      Since:
      v0.9.7
    • getCryptoFactorySign

      @Nullable IAS4CryptoFactory getCryptoFactorySign()
      Returns:
      The crypto factory that was used to verify an eventually contained signature. May be null. If this is non-null it is NO indicator, whether a message was signed or not.
      Since:
      3.0.0-beta6
      See Also:
    • getCryptoFactoryCrypt

      @Nullable IAS4CryptoFactory getCryptoFactoryCrypt()
      Returns:
      The crypto factory that was used to decrypt an eventually encrypted message. May be null. If this is non-null it is NO indicator, whether a message was encrypted or not.
      Since:
      3.0.0-beta6
      See Also: