Who-Is style lookups are better performed within authentication handlers and therefore the WhoIs service will be withdrawn in a future release
@Deprecated public interface WhoIsConfig extends Config
This defines the WhoIs service that runs within a Diffusion server. It would normally run asset up by default but this give the option of changing it.
Every time a Client connection is made the WhoIs service is called to resolve location details using the Client IP address. The results of each such lookup are cached so that repeat connections from the same IP do not have the lookup overhead. The service has a number of threads configured to perform lookups.
The service has a 'provider' class which is user written to extract the required information from a WhoIs lookup. A default provider is issued and by default that is what is used.
The WhoIs service provider that is contacted to resolve the WhoIs requests may also be configured. By default 'ripe' is used.
Modifier and Type | Method and Description |
---|---|
int |
getCacheMaximumSize()
Deprecated.
Gets the maximum size of the WhoIs cache.
|
long |
getCacheRetentionTime()
Deprecated.
Gets the retention time for WhoIs cache entries.
|
long |
getCacheTidyInterval()
Deprecated.
Gets the WhoIs cache tidy interval.
|
String |
getHost()
Deprecated.
Gets the WhoIs host.
|
int |
getPort()
Deprecated.
Gets the port.
|
String |
getProvider()
Deprecated.
Gets the provider class.
|
int |
getThreads()
Deprecated.
Gets the number of resolver threads.
|
boolean |
isEnabled()
Deprecated.
Indicates whether the WhoIs service is enabled.
|
void |
setCacheMaximumSize(int maximum)
Deprecated.
Sets the maximum size of the WhoIs cache.
|
void |
setCacheRetentionTime(long retention)
Deprecated.
Sets retention time for WhoIs cache entries.
|
void |
setCacheTidyInterval(long interval)
Deprecated.
Sets the WhoIs cache tidy interval.
|
void |
setEnabled(boolean enabled)
Deprecated.
Set WhoIs enabled.
|
void |
setHost(String host)
Deprecated.
Sets the whois host.
|
void |
setPort(int port)
Deprecated.
Sets the WhoIs port.
|
void |
setProvider(String className)
Deprecated.
Sets the provider class.
|
void |
setThreads(int numberOfThreads)
Deprecated.
Sets the number of resolver threads used by the WhoIs service.
|
void setEnabled(boolean enabled) throws ConfigException
By default the WhoIs service is disabled. This may be used to enable it.
enabled
- true to enable, false to disableConfigException
- if unable to set the propertyboolean isEnabled()
void setProvider(String className) throws ConfigException
If this is not specified, the issued default provider is used (
WhoIsDefaultProvider
).
className
- Name of the WhoIs provider class that must be on the
classpath and must implement the API class WhoIsProvider.ConfigException
- if unable to set the propertyString getProvider()
void setThreads(int numberOfThreads) throws ConfigException
If this is not specified, the default is 2.
More can be assigned if a delay in resolving Client details is experience due to large number of concurrently connecting Clients.
numberOfThreads
- The number of background threads that will process
WhoIs resolver requests.ConfigException
- if unable to set the propertyint getThreads()
void setHost(String host) throws ConfigException
The host name of a WhoIs provider which adheres to the RFC3912 WhoIs protocol.
The WhoIs service connects to the specified host to make WhoIs requests.
If this is not specified, "whois.ripe.net" is used.
host
- name or ip addressConfigException
- if unable to set the propertyString getHost()
void setPort(int port) throws ConfigException
The port number that the WhoIs provider listens on (normally 43).
If not specified, 43 is assumed.
port
- numberConfigException
- if unable to set the propertyint getPort()
void setCacheMaximumSize(int maximum) throws ConfigException
The maximum number of entries in the WhoIs cache. When the cache size exceeds this number it will be tidied.
A value of 0 means the cache will grow indefinitely unless entries are removed because they have exceeded their retention time. It is therefore important that if 0 is specified, the retention time is not also 0.
If not specified, a value of 1000 is assumed.
maximum
- the maximum cache sizeConfigException
- if unable to set the propertyint getCacheMaximumSize()
void setCacheRetentionTime(long retention) throws ConfigException
The time for which WhoIs cache entries are retained before being deleted. A value of 0 means entries are retained indefinitely or until the cache reaches its maximum size. It is therefore important that if this is set to 0, the maximum cache size is not also set to 0.
If not set, 0 is assumed.
retention
- value in millisecondsConfigException
- if unable to set the propertylong getCacheRetentionTime()
void setCacheTidyInterval(long interval) throws ConfigException
The interval at which the Whois cache tidier task will check if any cache entries have passed their retention time or if the cache has exceeded its maximum size. This would be ignored if both maximum and retention are 0.
If this is not specified, an interval of 1 hour is assumed.
interval
- in millisecondsConfigException
- if unable to set the propertylong getCacheTidyInterval()
Copyright © 2021 Push Technology Ltd. All Rights Reserved.