Class PeppolURLProvider

java.lang.Object
com.helger.smpclient.url.PeppolURLProvider
All Implemented Interfaces:
IPeppolURLProvider, ISMPURLProvider

@Immutable public class PeppolURLProvider extends Object implements IPeppolURLProvider
The implementation of IPeppolURLProvider suitable for the Peppol Network to resolve CNAME records.
Layout: "B-"+hexstring(md5(lowercase(ID-VALUE)))+"."+ID-SCHEME+"."+SML-ZONE-NAME
Author:
Philip Helger
  • Field Details

    • MUTABLE_INSTANCE

      public static final PeppolURLProvider MUTABLE_INSTANCE
      The writable API of the default instance
    • INSTANCE

      public static final IPeppolURLProvider INSTANCE
      The default instance that should be used
    • URL_CHARSET

      public static final Charset URL_CHARSET
    • URL_LOCALE

      public static final Locale URL_LOCALE
  • Constructor Details

    • PeppolURLProvider

      public PeppolURLProvider()
      Default constructor.
  • Method Details

    • getHashValueStringRepresentation

      @Nonnull public static String getHashValueStringRepresentation(@Nonnull String sValueToHash)
      Get the MD5-hash-string-representation of the passed value using the URL_CHARSET encoding. Each hash byte is represented as 2 characters in the range [0-9a-f]. Note: the hash value creation is done case sensitive! The caller needs to ensure that the value to hash is lower case!
      Parameters:
      sValueToHash - The value to be hashed. May not be null.
      Returns:
      The non-null String containing the hash value.
    • getDNSNameOfParticipant

      @Nonnull public String getDNSNameOfParticipant(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nullable String sSMLZoneName) throws SMPDNSResolutionException
      Description copied from interface: IPeppolURLProvider
      Get DNS record from ParticipantIdentifier.
      Example PEPPOL PI iso6523-actorid-upis::0010:1234 using BDX scheme would result in B-<hash over PI-Value>.<PI-Scheme>.<sml-zone-name> . This method ensures that the hash value is created from the UTF-8 lower case value of the identifier. The result string never ends with a dot!
      Specified by:
      getDNSNameOfParticipant in interface IPeppolURLProvider
      Parameters:
      aParticipantIdentifier - Participant identifier. May not be null.
      sSMLZoneName - e.g. sml.peppolcentral.org.. May be empty. If it is not empty, it must end with a dot!
      Returns:
      DNS record. It does not contain any prefix like http:// or any path suffix. It is the plain DNS host name. Since version 1.1.4 this method returns the DNS name without the trailing dot!
      Throws:
      SMPDNSResolutionException - If the URL resolution failed.