Class DBNAllianceXHEData

java.lang.Object
com.helger.peppol.xhe.DBNAllianceXHEData

@NotThreadSafe public class DBNAllianceXHEData extends Object
This class contains all the DBNAlliance data per XHE document in a syntax neutral way. This class maps to the requirements of the Exchange Header Envelope (XHE) Version 1.0 specification.
Author:
Robinson Garcia, Philip Helger
  • Constructor Details

    • DBNAllianceXHEData

      public DBNAllianceXHEData(@Nonnull com.helger.peppolid.factory.IIdentifierFactory aIdentifierFactory)
      Constructor
      Parameters:
      aIdentifierFactory - Identifier factory to be used. May not be null.
  • Method Details

    • getID

      @Nullable public String getID()
      An informative unique ID created by the issuer of the envelope. The ID MUST be unique for each Exchange Header Envelope being created. This ID is not the same as the ID of the business message (such as the Invoice Number). It is not the same as a transmission Message ID generated by the application sending the message (as defined in e.g. AS4).
      The InstanceIdentifier MUST be globally unique and it is RECOMMENDED to use UUID (such as 118e3040-51d2-11e3-8f96-0800200c9a66). This field is mapped to XHE/Header/ID .
      Returns:
      The instance identifier. May be null.
    • hasID

      public boolean hasID()
      Returns:
      true if an instance identifier is present, false if not.
    • setID

      @Nonnull public DBNAllianceXHEData setID(@Nonnull @Nonempty String sID)
      Set the content of the fields that are mapped to XHE/Header/ID.
      Parameters:
      sID - An informative unique ID created by the issuer of the envelope. The ID MUST be unique for each Business Message Envelope being created. This ID is not the same as the ID of the business message (such as the Invoice Number). It is not the same as a transmission Message ID generated by the application sending the message (as defined in AS4).
      The InstanceIdentifier MUST be globally unique and it is RECOMMENDED to use UUID (such as 118e3040-51d2-11e3-8f96-0800200c9a66). May not be null. This field is mapped to XHE/Header/ID .
      Returns:
      this
    • getCreationDateTime

      @Nullable public com.helger.commons.datetime.XMLOffsetDateTime getCreationDateTime()
      The date and time for when this envelope was created. It is NOT necessarily the same as the issue date of the business document (such as the invoice) being enveloped. It is NOT necessarily the date time for transmission.
      The format of the value of this MUST include timezone information. This field is mapped to XHE/Header/CreationDateTime .
      Returns:
      The creation date time. May be null.
    • hasCreationDateTime

      public boolean hasCreationDateTime()
      Returns:
      true if creation date and time is present, false if not.
      Since:
      7.0.0
    • setCreationDateAndTime

      @Nonnull public DBNAllianceXHEData setCreationDateAndTime(@Nonnull com.helger.commons.datetime.XMLOffsetDateTime aCreationDateTime)
      Set the content of the fields that are mapped to XHE/Header/CreationDateTime.
      Parameters:
      aCreationDateTime - The date and time for when this envelope was created. It is NOT necessarily the same as the issue date of the business document (such as the invoice) being enveloped. It is NOT necessarily the date time for transmission.
      The format of the value of this MUST include timezone information. May not be null. This field is mapped to XHE/Header/CreationDateTime .
      Returns:
      this
    • setCreationDateAndTimeNow

      @Nonnull public DBNAllianceXHEData setCreationDateAndTimeNow()
      Set the content of the fields that are mapped to XHE/Header/CreationDateTime to the current date and time.
      Returns:
      this
    • getFromPartyScheme

      @Nullable public String getFromPartyScheme()
      Returns:
      The from party participant identifier scheme. May be null if not initialized. This field is mapped to XHE/Header/FromParty/PartyIdentification/ID/@schemeID .
    • getFromPartyValue

      @Nullable public String getFromPartyValue()
      Returns:
      The from party participant identifier value. May be null if not initialized. This field is mapped to XHE/Header/FromParty/PartyIdentification/ID/.
    • getFromPartyAsIdentifier

      @Nullable public com.helger.peppolid.IParticipantIdentifier getFromPartyAsIdentifier()
      Returns:
      The from party participant identifier as a participant identifier or null if certain information are missing or are invalid.
    • setFromParty

      @Nonnull public DBNAllianceXHEData setFromParty(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
      Set the sender participant identifier.
      Parameters:
      sScheme - The DBNAlliance identifier scheme. May neither be null nor empty. This field is mapped to XHE/Header/FromParty/PartyIdentification/ID/@schemeID .
      sValue - The from party identifier value. May neither be null nor empty. This field is mapped to XHE/Header/FromParty/PartyIdentification/ID/.
      Returns:
      this
    • setFromParty

      @Nonnull public DBNAllianceXHEData setFromParty(@Nonnull com.helger.peppolid.IParticipantIdentifier aFromPartyID)
      Set the from party participant identifier.
      Parameters:
      aFromPartyID - The participant identifier to use. May not be null.
      Returns:
      this
    • getToPartyScheme

      @Nullable public String getToPartyScheme()
      Returns:
      The to party participant identifier scheme. May be null if not initialized. This field is mapped to XHE/Header/ToParty/PartyIdentification/ID/@schemeID .
    • getToPartyValue

      @Nullable public String getToPartyValue()
      Returns:
      The to party participant identifier value. May be null if not initialized. This field is mapped to XHE/Header/ToParty/PartyIdentification/ID/.
    • getToPartyAsIdentifier

      @Nullable public com.helger.peppolid.IParticipantIdentifier getToPartyAsIdentifier()
      Returns:
      The to party participant identifier as a participant identifier or null if certain information are missing or are invalid.
    • setToParty

      @Nonnull public DBNAllianceXHEData setToParty(@Nonnull @Nonempty String sScheme, @Nonnull @Nonempty String sValue)
      Set the to party participant identifier.
      Parameters:
      sScheme - The DBNAlliance identifier scheme. May neither be null nor empty. This field is mapped to XHE/Header/ToParty/PartyIdentification/ID/@schemeID .
      sValue - The to party identifier value. May neither be null nor empty. This field is mapped to XHE/Header/ToParty/PartyIdentification/ID/.
      Returns:
      this
    • setToParty

      @Nonnull public DBNAllianceXHEData setToParty(@Nonnull com.helger.peppolid.IParticipantIdentifier aToPartyID)
      Set the to party participant identifier.
      Parameters:
      aToPartyID - The participant identifier to use. May not be null.
      Returns:
      this
    • getPayloads

      @Nullable public List<DBNAlliancePayload> getPayloads()
      Get the list of payloads of the exchange header envelope. This field is mapped to XHE/Payloads .
      Returns:
      The payloads list .
    • setPayloads

      @Nonnull public DBNAllianceXHEData setPayloads(@Nonnull com.helger.commons.collection.impl.ICommonsList<DBNAlliancePayload> aPayloads)
      Set the list of payloads of the exchange header envelope (XHE).
      Parameters:
      aPayloads - The list of payloads to be set. May not be null.
      Returns:
      this
    • addPayload

      Set an individual payload.
      Parameters:
      aPayload - An individual payload to be added to the list of payloads. May not be null.
      Returns:
      this
    • areAllFieldsSet

      public boolean areAllFieldsSet(boolean bLogMissing)
      Parameters:
      bLogMissing - true if log messages should be emitted, false if not
      Returns:
      true if all mandatory fields required for creating an XHE are present, false if at least one field is not set.
    • areAllFieldsSet

      public boolean areAllFieldsSet()
      Returns:
      true if all mandatory fields required for creating an XHE are present, false if at least one field is not set.
    • getAsXHEDocument

      @Nonnull public com.helger.xhe.v10.XHE10XHEType getAsXHEDocument()
      Returns:
      A generic JAXB XHE document of this data. Never null.
      See Also: