001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2008 Sun Microsystems, Inc.
015 * Portions Copyright 2015 ForgeRock AS.
016 */
017package org.opends.server.protocols.internal;
018
019
020
021import org.opends.server.types.DirectoryException;
022import org.opends.server.types.SearchResultEntry;
023import org.opends.server.types.SearchResultReference;
024
025
026
027/**
028 * This interface defines the methods that must be implemented by a
029 * class that wishes to perform an internal search operation and be
030 * notified of matching entries and referrals as they arrive rather
031 * than altogether when the search has completed.
032 */
033@org.opends.server.types.PublicAPI(
034     stability=org.opends.server.types.StabilityLevel.UNCOMMITTED,
035     mayInstantiate=false,
036     mayExtend=true,
037     mayInvoke=false)
038public interface InternalSearchListener
039{
040  /**
041   * Performs any processing necessary for the provided search result
042   * entry.
043   *
044   * @param  searchOperation  The internal search operation being
045   *                          processed.
046   * @param  searchEntry      The matching search result entry to be
047   *                          processed.
048   *
049   * @throws  DirectoryException  If a problem occurred while handling
050   *                              the provided entry.  Search
051   *                              processing will be terminated, and
052   *                              the search operation will result
053   *                              will be set based on this exception.
054   */
055  void handleInternalSearchEntry(
056                   InternalSearchOperation searchOperation,
057                   SearchResultEntry searchEntry)
058         throws DirectoryException;
059
060
061
062  /**
063   * Performs any processing necessary for the provided search result
064   * reference.
065   *
066   * @param  searchOperation  The internal search operation being
067   *                          processed.
068   * @param  searchReference  The search result reference to be
069   *                          processed.
070   *
071   * @throws  DirectoryException  If a problem occurred while handling
072   *                              the provided entry.  Search
073   *                              processing will be terminated, and
074   *                              the search operation will result
075   *                              will be set based on this exception.
076   */
077  void handleInternalSearchReference(
078                   InternalSearchOperation searchOperation,
079                   SearchResultReference searchReference)
080         throws DirectoryException;
081}
082