Package org.apache.activemq.network
Class LdapNetworkConnector
- java.lang.Object
-
- org.apache.activemq.network.NetworkBridgeConfiguration
-
- org.apache.activemq.network.NetworkConnector
-
- 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.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.network.NetworkConnector
bridges, connectionFilter, localURI, serviceSupport
-
Fields inherited from class org.apache.activemq.network.NetworkBridgeConfiguration
dynamicallyIncludedDestinations, excludedDestinations, staticallyIncludedDestinations
-
-
Constructor Summary
Constructors Constructor Description LdapNetworkConnector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addConnector(SearchResult result)
add connector of the given URIURI
getUri()
returns the next URI from the configured listvoid
namingExceptionThrown(NamingExceptionEvent event)
invoked when an exception has occurred during a persistent searchvoid
objectAdded(NamingEvent event)
invoked when an entry has been added during a persistent searchvoid
objectChanged(NamingEvent event)
invoked when an entry has been changed during a persistent searchvoid
objectRemoved(NamingEvent event)
invoked when an entry has been removed during a persistent searchvoid
objectRenamed(NamingEvent event)
invoked when an entry has been renamed during a persistent searchprotected void
removeConnector(SearchResult result)
remove connector of the given URIvoid
setAnonymousAuthentication(boolean anonymousAuthentication)
sets LDAP anonymous authentication access credentialsvoid
setBase(String base)
sets the base LDAP dn used for lookup operationsvoid
setPassword(String password)
sets the LDAP password for access credentialsvoid
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 2254void
setSearchScope(String searchScope)
sets the LDAP search scopevoid
setUri(URI uri)
sets the LDAP server URIvoid
setUser(String user)
sets the LDAP user for access credentialsvoid
start()
start the connectorvoid
stop()
stop the connectorString
toString()
protected URI
toURI(SearchResult result)
convert search result into URIprotected 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, getDurableTopicDestinations, getLocalUri, getObjectName, handleStart, handleStop, isStarted, isStopped, isStopping, registerNetworkBridgeMBean, removeDemandSubscription, setBrokerService, setConnectionFilter, setDurableDestinations, setLocalUri, setObjectName, unregisterNetworkBridgeMBean
-
Methods inherited from class org.apache.activemq.network.NetworkBridgeConfiguration
getAdvisoryAckPercentage, getAdvisoryPrefetchSize, getBridgeFactory, getBrokerName, getBrokerURL, getClientIdToken, getConsumerPriorityBase, getConsumerTTL, getDestinationFilter, getDynamicallyIncludedDestinations, getExcludedDestinations, getGcSweepTime, getMessageTTL, getName, getNetworkTTL, getPassword, getPrefetchSize, getRemotePassword, getRemoteUserName, getSslContext, getStaticallyIncludedDestinations, getUserName, isAdvisoryForFailedForward, isAlwaysSyncSend, isBridgeTempDestinations, isCheckDuplicateMessagesOnDuplex, isConduitNetworkQueueSubscriptions, isConduitSubscriptions, isDecreaseNetworkConsumerPriority, isDispatchAsync, isDuplex, isDynamicOnly, isGcDestinationViews, isStaticBridge, isSuppressDuplicateQueueSubscriptions, isSuppressDuplicateTopicSubscriptions, isSyncDurableSubs, isUseBrokerNamesAsIdSeed, isUseCompression, isUseVirtualDestSubs, isUseVirtualDestSus, setAdvisoryAckPercentage, setAdvisoryForFailedForward, setAdvisoryPrefetchSize, setAlwaysSyncSend, setBridgeFactory, setBridgeTempDestinations, setBrokerName, setBrokerURL, setCheckDuplicateMessagesOnDuplex, setClientIdToken, setConduitNetworkQueueSubscriptions, setConduitSubscriptions, setConsumerPriorityBase, setConsumerTTL, setDecreaseNetworkConsumerPriority, setDestinationFilter, setDispatchAsync, setDuplex, setDynamicallyIncludedDestinations, setDynamicOnly, setExcludedDestinations, setGcDestinationViews, setGcSweepTime, setMessageTTL, setName, setNetworkTTL, setPrefetchSize, setRemotePassword, setRemoteUserName, setSslContext, setStaticallyIncludedDestinations, setStaticBridge, setSuppressDuplicateQueueSubscriptions, setSuppressDuplicateTopicSubscriptions, setSyncDurableSubs, setUseBrokerNameAsIdSees, setUseCompression, setUserName, setUseVirtualDestSubs
-
-
-
-
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 classNetworkBridgeConfiguration
- 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 interfaceService
- Overrides:
start
in classNetworkConnector
- Throws:
Exception
-
stop
public void stop() throws Exception
stop the connector- Specified by:
stop
in interfaceService
- Overrides:
stop
in classNetworkConnector
- Throws:
Exception
-
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 interfaceNamespaceChangeListener
-
objectRemoved
public void objectRemoved(NamingEvent event)
invoked when an entry has been removed during a persistent search- Specified by:
objectRemoved
in interfaceNamespaceChangeListener
-
objectRenamed
public void objectRenamed(NamingEvent event)
invoked when an entry has been renamed during a persistent search- Specified by:
objectRenamed
in interfaceNamespaceChangeListener
-
objectChanged
public void objectChanged(NamingEvent event)
invoked when an entry has been changed during a persistent search- Specified by:
objectChanged
in interfaceObjectChangeListener
-
namingExceptionThrown
public void namingExceptionThrown(NamingExceptionEvent event)
invoked when an exception has occurred during a persistent search- Specified by:
namingExceptionThrown
in interfaceNamingListener
-
-