org.apache.activemq.network
Class LdapNetworkConnector

java.lang.Object
  extended by org.apache.activemq.network.NetworkBridgeConfiguration
      extended by org.apache.activemq.network.NetworkConnector
          extended by org.apache.activemq.network.LdapNetworkConnector
All Implemented Interfaces:
java.util.EventListener, javax.naming.event.NamespaceChangeListener, javax.naming.event.NamingListener, javax.naming.event.ObjectChangeListener, Service

public class LdapNetworkConnector
extends NetworkConnector
implements javax.naming.event.NamespaceChangeListener, javax.naming.event.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.

Author:
Trevor Pounds
See Also:
RFC 2251, RFC 2307

Field Summary
 
Fields inherited from class org.apache.activemq.network.NetworkConnector
bridges, connectionFilter, localURI, serviceSupport
 
Constructor Summary
LdapNetworkConnector()
           
 
Method Summary
protected  void addConnector(javax.naming.directory.SearchResult result)
          add connector of the given URI
 java.net.URI getUri()
          returns the next URI from the configured list
 void namingExceptionThrown(javax.naming.event.NamingExceptionEvent event)
          invoked when an exception has occurred during a persistent search
 void objectAdded(javax.naming.event.NamingEvent event)
          invoked when an entry has been added during a persistent search
 void objectChanged(javax.naming.event.NamingEvent event)
          invoked when an entry has been changed during a persistent search
 void objectRemoved(javax.naming.event.NamingEvent event)
          invoked when an entry has been removed during a persistent search
 void objectRenamed(javax.naming.event.NamingEvent event)
          invoked when an entry has been renamed during a persistent search
protected  void removeConnector(javax.naming.directory.SearchResult result)
          remove connector of the given URI
 void setAnonymousAuthentication(boolean _anonymousAuthentication)
          sets LDAP anonymous authentication access credentials
 void setBase(java.lang.String _base)
          sets the base LDAP dn used for lookup operations
 void setPassword(java.lang.String _password)
          sets the LDAP password for access credentials
 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)
 void setSearchFilter(java.lang.String _searchFilter)
          sets the LDAP search filter as defined in RFC 2254
 void setSearchScope(java.lang.String _searchScope)
          sets the LDAP search scope
 void setUri(java.net.URI _uri)
          sets the LDAP server URI
 void setUser(java.lang.String _user)
          sets the LDAP user for access credentials
 void start()
          start the connector
 void stop()
          stop the connector
 java.lang.String toString()
           
protected  java.net.URI toURI(javax.naming.directory.SearchResult result)
          convert search result into URI
protected  java.lang.String toUUID(javax.naming.directory.SearchResult result)
          convert search result into URI
 
Methods inherited from class org.apache.activemq.network.NetworkConnector
activeBridges, addDynamicallyIncludedDestination, addExcludedDestination, addStaticallyIncludedDestination, configureBridge, createLocalTransport, createNetworkBridgeObjectName, getBrokerService, getConnectionFilter, getDurableDestinations, getDynamicallyIncludedDestinations, getExcludedDestinations, getLocalUri, getObjectName, getStaticallyIncludedDestinations, handleStart, handleStop, isStarted, isStopped, isStopping, registerNetworkBridgeMBean, removeDemandSubscription, setBrokerService, setConnectionFilter, setDurableDestinations, setDynamicallyIncludedDestinations, setExcludedDestinations, setLocalUri, setObjectName, setStaticallyIncludedDestinations, unregisterNetworkBridgeMBean
 
