Package com.helger.smpclient.url
Class AbstractBDXLURLProvider
java.lang.Object
com.helger.smpclient.url.AbstractBDXLURLProvider
- Direct Known Subclasses:
BDXLURLProvider,DBNAURLProviderSMP,PeppolNaptrURLProvider
An abstract implementation of
IBDXLURLProvider that support U-NAPTR
record resolution.- Since:
- 8.1.7
- Author:
- Philip Helger
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddDNSCacheEntries(Map<String, String> aEntries) Add entries to the cache.final voidaddDNSCacheEntry(String sName, String sNaptrValue) final voidRemove all internal DNS cache entries.final com.helger.commons.collection.impl.ICommonsList<InetAddress> final StringgetDNSCacheEntry(String sName) getDNSNameOfParticipant(com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, String sSMLZoneName) static StringgetHashValueStringRepresentation(String sValueToHash) Get the Base32 encoded (without padding), SHA-256 hash-string-representation of the passed value using theURL_CHARSETencoding.final StringgetSMPURIOfParticipant(com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, String sSMLZoneName) protected static StringinternalGetDNSName(com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, boolean bLowercaseValueBeforeHashing, boolean bAddIdentifierSchemeToZone, String sSMLZoneName) final booleanfinal booleanfinal booleanfinal booleanfinal voidsetAddIdentifierSchemeToZone(boolean bAddIdentifierSchemeToZone) final voidsetLowercaseValueBeforeHashing(boolean bLowercaseValueBeforeHashing) final voidsetNAPTRServiceName(String sNAPTRServiceName) final voidsetUseDNSCache(boolean bUseDNSCache) Enable or disable internal DNS caching.final voidsetUseNaptrDebug(boolean b) toString()
-
Field Details
-
DEFAULT_USE_DNS_CACHE
public static final boolean DEFAULT_USE_DNS_CACHE- See Also:
-
DEFAULT_NAPTR_DEBUG
public static final boolean DEFAULT_NAPTR_DEBUG- See Also:
-
URL_CHARSET
-
URL_LOCALE
-
-
Constructor Details
-
AbstractBDXLURLProvider
public AbstractBDXLURLProvider()Default constructor.
-
-
Method Details
-
isLowercaseValueBeforeHashing
public final boolean isLowercaseValueBeforeHashing() -
setLowercaseValueBeforeHashing
public final void setLowercaseValueBeforeHashing(boolean bLowercaseValueBeforeHashing) -
isAddIdentifierSchemeToZone
public final boolean isAddIdentifierSchemeToZone() -
setAddIdentifierSchemeToZone
public final void setAddIdentifierSchemeToZone(boolean bAddIdentifierSchemeToZone) -
getNAPTRServiceName
-
setNAPTRServiceName
-
isUseDNSCache
public final boolean isUseDNSCache() -
setUseDNSCache
public final void setUseDNSCache(boolean bUseDNSCache) Enable or disable internal DNS caching. By default it is enabled.- Parameters:
bUseDNSCache-trueto enable caching,falseto disable it.
-
clearDNSCache
public final void clearDNSCache()Remove all internal DNS cache entries. -
getDNSCacheEntry
-
getAllDNSCacheEntries
-
addDNSCacheEntries
Add entries to the cache. This might be helpful when there is a persistent cache (outside this class) and the old cache entries should be re-added.- Parameters:
aEntries- The entries to be added. May benull.
-
addDNSCacheEntry
-
customDNSServers
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsList<InetAddress> customDNSServers()- Returns:
- A mutable list of custom DNS servers to be used for resolving DNS
entries. Never
nullbut maybe empty.
-
isUseNaptrDebug
public final boolean isUseNaptrDebug() -
setUseNaptrDebug
public final void setUseNaptrDebug(boolean b) -
getHashValueStringRepresentation
Get the Base32 encoded (without padding), SHA-256 hash-string-representation of the passed value using theURL_CHARSETencoding.- Parameters:
sValueToHash- The value to be hashed. May not benull.- Returns:
- The non-
nullString containing the hash value.
-
internalGetDNSName
-
getDNSNameOfParticipant
@Nonnull public String getDNSNameOfParticipant(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nullable String sSMLZoneName) throws SMPDNSResolutionException - Throws:
SMPDNSResolutionException
-
getSMPURIOfParticipant
@Nonnull public URI getSMPURIOfParticipant(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, @Nullable String sSMLZoneName) throws SMPDNSResolutionException - Throws:
SMPDNSResolutionException
-
toString
-