Package com.iplanet.services.ldap.event
Class LDAPv3PersistentSearch<T,H>
- java.lang.Object
-
- com.iplanet.services.ldap.event.LDAPv3PersistentSearch<T,H>
-
- Type Parameters:
T- Type of listener.H- Supported token types.
- Direct Known Subclasses:
CTSDJLDAPv3PersistentSearch,DJLDAPv3PersistentSearch
public abstract class LDAPv3PersistentSearch<T,H> extends Object
An abstract implementation of LDAPv3 persistent searches.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceLDAPv3PersistentSearch.SearchResultEntryHandlerThis interface represents the ability of a listener to return result entries.
-
Constructor Summary
Constructors Constructor Description LDAPv3PersistentSearch(int retryInterval, org.forgerock.opendj.ldap.DN searchBaseDN, org.forgerock.opendj.ldap.Filter searchFilter, org.forgerock.opendj.ldap.SearchScope searchScope, ConnectionFactory factory, String... attributeNames)Generate a new LDAPv3PersistentSearch.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddListener(T idRepoListener, H supportedTypes)Adds anIdRepoListenerobject, which needs to be notified about persistent search results.protected abstract voidclearCaches()protected Map<T,H>getListeners()protected abstract LDAPv3PersistentSearch.SearchResultEntryHandlergetSearchResultEntryHandler()Returns theSearchResultEntryHandlerfor the concrete implementation.booleanhasListeners()Checks if there are any registered listeners for this persistent search connection.protected booleanisShutdown()voidremoveListener(T idRepoListener)Removes anIdRepoListenerif it was registered to persistent search notifications.voidstartQuery()Starts the persistent search connection against the directory.voidstopSearch()Stops the persistent search request, and terminates the LDAP connection.
-
-
-
Constructor Detail
-
LDAPv3PersistentSearch
public LDAPv3PersistentSearch(int retryInterval, org.forgerock.opendj.ldap.DN searchBaseDN, org.forgerock.opendj.ldap.Filter searchFilter, org.forgerock.opendj.ldap.SearchScope searchScope, ConnectionFactory factory, String... attributeNames)Generate a new LDAPv3PersistentSearch.- Parameters:
retryInterval- How frequently to reconnect (in milliseconds).searchBaseDN- The base DN from which to perform the query.searchFilter- The filter which forms the query's parameters.searchScope- The scope of the search, from the searchBaseDN.factory- A connection factory used to produce connections down to LDAP.attributeNames- Attribute names which will be returned alongside the DN of the query-resulted objects.
-
-
Method Detail
-
addListener
public void addListener(T idRepoListener, H supportedTypes)
Adds anIdRepoListenerobject, which needs to be notified about persistent search results. The caller must ensure that calls to addListener/removeListener/hasListeners invocations are synchronized correctly.- Parameters:
idRepoListener- TheIdRepoListenerinstance that needs to be notified about changes.supportedTypes- The supportedIdTypes for which events needs to be generated.
-
removeListener
public void removeListener(T idRepoListener)
Removes anIdRepoListenerif it was registered to persistent search notifications. The caller must ensure that calls to addListener/removeListener/hasListeners invocations are synchronized correctly.- Parameters:
idRepoListener- TheIdRepoListenerinstance that needs to be notified about changes.
-
hasListeners
public boolean hasListeners()
Checks if there are any registered listeners for this persistent search connection. The caller must ensure that calls to addListener/removeListener/hasListeners invocations are synchronized correctly.
-
startQuery
public void startQuery() throws DataLayerExceptionStarts the persistent search connection against the directory. The caller must ensure that calls made to startPSearch and stopPsearch are properly synchronized.- Throws:
DataLayerException- if the initial connection could not be created.
-
stopSearch
public void stopSearch()
Stops the persistent search request, and terminates the LDAP connection. The caller must ensure that calls made to startPSearch and stopPsearch are properly synchronized.
-
clearCaches
protected abstract void clearCaches()
-
getSearchResultEntryHandler
protected abstract LDAPv3PersistentSearch.SearchResultEntryHandler getSearchResultEntryHandler()
Returns theSearchResultEntryHandlerfor the concrete implementation.- Returns:
- The
SearchResultEntryHandlerfor this implementation.
-
isShutdown
protected boolean isShutdown()
-
-