Methods inherited from class org.apache.activemq.network.NetworkBridgeConfiguration
getBrokerName, getBrokerURL, getConsumerPriorityBase, getDestinationFilter, getName, getNetworkTTL, getPassword, getPrefetchSize, getUserName, isAlwaysSyncSend, isBridgeTempDestinations, isConduitSubscriptions, isDecreaseNetworkConsumerPriority, isDispatchAsync, isDuplex, isDynamicOnly, isStaticBridge, isSuppressDuplicateQueueSubscriptions, isSuppressDuplicateTopicSubscriptions, setAlwaysSyncSend, setBridgeTempDestinations, setBrokerName, setBrokerURL, setConduitSubscriptions, setConsumerPriorityBase, setDecreaseNetworkConsumerPriority, setDestinationFilter, setDispatchAsync, setDuplex, setDynamicOnly, setName, setNetworkTTL, setPrefetchSize, setStaticBridge, setSuppressDuplicateQueueSubscriptions, setSuppressDuplicateTopicSubscriptions, setUserName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LdapNetworkConnector

public LdapNetworkConnector()
Method Detail

getUri

public java.net.URI getUri()
returns the next URI from the configured list

Returns:
random URI from the configured list

setUri

public void setUri(java.net.URI _uri)
            throws java.lang.Exception
sets the LDAP server URI

Parameters:
_uri - LDAP server URI
Throws:
java.lang.Exception

setBase

public void setBase(java.lang.String _base)
sets the base LDAP dn used for lookup operations

Parameters:
_base - LDAP base dn

setUser

public void setUser(java.lang.String _user)
sets the LDAP user for access credentials

Parameters:
_user - LDAP dn of user

setPassword

public void setPassword(java.lang.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(java.lang.String _searchScope)
                    throws java.lang.Exception
sets the LDAP search scope

Parameters:
_searchScope - LDAP JNDI search scope
Throws:
java.lang.Exception

setSearchFilter

public void setSearchFilter(java.lang.String _searchFilter)
sets the LDAP search filter as defined in RFC 2254

Parameters:
_searchFilter - LDAP search filter
See Also:
RFC 2254

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:
draft-ietf-ldapext-psearch-03.txt

start

public void start()
           throws java.lang.Exception
start the connector

Specified by:
start in interface Service
Overrides:
start in class NetworkConnector
Throws:
java.lang.Exception

stop

public void stop()
          throws java.lang.Exception
stop the connector

Specified by:
stop in interface Service
Overrides:
stop in class NetworkConnector
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addConnector

protected void addConnector(javax.naming.directory.SearchResult result)
                     throws java.lang.Exception
add connector of the given URI

Parameters:
result - search result of connector to add
Throws:
java.lang.Exception

removeConnector

protected void removeConnector(javax.naming.directory.SearchResult result)
                        throws java.lang.Exception
remove connector of the given URI

Parameters:
result - search result of connector to remove
Throws:
java.lang.Exception

toURI

protected java.net.URI toURI(javax.naming.directory.SearchResult result)
                      throws java.lang.Exception
convert search result into URI

Parameters:
result - search result to convert to URI
Throws:
java.lang.Exception

toUUID

protected java.lang.String toUUID(javax.naming.directory.SearchResult result)
convert search result into URI

Parameters:
result - search result to convert to URI

objectAdded

public void objectAdded(javax.naming.event.NamingEvent event)
invoked when an entry has been added during a persistent search

Specified by:
objectAdded in interface javax.naming.event.NamespaceChangeListener

objectRemoved

public void objectRemoved(javax.naming.event.NamingEvent event)
invoked when an entry has been removed during a persistent search

Specified by:
objectRemoved in interface javax.naming.event.NamespaceChangeListener

objectRenamed

public void objectRenamed(javax.naming.event.NamingEvent event)
invoked when an entry has been renamed during a persistent search

Specified by:
objectRenamed in interface javax.naming.event.NamespaceChangeListener

objectChanged

public void objectChanged(javax.naming.event.NamingEvent event)
invoked when an entry has been changed during a persistent search

Specified by:
objectChanged in interface javax.naming.event.ObjectChangeListener

namingExceptionThrown

public void namingExceptionThrown(javax.naming.event.NamingExceptionEvent event)
invoked when an exception has occurred during a persistent search

Specified by:
namingExceptionThrown in interface javax.naming.event.NamingListener


Copyright © 2005-2012. All Rights Reserved.