Package org.ldaptive

Class LdapURLActivatorService

java.lang.Object
org.ldaptive.LdapURLActivatorService

public final class LdapURLActivatorService extends Object
Singleton which manages a single thread that periodically tests inactive LDAP URLs.
  • Field Details

    • ACTIVATOR_PERIOD_PROPERTY

      private static final String ACTIVATOR_PERIOD_PROPERTY
      Ldap activator period system property.
      See Also:
    • ACTIVATOR_PERIOD

      private static final Duration ACTIVATOR_PERIOD
      How often to test inactive connections.
    • INSTANCE

      private static final LdapURLActivatorService INSTANCE
      Instance of this singleton.
    • inactiveUrls

      private final List<LdapURL> inactiveUrls
      List of inactive URLs to test.
    • executor

      private final ScheduledThreadPoolExecutor executor
      Executor for testing inactive URLs.
  • Constructor Details

    • LdapURLActivatorService

      private LdapURLActivatorService()
      Default constructor.
  • Method Details

    • getInstance

      public static LdapURLActivatorService getInstance()
      Returns the instance of this singleton.
      Returns:
      LDAP URL activator service
    • getPeriod

      public static Duration getPeriod()
      Returns the activator period.
      Returns:
      activator period
    • registerUrl

      public void registerUrl(LdapURL url)
      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

      public List<LdapURL> 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.