public interface ValidationPolicyConfig extends Config
This is extended by the connection validation policy configuration.
Modifier and Type | Interface and Description |
---|---|
static class |
ValidationPolicyConfig.Type
Policy type.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addAddress(String address)
Add an address.
|
boolean |
addHostName(String hostName)
Add a host name.
|
ValidationPolicyLocaleConfig |
addLocale(String country,
String language)
Adds a Locale to the policy.
|
boolean |
addResolvedName(String resolvedName)
Add a resolved name.
|
List<String> |
getAddresses()
Get list of configured addresses.
|
List<String> |
getHostNames()
Get list of configured host names
|
List<ValidationPolicyLocaleConfig> |
getLocales()
Returns a list of the configured locales.
|
String |
getName()
Gets the policy name.
|
List<String> |
getResolvedNames()
Get list of resolved names.
|
ValidationPolicyConfig.Type |
getType()
Gets the policy type.
|
boolean |
hasHostNames() |
boolean |
hasLocales()
Indicates whether any locales have been defined.
|
boolean |
hasResolvedNames()
Returns true if any resolved names have been defined.
|
boolean |
isConnection()
Deprecated.
since 6.5. This method always returns true and will be
removed in a future release.
|
boolean |
isSubscription()
Deprecated.
since 6.5. This method always returns false and will be
removed in a future release.
|
void |
removeAddresses()
Remove all addresses.
|
void |
removeHostNames()
Remove all host names.
|
void |
removeLocales()
Remove all locales from the configuration.
|
void |
removeResolvedNames()
Remove all resolved names.
|
void |
setType(ValidationPolicyConfig.Type type)
Sets the policy type.
|
boolean |
validate(String address,
String hostName,
String resolvedName,
Locale locale)
Check to see if the supplied details are valid for this policy.
|
String getName()
@Deprecated boolean isSubscription()
@Deprecated boolean isConnection()
ConnectionValidationPolicyConfig
.void setType(ValidationPolicyConfig.Type type)
The default is ValidationPolicyConfig.Type.BLACKLIST
but this may be used to change it.
type
- the policy typeValidationPolicyConfig.Type getType()
List<String> getAddresses()
Each address is an IP address (or regex) to match against a client.
boolean addAddress(String address)
address
- the addressvoid removeAddresses()
List<String> getHostNames()
Each name is a hostname (or regex) of a client.
boolean addHostName(String hostName)
hostName
- the host nameboolean hasHostNames()
void removeHostNames()
List<String> getResolvedNames()
Each name is the resolved hostname (or regex) of a client, as returned by the WhoIs service.
boolean addResolvedName(String resolvedName)
resolvedName
- the resolved nameboolean hasResolvedNames()
void removeResolvedNames()
ValidationPolicyLocaleConfig addLocale(String country, String language) throws ConfigException
Either a country or a language , or both must be specified.
country
- the country code or null if not to be checkedlanguage
- the language code or null if not to be checkedConfigException
- if unable to add localeList<ValidationPolicyLocaleConfig> getLocales()
boolean hasLocales()
void removeLocales()
boolean validate(String address, String hostName, String resolvedName, Locale locale)
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.
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.Copyright © 2021 Push Technology Ltd. All Rights Reserved.