001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020package org.apache.directory.server.core.api.filtering;
021
022
023import java.util.List;
024
025import org.apache.directory.api.ldap.model.cursor.Cursor;
026import org.apache.directory.api.ldap.model.entry.Entry;
027import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
028
029
030/**
031 * A wrapper on top of a Cursor used to filter entries we get from the backend.
032 *
033 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
034 */
035public interface EntryFilteringCursor extends Cursor<Entry>
036{
037    /**
038     * Adds an entry filter to this BaseEntryFilteringCursor at the very end of 
039     * the filter list.  EntryFilters are applied in the order of addition.
040     * 
041     * @param filter a filter to apply to the entries
042     * @return the result of {@link List#add(Object)}
043     */
044    boolean addEntryFilter( EntryFilter filter );
045
046
047    /**
048     * Gets an unmodifiable list of EntryFilters applied.
049     *
050     * @return an unmodifiable list of EntryFilters applied
051     */
052    List<EntryFilter> getEntryFilters();
053
054
055    /**
056     * @return the operationContext
057     */
058    SearchOperationContext getOperationContext();
059}