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:
EventListener, NamespaceChangeListener, NamingListener, ObjectChangeListener, 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:
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(SearchResult result)
          add connector of the given URI
 URI getUri()
          returns the next URI from the configured list
 void namingExceptionThrown(NamingExceptionEvent event)
          invoked when an exception has occurred during a persistent search
 void objectAdded(NamingEvent event)
          invoked when an entry has been added during a persistent search
 void objectChanged(NamingEvent event)
          invoked when an entry has been changed during a persistent search
 void objectRemoved(NamingEvent event)
          invoked when an entry has been removed during a persistent search
 void objectRenamed(NamingEvent event)
          invoked when an entry has been renamed during a persistent search
protected  void removeConnector(SearchResult result)
          remove connector of the given URI
 void setAnonymousAuthentication(boolean anonymousAuthentication)
          sets LDAP anonymous authentication access credentials
 void setBase(String base)
          sets the base LDAP dn used for lookup operations
 void setPassword(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(String searchFilter)
          sets the LDAP search filter as defined in RFC 2254
 void setSearchScope(String searchScope)
          sets the LDAP search scope
 void setUri(URI uri)
          sets the LDAP server URI
 void setUser(String user)
          sets the LDAP user for access credentials
 void start()
          start the connector
 void stop()
          stop the connector
 String toString()
           
protected  URI toURI(SearchResult result)
          convert search result into URI
protected  String toUUID(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, isUseCompression, setAlwaysSyncSend, setBridgeTempDestinations, setBrokerName, setBrokerURL, setConduitSubscriptions, setConsumerPriorityBase, setDecreaseNetworkConsumerPriority, setDestinationFilter, setDispatchAsync, setDuplex, setDynamicOnly, setName, setNetworkTTL, setPrefetchSize, setStaticBridge, setSuppressDuplicateQueueSubscriptions, setSuppressDuplicateTopicSubscriptions, setUseCompression, 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 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:
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 Exception
start the connector

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

stop

public void stop()
          throws Exception
stop the connector

Specified by:
stop in interface 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


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.