Class AbstractBDXLURLProvider

java.lang.Object
com.helger.smpclient.url.AbstractBDXLURLProvider
Direct Known Subclasses:
BDXLURLProvider, DBNAURLProviderSMP, PeppolNaptrURLProvider

@ThreadSafe public abstract class AbstractBDXLURLProvider extends Object
An abstract implementation of IBDXLURLProvider that support U-NAPTR record resolution.
Since:
8.1.7
Author:
Philip Helger
  • 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

      public static final Charset URL_CHARSET
    • URL_LOCALE

      public static final Locale 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

      @Nonnull @Nonempty public final String getNAPTRServiceName()
    • setNAPTRServiceName

      public final void setNAPTRServiceName(@Nonnull @Nonempty String sNAPTRServiceName)
    • 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 - true to enable caching, false to disable it.
    • clearDNSCache

      public final void clearDNSCache()
      Remove all internal DNS cache entries.
    • getDNSCacheEntry

      @Nullable public final String getDNSCacheEntry(@Nullable String sName)
    • getAllDNSCacheEntries

      @Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsMap<String,String> getAllDNSCacheEntries()
    • addDNSCacheEntries

      public final void addDNSCacheEntries(@Nullable Map<String,String> aEntries)
      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 be null.
    • addDNSCacheEntry

      public final void addDNSCacheEntry(@Nonnull @Nonempty String sName, @Nonnull String sNaptrValue)
    • 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 null but maybe empty.
    • isUseNaptrDebug

      public final boolean isUseNaptrDebug()
    • setUseNaptrDebug

      public final void setUseNaptrDebug(boolean b)
    • getHashValueStringRepresentation

      @Nonnull public static String getHashValueStringRepresentation(@Nonnull String sValueToHash)
      Get the Base32 encoded (without padding), SHA-256 hash-string-representation of the passed value using the URL_CHARSET encoding.
      Parameters:
      sValueToHash - The value to be hashed. May not be null.
      Returns:
      The non-null String containing the hash value.
    • internalGetDNSName

      @Nonnull protected static String internalGetDNSName(@Nonnull com.helger.peppolid.IParticipantIdentifier aParticipantIdentifier, boolean bLowercaseValueBeforeHashing, boolean bAddIdentifierSchemeToZone, @Nullable String sSMLZoneName)
    • 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

      public String toString()
      Overrides:
      toString in class Object