Package org.ldaptive
Class LdapURLActivatorService
java.lang.Object
org.ldaptive.LdapURLActivatorService
Singleton which manages a single thread that periodically tests inactive LDAP URLs.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DurationHow often to test inactive connections.private static final StringLdap activator period system property.private final ScheduledThreadPoolExecutorExecutor for testing inactive URLs.List of inactive URLs to test.private static final LdapURLActivatorServiceInstance of this singleton. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidclear()Removes all registered inactive URLs.Returns the list of inactive urls.static LdapURLActivatorServiceReturns the instance of this singleton.static DurationReturns the activator period.voidregisterUrl(LdapURL url) Registers an LDAP URL to be tested for activation.protected voidTests each registered URL.
-
Field Details
-
ACTIVATOR_PERIOD_PROPERTY
Ldap activator period system property.- See Also:
-
ACTIVATOR_PERIOD
How often to test inactive connections. -
INSTANCE
Instance of this singleton. -
inactiveUrls
List of inactive URLs to test. -
executor
Executor for testing inactive URLs.
-
-
Constructor Details
-
LdapURLActivatorService
private LdapURLActivatorService()Default constructor.
-
-
Method Details
-
getInstance
Returns the instance of this singleton.- Returns:
- LDAP URL activator service
-
getPeriod
Returns the activator period.- Returns:
- activator period
-
registerUrl
Registers an LDAP URL to be tested for activation. Once a URL becomes active it is automatically removed.- Parameters:
url- that is inactive and should be tested to become active
-
getInactiveUrls
Returns the list of inactive urls.- Returns:
- inactive urls
-
testInactiveUrls
protected void testInactiveUrls()Tests each registered URL. Removes URLs that successfully activated. -
clear
void clear()Removes all registered inactive URLs.
-