Interface ValidationPolicyConfig
- All Superinterfaces:
Config
- All Known Subinterfaces:
ConnectionValidationPolicyConfig
This is extended by the connection validation policy configuration.
- Since:
- 4.4
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionboolean
addAddress
(String address) Add an address.boolean
addHostName
(String hostName) Add a host name.Adds a Locale to the policy.boolean
addResolvedName
(String resolvedName) Add a resolved name.Get list of configured addresses.Get list of configured host namesReturns a list of the configured locales.getName()
Gets the policy name.Get list of resolved names.getType()
Gets the policy type.boolean
boolean
Indicates whether any locales have been defined.boolean
Returns true if any resolved names have been defined.void
Remove all addresses.void
Remove all host names.void
Remove all locales from the configuration.void
Remove all resolved names.void
Sets the policy type.boolean
Check to see if the supplied details are valid for this policy.
-
Method Details
-
getName
String getName()Gets the policy name.- Returns:
- policy name
-
setType
Sets the policy type.The default is
ValidationPolicyConfig.Type.BLACKLIST
but this may be used to change it.- Parameters:
type
- the policy type
-
getType
ValidationPolicyConfig.Type getType()Gets the policy type.- Returns:
- policy type
-
getAddresses
Get list of configured addresses.Each address is an IP address (or regex) to match against a client.
- Returns:
- addresses
-
addAddress
Add an address.- Parameters:
address
- the address- Returns:
- true if added or false if already present
-
removeAddresses
void removeAddresses()Remove all addresses. -
getHostNames
Get list of configured host namesEach name is a hostname (or regex) of a client.
- Returns:
- host names
-
addHostName
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
Get list of resolved names.Each name is the resolved hostname (or regex) of a client.
- Returns:
- list of resolved names
-
addResolvedName
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
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 checkedlanguage
- the language code or null if not to be checked- Returns:
- the Locale object
- Throws:
ConfigException
- if unable to add locale
-
getLocales
List<ValidationPolicyLocaleConfig> 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
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 checkedresolvedName
- the resolved name to check against the policy resolved names - if null, the resolved name will no be checkedlocale
- 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.
-