View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.ldap.server.interceptor;
18  
19  
20  import java.util.Iterator;
21  import java.util.Map;
22  
23  import javax.naming.Name;
24  import javax.naming.NamingEnumeration;
25  import javax.naming.NamingException;
26  import javax.naming.directory.Attributes;
27  import javax.naming.directory.ModificationItem;
28  import javax.naming.directory.SearchControls;
29  
30  import org.apache.ldap.common.filter.ExprNode;
31  import org.apache.ldap.server.configuration.DirectoryPartitionConfiguration;
32  import org.apache.ldap.server.partition.DirectoryPartitionNexus;
33  
34  
35  /***
36   * Represents the next {@link Interceptor} in the interceptor chain.
37   *
38   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
39   * @version $Rev: 307079 $, $Date: 2005-10-07 06:38:21 -0400 (Fri, 07 Oct 2005) $
40   * @see Interceptor
41   * @see InterceptorChain
42   */
43  public interface NextInterceptor
44  {
45      /***
46       * Calls the next interceptor's {@link Interceptor#compare(NextInterceptor,Name,String,Object)}.
47       */
48      boolean compare(Name name, String oid, Object value ) throws NamingException;
49      
50      /***
51       * Calls the next interceptor's {@link Interceptor#getRootDSE(NextInterceptor)}.
52       */
53      Attributes getRootDSE() throws NamingException; 
54      /***
55       * Calls the next interceptor's {@link Interceptor#getMatchedName(NextInterceptor, Name, boolean)}.
56       */
57      Name getMatchedName( Name name, boolean normalized ) throws NamingException;
58      /***
59       * Calls the next interceptor's {@link Interceptor#getSuffix(NextInterceptor, Name, boolean)}.
60       */
61      Name getSuffix( Name name, boolean normalized ) throws NamingException;
62      /***
63       * Calls the next interceptor's {@link Interceptor#listSuffixes(NextInterceptor, boolean)}.
64       */
65      Iterator listSuffixes( boolean normalized ) throws NamingException;
66      /***
67       * Calls the next interceptor's {@link DirectoryPartitionNexus#addContextPartition(DirectoryPartitionConfiguration)}.
68       */
69      void addContextPartition( DirectoryPartitionConfiguration cfg ) throws NamingException;
70      /***
71       * Calls the next interceptor's {@link DirectoryPartitionNexus#removeContextPartition(Name)}.
72       */
73      void removeContextPartition( Name suffix ) throws NamingException;
74      /***
75       * Calls the next interceptor's {@link Interceptor#delete(NextInterceptor, Name)}.
76       */
77      void delete( Name name ) throws NamingException;
78      /***
79       * Calls the next interceptor's {@link Interceptor#add(NextInterceptor, String, Name, Attributes)}.
80       */
81      void add( String userProvidedName, Name normalizedName, Attributes entry ) throws NamingException;
82      /***
83       * Calls the next interceptor's {@link Interceptor#modify(NextInterceptor, Name, int, Attributes)}.
84       */
85      void modify( Name name, int modOp, Attributes attributes ) throws NamingException;
86      /***
87       * Calls the next interceptor's {@link Interceptor#modify(NextInterceptor, Name, ModificationItem[])}.
88       */
89      void modify( Name name, ModificationItem[] items ) throws NamingException;
90      /***
91       * Calls the next interceptor's {@link Interceptor#list(NextInterceptor, Name)}.
92       */
93      NamingEnumeration list( Name baseName ) throws NamingException;
94      /***
95       * Calls the next interceptor's {@link Interceptor#search(NextInterceptor, Name, Map, ExprNode, SearchControls)}.
96       */
97      NamingEnumeration search( Name baseName, Map environment, ExprNode filter,
98                                SearchControls searchControls ) throws NamingException;
99      /***
100      * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor, Name)}.
101      */
102     Attributes lookup( Name name ) throws NamingException;
103     /***
104      * Calls the next interceptor's {@link Interceptor#lookup(NextInterceptor, Name, String[])}.
105      */
106     Attributes lookup( Name name, String [] attrIds ) throws NamingException;
107     /***
108      * Calls the next interceptor's {@link Interceptor#hasEntry(NextInterceptor, Name)}.
109      */
110     boolean hasEntry( Name name ) throws NamingException;
111     /***
112      * Calls the next interceptor's {@link Interceptor#isSuffix(NextInterceptor, Name)}.
113      */
114     boolean isSuffix( Name name ) throws NamingException;
115     /***
116      * Calls the next interceptor's {@link Interceptor#modifyRn(NextInterceptor, Name, String, boolean)}.
117      */
118     void modifyRn( Name name, String newRn, boolean deleteOldRn ) throws NamingException;
119     /***
120      * Calls the next interceptor's {@link Interceptor#move(NextInterceptor, Name, Name)}.
121      */
122     void move( Name oldName, Name newParentName ) throws NamingException;
123     /***
124      * Calls the next interceptor's {@link Interceptor#move(NextInterceptor, Name, Name, String, boolean)}.
125      */
126     void move( Name oldName, Name newParentName, String newRn,
127                boolean deleteOldRn ) throws NamingException;
128 }