Class LDAPv3PersistentSearch<T,​H>

    • 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 an IdRepoListener 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 - The IdRepoListener instance that needs to be notified about changes.
        supportedTypes - The supported IdTypes for which events needs to be generated.
      • removeListener

        public void removeListener​(T idRepoListener)
        Removes an IdRepoListener if it was registered to persistent search notifications. The caller must ensure that calls to addListener/removeListener/hasListeners invocations are synchronized correctly.
        Parameters:
        idRepoListener - The IdRepoListener 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()
      • getListeners

        protected Map<T,​H> getListeners()
      • getSearchResultEntryHandler

        protected abstract LDAPv3PersistentSearch.SearchResultEntryHandler getSearchResultEntryHandler()
        Returns the SearchResultEntryHandler for the concrete implementation.
        Returns:
        The SearchResultEntryHandler for this implementation.
      • isShutdown

        protected boolean isShutdown()