Interface ValidationPolicyConfig

All Superinterfaces:
Config
All Known Subinterfaces:
ConnectionValidationPolicyConfig

public interface ValidationPolicyConfig extends Config
Validation Policy Configuration.

This is extended by the connection validation policy configuration.

Since:
4.4
  • Method Details

    • getName

      String getName()
      Gets the policy name.
      Returns:
      policy name
    • setType

      void setType(ValidationPolicyConfig.Type type)
      Sets the policy type.

      The default is ValidationPolicyConfig.Type.BLACKLIST but this may be used to change it.

      Parameters:
      type - the policy type
    • getType

      Gets the policy type.
      Returns:
      policy type
    • getAddresses

      List<String> getAddresses()
      Get list of configured addresses.

      Each address is an IP address (or regex) to match against a client.

      Returns:
      addresses
    • addAddress

      boolean addAddress(String address)
      Add an address.
      Parameters:
      address - the address
      Returns:
      true if added or false if already present
    • removeAddresses

      void removeAddresses()
      Remove all addresses.
    • getHostNames

      List<String> getHostNames()
      Get list of configured host names

      Each name is a hostname (or regex) of a client.

      Returns:
      host names
    • addHostName

      boolean addHostName(String hostName)
      Add a host name.
      Parameters:
      hostName - the host name
      Returns:
      true if added or false if already present
    • hasHostNames

      boolean hasHostNames()
      Returns:
      true if host names declared
    • removeHostNames

      void removeHostNames()
      Remove all host names.
    • getResolvedNames

      List<String> getResolvedNames()
      Get list of resolved names.

      Each name is the resolved hostname (or regex) of a client.

      Returns:
      list of resolved names
    • addResolvedName

      boolean addResolvedName(String resolvedName)
      Add a resolved name.
      Parameters:
      resolvedName - the resolved name
      Returns:
      true if added or false if already present
    • hasResolvedNames

      boolean hasResolvedNames()
      Returns true if any resolved names have been defined.
      Returns:
      true if there are one or more resolved names
    • removeResolvedNames

      void removeResolvedNames()
      Remove all resolved names.
    • addLocale

      ValidationPolicyLocaleConfig addLocale(String country, String language) throws ConfigException
      Adds a Locale to the policy.

      Either a country or a language , or both must be specified.

      Parameters:
      country - the country code or null if not to be checked
      language - the language code or null if not to be checked
      Returns:
      the Locale object
      Throws:
      ConfigException - if unable to add locale
    • getLocales

      Returns a list of the configured locales.
      Returns:
      list of locales
    • hasLocales

      boolean hasLocales()
      Indicates whether any locales have been defined.
      Returns:
      true if there are one or more locales
    • removeLocales

      void removeLocales()
      Remove all locales from the configuration.
    • validate

      boolean validate(String address, String hostName, String resolvedName, Locale locale)
      Check to see if the supplied details are valid for this policy.

      Each parameter supplied is checked against the corresponding details of the policy.

      In the case of a blacklist, false would be returned if any supplied information matches any policy information and true if there were no matches.

      In the case of a whitelist, true would be returned if any supplied information matches any policy information or false if there were no matches.

      Parameters:
      address - the address to check against the policy addresses - if null, the address will not be checked.
      hostName - the host name to check against the policy host names - if null, the host name will not be checked
      resolvedName - the resolved name to check against the policy resolved names - if null, the resolved name will no be checked
      locale - The locale to check against the policy locale, if null, locale check is not performed.
      Returns:
      true if the details pass the policy validation or false if they do not.