Class LdapNetworkConnector

All Implemented Interfaces:
EventListener, NamespaceChangeListener, NamingListener, ObjectChangeListener, org.apache.activemq.Service

public class LdapNetworkConnector extends NetworkConnector implements NamespaceChangeListener, ObjectChangeListener
class to create dynamic network connectors listed in an directory server using the LDAP v3 protocol as defined in RFC 2251, the entries listed in the directory server must implement the ipHost and ipService objectClasses as defined in RFC 2307.
See Also:
  • Constructor Details

    • LdapNetworkConnector

      public LdapNetworkConnector()
  • Method Details

    • getUri

      public URI getUri()
      returns the next URI from the configured list
      Returns:
      random URI from the configured list
    • setUri

      public void setUri(URI uri) throws Exception
      sets the LDAP server URI
      Parameters:
      uri - LDAP server URI
      Throws:
      Exception
    • setBase

      public void setBase(String base)
      sets the base LDAP dn used for lookup operations
      Parameters:
      base - LDAP base dn
    • setUser

      public void setUser(String user)
      sets the LDAP user for access credentials
      Parameters:
      user - LDAP dn of user
    • setPassword

      public void setPassword(String password)
      sets the LDAP password for access credentials
      Overrides:
      setPassword in class NetworkBridgeConfiguration
      Parameters:
      password - user password
    • setAnonymousAuthentication

      public void setAnonymousAuthentication(boolean anonymousAuthentication)
      sets LDAP anonymous authentication access credentials
      Parameters:
      anonymousAuthentication - set to true to use anonymous authentication
    • setSearchScope

      public void setSearchScope(String searchScope) throws Exception
      sets the LDAP search scope
      Parameters:
      searchScope - LDAP JNDI search scope
      Throws:
      Exception
    • setSearchFilter

      public void setSearchFilter(String searchFilter)
      sets the LDAP search filter as defined in RFC 2254
      Parameters:
      searchFilter - LDAP search filter
      See Also:
    • setSearchEventListener

      public void setSearchEventListener(boolean searchEventListener)
      enables/disable a persistent search to the LDAP server as defined in draft-ietf-ldapext-psearch-03.txt (2.16.840.1.113730.3.4.3)
      Parameters:
      searchEventListener - enable = true, disable = false (default)
      See Also:
    • start

      public void start() throws Exception
      start the connector
      Specified by:
      start in interface org.apache.activemq.Service
      Overrides:
      start in class NetworkConnector
      Throws:
      Exception
    • stop

      public void stop() throws Exception
      stop the connector
      Specified by:
      stop in interface org.apache.activemq.Service
      Overrides:
      stop in class NetworkConnector
      Throws:
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addConnector

      protected void addConnector(SearchResult result) throws Exception
      add connector of the given URI
      Parameters:
      result - search result of connector to add
      Throws:
      Exception
    • removeConnector

      protected void removeConnector(SearchResult result) throws Exception
      remove connector of the given URI
      Parameters:
      result - search result of connector to remove
      Throws:
      Exception
    • toURI

      protected URI toURI(SearchResult result) throws Exception
      convert search result into URI
      Parameters:
      result - search result to convert to URI
      Throws:
      Exception
    • toUUID

      protected String toUUID(SearchResult result)
      convert search result into URI
      Parameters:
      result - search result to convert to URI
    • objectAdded

      public void objectAdded(NamingEvent event)
      invoked when an entry has been added during a persistent search
      Specified by:
      objectAdded in interface NamespaceChangeListener
    • objectRemoved

      public void objectRemoved(NamingEvent event)
      invoked when an entry has been removed during a persistent search
      Specified by:
      objectRemoved in interface NamespaceChangeListener
    • objectRenamed

      public void objectRenamed(NamingEvent event)
      invoked when an entry has been renamed during a persistent search
      Specified by:
      objectRenamed in interface NamespaceChangeListener
    • objectChanged

      public void objectChanged(NamingEvent event)
      invoked when an entry has been changed during a persistent search
      Specified by:
      objectChanged in interface ObjectChangeListener
    • namingExceptionThrown

      public void namingExceptionThrown(NamingExceptionEvent event)
      invoked when an exception has occurred during a persistent search
      Specified by:
      namingExceptionThrown in interface NamingListener