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