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     */
020    package org.apache.directory.server.core.interceptor.context;
021    
022    
023    import java.util.Set;
024    
025    import org.apache.directory.server.core.CoreSession;
026    import org.apache.directory.shared.ldap.name.DN;
027    import org.apache.directory.shared.ldap.schema.AttributeTypeOptions;
028    
029    
030    /**
031     * A ListContext context used for Interceptors. It contains all the informations
032     * needed for the List operation, and used by all the interceptors
033     *
034     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
035     * @version $Rev$, $Date$
036     */
037    public class ListOperationContext extends SearchingOperationContext
038    {
039        /**
040         * Creates a new instance of ListOperationContext.
041         */
042        public ListOperationContext( CoreSession session )
043        {
044            super( session );
045        }
046    
047    
048        /**
049         * Creates a new instance of ListOperationContext.
050         *
051         * @param dn The DN to get the suffix from
052         */
053        public ListOperationContext( CoreSession session, DN dn )
054        {
055            super( session, dn );
056        }
057    
058    
059        /**
060         * Creates a new instance of ListOperationContext with attributes to return.
061         *
062         * @param session the session associated with this {@link OperationContext}
063         * @param dn the base DN 
064         * @param aliasDerefMode the alias dereferencing mode to use
065         * @param returningAttributes the attributes to return
066         */
067        public ListOperationContext( CoreSession session, DN dn, Set<AttributeTypeOptions> returningAttributes )
068        {
069            super( session, dn, returningAttributes );
070        }
071    
072    
073        /**
074         * @return the operation name
075         */
076        public String getName()
077        {
078            return "List";
079        }
080    
081        
082        /**
083         * @see Object#toString()
084         */
085        public String toString()
086        {
087            return "List with DN '" + getDn().getName() + "'";
088        }
089    }