Package com.helger.smpclient.url
Class PeppolURLProvider
java.lang.Object
com.helger.smpclient.url.PeppolURLProvider
- All Implemented Interfaces:
IPeppolURLProvider,ISMPURLProvider
The implementation of
Layout:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final IPeppolURLProviderThe default instance that should be usedstatic final PeppolURLProviderThe writable API of the default instancestatic final Charsetstatic final Locale -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDNSNameOfParticipant(com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, String sSMLZoneName) Get DNS record from ParticipantIdentifier.
Example PEPPOL PIiso6523-actorid-upis::0010:1234using BDX scheme would result inB-<hash over PI-Value>.<PI-Scheme>.<sml-zone-name>.static StringgetHashValueStringRepresentation(String sValueToHash) Get the MD5-hash-string-representation of the passed value using theURL_CHARSETencoding.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.helger.smpclient.url.IPeppolURLProvider
getDNSNameOfParticipant, getSMPURIOfParticipantMethods inherited from interface com.helger.smpclient.url.ISMPURLProvider
getSMPURIOfParticipant, getSMPURLOfParticipant, getSMPURLOfParticipant
-
Field Details
-
MUTABLE_INSTANCE
The writable API of the default instance -
INSTANCE
The default instance that should be used -
URL_CHARSET
-
URL_LOCALE
-
-
Constructor Details
-
PeppolURLProvider
public PeppolURLProvider()Default constructor.
-
-
Method Details
-
getHashValueStringRepresentation
Get the MD5-hash-string-representation of the passed value using theURL_CHARSETencoding. 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 benull.- Returns:
- The non-
nullString containing the hash value.
-
getDNSNameOfParticipant
@Nonnull public String getDNSNameOfParticipant(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nullable String sSMLZoneName) throws SMPDNSResolutionException Description copied from interface:IPeppolURLProviderGet DNS record from ParticipantIdentifier.
Example PEPPOL PIiso6523-actorid-upis::0010:1234using BDX scheme would result inB-<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:
getDNSNameOfParticipantin interfaceIPeppolURLProvider- Parameters:
aParticipantIdentifier- Participant identifier. May not benull.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.
-