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 Duration
How often to test inactive connections.private static final String
Ldap activator period system property.private final ScheduledThreadPoolExecutor
Executor for testing inactive URLs.List of inactive URLs to test.private static final LdapURLActivatorService
Instance of this singleton. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
clear()
Removes all registered inactive URLs.Returns the list of inactive urls.static LdapURLActivatorService
Returns the instance of this singleton.static Duration
Returns the activator period.void
registerUrl
(LdapURL url) Registers an LDAP URL to be tested for activation.protected void
Tests 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.
-