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 interface
LDAPv3PersistentSearch.SearchResultEntryHandler
This 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 void
addListener(T idRepoListener, H supportedTypes)
Adds anIdRepoListener
object, which needs to be notified about persistent search results.protected abstract void
clearCaches()
protected Map<T,H>
getListeners()
protected abstract LDAPv3PersistentSearch.SearchResultEntryHandler
getSearchResultEntryHandler()
Returns theSearchResultEntryHandler
for the concrete implementation.boolean
hasListeners()
Checks if there are any registered listeners for this persistent search connection.protected boolean
isShutdown()
void
removeListener(T idRepoListener)
Removes anIdRepoListener
if it was registered to persistent search notifications.void
startQuery()
Starts the persistent search connection against the directory.void
stopSearch()
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 anIdRepoListener
object, 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
- TheIdRepoListener
instance that needs to be notified about changes.supportedTypes
- The supportedIdType
s for which events needs to be generated.
-
removeListener
public void removeListener(T idRepoListener)
Removes anIdRepoListener
if it was registered to persistent search notifications. The caller must ensure that calls to addListener/removeListener/hasListeners invocations are synchronized correctly.- Parameters:
idRepoListener
- TheIdRepoListener
instance 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 DataLayerException
Starts 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 theSearchResultEntryHandler
for the concrete implementation.- Returns:
- The
SearchResultEntryHandler
for this implementation.
-
isShutdown
protected boolean isShutdown()
-
-