Class SearchOperationWrapper

    • Constructor Detail

      • SearchOperationWrapper

        protected SearchOperationWrapper​(SearchOperation search)
        Creates a new search operation based on the provided search operation.
        Parameters:
        search - The search operation to wrap
    • Method Detail

      • returnEntry

        public boolean returnEntry​(Entry entry,
                                   List<Control> controls)
        Description copied from interface: SearchOperation
        Used as a callback for backends to indicate that the provided entry matches the search criteria and that additional processing should be performed to potentially send it back to the client.
        Specified by:
        returnEntry in interface SearchOperation
        Parameters:
        entry - The entry that matches the search criteria and should be sent to the client.
        controls - The set of controls to include with the entry (may be null if none are needed).
        Returns:
        true if the caller should continue processing the search request and sending additional entries and references, or false if not for some reason (e.g., the size limit has been reached or the search has been abandoned).
      • returnEntry

        public boolean returnEntry​(Entry entry,
                                   List<Control> controls,
                                   boolean evaluateAci)
        Description copied from interface: SearchOperation
        Used as a callback for backends to indicate that the provided entry matches the search criteria and that additional processing should be performed to potentially send it back to the client.
        Specified by:
        returnEntry in interface SearchOperation
        Parameters:
        entry - The entry that matches the search criteria and should be sent to the client.
        controls - The set of controls to include with the entry (may be null if none are needed).
        evaluateAci - Indicates whether the access rights to the entry should be evaluated.
        Returns:
        true if the caller should continue processing the search request and sending additional entries and references, or false if not for some reason (e.g., the size limit has been reached or the search has been abandoned).
      • returnPersistentSearchEntry

        public boolean returnPersistentSearchEntry​(Entry entry,
                                                   List<Control> controls)
        Description copied from interface: SearchOperation
        Used as a callback for persistent searches to send an entry which has just changed to the client. Contrary to SearchOperation.returnEntry(Entry, List), the entry is not matched against the state kept to dereference aliases during the search phase, and neither the size limit nor the time limit of the search applies to it: a persistent search must report every change it is notified of, for as long as it is alive, whether or not the entry was returned before.
        Specified by:
        returnPersistentSearchEntry in interface SearchOperation
        Parameters:
        entry - The entry which has changed and should be sent to the client.
        controls - The set of controls to include with the entry (may be null if none are needed).
        Returns:
        true if the persistent search should keep reporting changes, or false if it should stop for some reason (e.g. the search has been abandoned).
      • endSearchPhase

        public void endSearchPhase()
        Description copied from interface: SearchOperation
        Indicates that the search phase is over and that any further entry comes from a persistent search. State kept to dereference aliases during the search phase is released. Entries can still reach SearchOperation.returnEntry(Entry, List) afterwards, as backends are free to report their own results from another thread, so that method keeps track of this phase being over.
        Specified by:
        endSearchPhase in interface SearchOperation
      • returnReference

        public boolean returnReference​(DN dn,
                                       SearchResultReference reference)
        Description copied from interface: SearchOperation
        Used as a callback for backends to indicate that the provided search reference was encountered during processing and that additional processing should be performed to potentially send it back to the client.
        Specified by:
        returnReference in interface SearchOperation
        Parameters:
        dn - The DN related to the specified search reference.
        reference - The search reference to send to the client.
        Returns:
        true if the caller should continue processing the search request and sending additional entries and references , or false if not for some reason (e.g., the size limit has been reached or the search has been abandoned).
      • returnReference

        public boolean returnReference​(DN dn,
                                       SearchResultReference reference,
                                       boolean evaluateAci)
        Description copied from interface: SearchOperation
        Used as a callback for backends to indicate that the provided search reference was encountered during processing and that additional processing should be performed to potentially send it back to the client.
        Specified by:
        returnReference in interface SearchOperation
        Parameters:
        dn - The DN related to the specified search reference.
        reference - The search reference to send to the client.
        evaluateAci - Indicates whether the access rights to the entry should be evaluated.
        Returns:
        true if the caller should continue processing the search request and sending additional entries and references , or false if not for some reason (e.g., the size limit has been reached or the search has been abandoned).
      • getAttributes

        public Set<String> getAttributes()
        Description copied from interface: SearchOperation
        Retrieves the set of requested attributes for this search operation. Its contents should not be altered.
        Specified by:
        getAttributes in interface SearchOperation
        Returns:
        The set of requested attributes for this search operation.
      • getBaseDN

        public DN getBaseDN()
        Description copied from interface: SearchOperation
        Retrieves the base DN for this search operation. This should not be called by pre-parse plugins, as the raw base DN will not yet have been processed. Instead, they should use the getRawBaseDN method.
        Specified by:
        getBaseDN in interface SearchOperation
        Returns:
        The base DN for this search operation, or null if the raw base DN has not yet been processed.
      • getEntriesSent

        public int getEntriesSent()
        Description copied from interface: SearchOperation
        Retrieves the number of entries sent to the client for this search operation.
        Specified by:
        getEntriesSent in interface SearchOperation
        Returns:
        The number of entries sent to the client for this search operation.
      • getFilter

        public SearchFilter getFilter()
        Description copied from interface: SearchOperation
        Retrieves the filter for this search operation. This should not be called by pre-parse plugins, because the raw filter will not yet have been processed.
        Specified by:
        getFilter in interface SearchOperation
        Returns:
        The filter for this search operation, or null if the raw filter has not yet been processed.
      • getRawBaseDN

        public ByteString getRawBaseDN()
        Description copied from interface: SearchOperation
        Retrieves the raw, unprocessed base DN as included in the request from the client. This may or may not contain a valid DN, as no validation will have been performed.
        Specified by:
        getRawBaseDN in interface SearchOperation
        Returns:
        The raw, unprocessed base DN as included in the request from the client.
      • getRawFilter

        public RawFilter getRawFilter()
        Description copied from interface: SearchOperation
        Retrieves the raw, unprocessed search filter as included in the request from the client. It may or may not contain a valid filter (e.g., unsupported attribute types or values with an invalid syntax) because no validation will have been performed on it.
        Specified by:
        getRawFilter in interface SearchOperation
        Returns:
        The raw, unprocessed search filter as included in the request from the client.
      • getReferencesSent

        public int getReferencesSent()
        Description copied from interface: SearchOperation
        Retrieves the number of search references sent to the client for this search operation.
        Specified by:
        getReferencesSent in interface SearchOperation
        Returns:
        The number of search references sent to the client for this search operation.
      • getSizeLimit

        public int getSizeLimit()
        Description copied from interface: SearchOperation
        Retrieves the size limit for this search operation.
        Specified by:
        getSizeLimit in interface SearchOperation
        Returns:
        The size limit for this search operation.
      • getTimeLimit

        public int getTimeLimit()
        Description copied from interface: SearchOperation
        Retrieves the time limit for this search operation.
        Specified by:
        getTimeLimit in interface SearchOperation
        Returns:
        The time limit for this search operation.
      • getTypesOnly

        public boolean getTypesOnly()
        Description copied from interface: SearchOperation
        Retrieves the typesOnly flag for this search operation.
        Specified by:
        getTypesOnly in interface SearchOperation
        Returns:
        The typesOnly flag for this search operation.
      • sendSearchResultDone

        public void sendSearchResultDone()
        Description copied from interface: SearchOperation
        Sends the search result done message to the client. Note that this method should only be called from external classes in special cases (e.g., persistent search) where they are sure that the result won't be sent by the core server. Also note that the result code and optionally the error message should have been set for this operation before this method is called.
        Specified by:
        sendSearchResultDone in interface SearchOperation
      • setAttributes

        public void setAttributes​(Set<String> attributes)
        Description copied from interface: SearchOperation
        Specifies the set of requested attributes for this search operation. It should only be called by pre-parse plugins.
        Specified by:
        setAttributes in interface SearchOperation
        Parameters:
        attributes - The set of requested attributes for this search operation.
      • setBaseDN

        public void setBaseDN​(DN baseDN)
        Description copied from interface: SearchOperation
        Specifies the base DN for this search operation. This method is only intended for internal use.
        Specified by:
        setBaseDN in interface SearchOperation
        Parameters:
        baseDN - The base DN for this search operation.
      • setDerefPolicy

        public void setDerefPolicy​(DereferenceAliasesPolicy derefPolicy)
        Description copied from interface: SearchOperation
        Specifies the alias dereferencing policy for this search operation. This should only be called by pre-parse plugins.
        Specified by:
        setDerefPolicy in interface SearchOperation
        Parameters:
        derefPolicy - The alias dereferencing policy for this search operation.
      • setRawBaseDN

        public void setRawBaseDN​(ByteString rawBaseDN)
        Description copied from interface: SearchOperation
        Specifies the raw, unprocessed base DN as included in the request from the client. This method should only be called by pre-parse plugins.
        Specified by:
        setRawBaseDN in interface SearchOperation
        Parameters:
        rawBaseDN - The raw, unprocessed base DN as included in the request from the client.
      • setRawFilter

        public void setRawFilter​(RawFilter rawFilter)
        Description copied from interface: SearchOperation
        Specifies the raw, unprocessed search filter as included in the request from the client. This method should only be called by pre-parse plugins.
        Specified by:
        setRawFilter in interface SearchOperation
        Parameters:
        rawFilter - The raw, unprocessed search filter as included in the request from the client.
      • setScope

        public void setScope​(SearchScope scope)
        Description copied from interface: SearchOperation
        Specifies the scope for this search operation. This should only be called by pre-parse plugins.
        Specified by:
        setScope in interface SearchOperation
        Parameters:
        scope - The scope for this search operation.
      • setSizeLimit

        public void setSizeLimit​(int sizeLimit)
        Description copied from interface: SearchOperation
        Specifies the size limit for this search operation. This should only be called by pre-parse plugins.
        Specified by:
        setSizeLimit in interface SearchOperation
        Parameters:
        sizeLimit - The size limit for this search operation.
      • setTimeLimit

        public void setTimeLimit​(int timeLimit)
        Description copied from interface: SearchOperation
        Specifies the time limit for this search operation. This should only be called by pre-parse plugins.
        Specified by:
        setTimeLimit in interface SearchOperation
        Parameters:
        timeLimit - The time limit for this search operation.
      • setTypesOnly

        public void setTypesOnly​(boolean typesOnly)
        Description copied from interface: SearchOperation
        Specifies the typesOnly flag for this search operation. This should only be called by pre-parse plugins.
        Specified by:
        setTypesOnly in interface SearchOperation
        Parameters:
        typesOnly - The typesOnly flag for this search operation.
      • setTimeLimitExpiration

        public void setTimeLimitExpiration​(long timeLimitExpiration)
        Description copied from interface: SearchOperation
        Set the time after which the search time limit has expired.
        Specified by:
        setTimeLimitExpiration in interface SearchOperation
        Parameters:
        timeLimitExpiration - - Time after which the search has expired
      • isReturnSubentriesOnly

        public boolean isReturnSubentriesOnly()
        Description copied from interface: SearchOperation
        Indicates whether LDAP subentries should be returned or not.
        Specified by:
        isReturnSubentriesOnly in interface SearchOperation
        Returns:
        true if the LDAP subentries should be returned, false otherwise
      • setReturnSubentriesOnly

        public void setReturnSubentriesOnly​(boolean returnLDAPSubentries)
        Description copied from interface: SearchOperation
        Set the flag indicating whether the LDAP subentries should be returned.
        Specified by:
        setReturnSubentriesOnly in interface SearchOperation
        Parameters:
        returnLDAPSubentries - - Boolean indicating whether the LDAP subentries should be returned or not
      • isIncludeUsableControl

        public boolean isIncludeUsableControl()
        Description copied from interface: SearchOperation
        Indicates whether to include the account usable response control with search result entries or not.
        Specified by:
        isIncludeUsableControl in interface SearchOperation
        Returns:
        true if the usable control has to be part of the search result entry
      • setIncludeUsableControl

        public void setIncludeUsableControl​(boolean includeUsableControl)
        Description copied from interface: SearchOperation
        Specify whether to include the account usable response control within the search result entries.
        Specified by:
        setIncludeUsableControl in interface SearchOperation
        Parameters:
        includeUsableControl - - True if the account usable response control has to be included within the search result entries, false otherwise
      • getTimeLimitExpiration

        public long getTimeLimitExpiration()
        Description copied from interface: SearchOperation
        Get the time after which the search time limit has expired.
        Specified by:
        getTimeLimitExpiration in interface SearchOperation
        Returns:
        the timeLimitExpiration
      • isClientAcceptsReferrals

        public boolean isClientAcceptsReferrals()
        Description copied from interface: SearchOperation
        Indicates whether the client is able to handle referrals.
        Specified by:
        isClientAcceptsReferrals in interface SearchOperation
        Returns:
        true, if the client is able to handle referrals
      • setClientAcceptsReferrals

        public void setClientAcceptsReferrals​(boolean clientAcceptReferrals)
        Description copied from interface: SearchOperation
        Specify whether the client is able to handle referrals.
        Specified by:
        setClientAcceptsReferrals in interface SearchOperation
        Parameters:
        clientAcceptReferrals - - Boolean set to true if the client can handle referrals
      • isSendResponse

        public boolean isSendResponse()
        Description copied from interface: SearchOperation
        Indicates whether the search result done message has to be sent to the client, or not.
        Specified by:
        isSendResponse in interface SearchOperation
        Returns:
        true if the search result done message is to be sent to the client
      • setSendResponse

        public void setSendResponse​(boolean sendResponse)
        Description copied from interface: SearchOperation
        Specify whether the search result done message has to be sent to the client, or not.
        Specified by:
        setSendResponse in interface SearchOperation
        Parameters:
        sendResponse - - boolean indicating whether the search result done message is to send to the client
      • isRealAttributesOnly

        public boolean isRealAttributesOnly()
        Description copied from interface: SearchOperation
        Returns true if only real attributes should be returned.
        Specified by:
        isRealAttributesOnly in interface SearchOperation
        Returns:
        true if only real attributes should be returned, false otherwise
      • setRealAttributesOnly

        public void setRealAttributesOnly​(boolean realAttributesOnly)
        Description copied from interface: SearchOperation
        Specify whether to only return real attributes.
        Specified by:
        setRealAttributesOnly in interface SearchOperation
        Parameters:
        realAttributesOnly - - boolean setup to true, if only the real attributes should be returned
      • isVirtualAttributesOnly

        public boolean isVirtualAttributesOnly()
        Description copied from interface: SearchOperation
        Returns true if only virtual attributes should be returned.
        Specified by:
        isVirtualAttributesOnly in interface SearchOperation
        Returns:
        true if only virtual attributes should be returned, false otherwise
      • setVirtualAttributesOnly

        public void setVirtualAttributesOnly​(boolean virtualAttributesOnly)
        Description copied from interface: SearchOperation
        Specify whether to only return virtual attributes.
        Specified by:
        setVirtualAttributesOnly in interface SearchOperation
        Parameters:
        virtualAttributesOnly - - boolean setup to true, if only the virtual attributes should be returned
      • sendSearchReference

        public boolean sendSearchReference​(SearchResultReference reference)
                                    throws DirectoryException
        Description copied from interface: SearchOperation
        Sends the provided search result reference to the client.
        Specified by:
        sendSearchReference in interface SearchOperation
        Parameters:
        reference - The search result reference to be sent to the client.
        Returns:
        true if the client is able to accept referrals, or false if the client cannot handle referrals and no more attempts should be made to send them for the associated search operation.
        Throws:
        DirectoryException - If a problem occurs while attempting to send the reference to the client and the search should be terminated.