View Javadoc

1   /*
2    *   Licensed to the Apache Software Foundation (ASF) under one
3    *   or more contributor license agreements.  See the NOTICE file
4    *   distributed with this work for additional information
5    *   regarding copyright ownership.  The ASF licenses this file
6    *   to you under the Apache License, Version 2.0 (the
7    *   "License"); you may not use this file except in compliance
8    *   with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   *   Unless required by applicable law or agreed to in writing,
13   *   software distributed under the License is distributed on an
14   *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *   KIND, either express or implied.  See the License for the
16   *   specific language governing permissions and limitations
17   *   under the License.
18   *
19   */
20  package org.apache.directory.server.core.partition;
21  
22  
23  import java.util.Collection;
24  import java.util.Collections;
25  import java.util.HashSet;
26  
27  import org.apache.directory.server.core.authn.AuthenticationInterceptor;
28  import org.apache.directory.server.core.authz.AciAuthorizationInterceptor;
29  import org.apache.directory.server.core.authz.DefaultAuthorizationInterceptor;
30  import org.apache.directory.server.core.changelog.ChangeLogInterceptor;
31  import org.apache.directory.server.core.collective.CollectiveAttributeInterceptor;
32  import org.apache.directory.server.core.event.EventInterceptor;
33  import org.apache.directory.server.core.exception.ExceptionInterceptor;
34  import org.apache.directory.server.core.interceptor.Interceptor;
35  import org.apache.directory.server.core.normalization.NormalizationInterceptor;
36  import org.apache.directory.server.core.operational.OperationalAttributeInterceptor;
37  import org.apache.directory.server.core.schema.SchemaInterceptor;
38  import org.apache.directory.server.core.subtree.SubentryInterceptor;
39  import org.apache.directory.server.core.trigger.TriggerInterceptor;
40  
41  
42  /**
43   * TODO ByPassConstants.
44   *
45   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
46   * @version $Rev$, $Date$
47   */
48  public class ByPassConstants
49  {
50      /**
51       * safe to use set of bypass instructions to lookup raw entries
52       */
53      public final static Collection<String> LOOKUP_BYPASS;
54  
55      /**
56       * safe to use set of bypass instructions to lookup raw entries while
57       * also avoiding hit on collective attributes {@link Interceptor}: used 
58       * by collective attributes interceptor.
59       */
60      public static final Collection<String> LOOKUP_COLLECTIVE_BYPASS;
61  
62      /**
63       * bypass instructions used by ExceptionInterceptor
64       */
65      public final static Collection<String> HAS_ENTRY_BYPASS;
66  
67      /**
68       * safe to use set of bypass instructions to getMatchedDn
69       */
70      public static final Collection<String> GETMATCHEDDN_BYPASS;
71  
72      /**
73       * safe to use set of bypass instructions to lookup raw entries excluding operational attributes
74       */
75      public static final Collection<String> LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS;
76      
77      public static final Collection<String> GET_ROOT_DSE_BYPASS;
78  
79      /**
80       * Bypass String to use when ALL interceptors should be skipped
81       */
82      public static final String BYPASS_ALL = "*";
83  
84      /**
85       * Bypass String to use when ALL interceptors should be skipped
86       */
87      public static final Collection<String> BYPASS_ALL_COLLECTION = Collections.singleton( BYPASS_ALL );
88  
89      
90      static
91      {
92          Collection<String> c = new HashSet<String>();
93          c.add( NormalizationInterceptor.class.getName() );
94          c.add( AuthenticationInterceptor.class.getName() );
95          c.add( AciAuthorizationInterceptor.class.getName() );
96          c.add( DefaultAuthorizationInterceptor.class.getName() );
97          c.add( OperationalAttributeInterceptor.class.getName() );
98          c.add( SchemaInterceptor.class.getName() );
99          c.add( SubentryInterceptor.class.getName() );
100         c.add( EventInterceptor.class.getName() );
101         LOOKUP_BYPASS = Collections.unmodifiableCollection( c );
102 
103         c = new HashSet<String>();
104         c.add( NormalizationInterceptor.class.getName() );
105         c.add( AuthenticationInterceptor.class.getName() );
106         c.add( AciAuthorizationInterceptor.class.getName() );
107         c.add( DefaultAuthorizationInterceptor.class.getName() );
108         c.add( ExceptionInterceptor.class.getName() );
109         c.add( OperationalAttributeInterceptor.class.getName() );
110         c.add( SchemaInterceptor.class.getName() );
111         c.add( SubentryInterceptor.class.getName() );
112         c.add( EventInterceptor.class.getName() );
113         HAS_ENTRY_BYPASS = Collections.unmodifiableCollection( c );
114 
115         c = new HashSet<String>();
116         c.add( NormalizationInterceptor.class.getName() );
117         c.add( AuthenticationInterceptor.class.getName() );
118         c.add( AciAuthorizationInterceptor.class.getName() );
119         c.add( DefaultAuthorizationInterceptor.class.getName() );
120         c.add( CollectiveAttributeInterceptor.class.getName() );
121         c.add( OperationalAttributeInterceptor.class.getName() );
122         c.add( SchemaInterceptor.class.getName() );
123         c.add( SubentryInterceptor.class.getName() );
124         c.add( EventInterceptor.class.getName() );
125         LOOKUP_COLLECTIVE_BYPASS = Collections.unmodifiableCollection( c );
126 
127         c = new HashSet<String>();
128         c.add( AuthenticationInterceptor.class.getName() );
129         c.add( AciAuthorizationInterceptor.class.getName() );
130         c.add( DefaultAuthorizationInterceptor.class.getName() );
131         c.add( SchemaInterceptor.class.getName() );
132         c.add( OperationalAttributeInterceptor.class.getName() );
133         c.add( SubentryInterceptor.class.getName() );
134         c.add( EventInterceptor.class.getName() );
135         GETMATCHEDDN_BYPASS = Collections.unmodifiableCollection( c );
136 
137         c = new HashSet<String>();
138         c.add( NormalizationInterceptor.class.getName() );
139         c.add( AuthenticationInterceptor.class.getName() );
140         c.add( AciAuthorizationInterceptor.class.getName() );
141         c.add( DefaultAuthorizationInterceptor.class.getName() );
142         c.add( SchemaInterceptor.class.getName() );
143         c.add( SubentryInterceptor.class.getName() );
144         c.add( EventInterceptor.class.getName() );
145         c.add( TriggerInterceptor.class.getName() );
146         LOOKUP_EXCLUDING_OPR_ATTRS_BYPASS = Collections.unmodifiableCollection( c );
147         
148         c = new HashSet<String>();
149         c.add( NormalizationInterceptor.class.getName() );
150         c.add( ChangeLogInterceptor.class.getName() );
151         c.add( AciAuthorizationInterceptor.class.getName() );
152         c.add( DefaultAuthorizationInterceptor.class.getName() );
153         c.add( ExceptionInterceptor.class.getName() );
154         c.add( OperationalAttributeInterceptor.class.getName() );
155         c.add( SchemaInterceptor.class.getName() );
156         c.add( SubentryInterceptor.class.getName() );
157         c.add( CollectiveAttributeInterceptor.class.getName() );
158         c.add( EventInterceptor.class.getName() );
159         c.add( TriggerInterceptor.class.getName() );
160         GET_ROOT_DSE_BYPASS = Collections.unmodifiableCollection( c );
161     }
162 }