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.authz.support;
21  
22  
23  import java.util.Collection;
24  
25  import org.apache.directory.api.ldap.aci.ACITuple;
26  import org.apache.directory.api.ldap.aci.MicroOperation;
27  import org.apache.directory.api.ldap.model.constants.AuthenticationLevel;
28  import org.apache.directory.api.ldap.model.entry.Entry;
29  import org.apache.directory.api.ldap.model.entry.Value;
30  import org.apache.directory.api.ldap.model.name.Dn;
31  import org.apache.directory.api.ldap.model.schema.AttributeType;
32  import org.apache.directory.api.ldap.model.schema.SchemaManager;
33  import org.apache.directory.server.core.api.interceptor.context.OperationContext;
34  
35  
36  /**
37   * A container used to pass parameters to the ACDF engine
38   *
39   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
40   * @version $Rev$, $Date$
41   */
42  public class AciContext
43  {
44      /** The schema manager */
45      private SchemaManager schemaManager;
46  
47      /** The operation context */
48      private OperationContext operationContext;
49  
50      /** The Users belonging to a group */
51      private Collection<String> userGroupNames;
52  
53      /** The user's Dn */
54      private Dn userDn;
55  
56      /** The requested Authentication level (default to NONE) */
57      private AuthenticationLevel authenticationLevel = AuthenticationLevel.NONE;
58  
59      /** the entry's Dn */
60      private Dn entryDn;
61  
62      /** The AttributeType */
63      private AttributeType attributeType;
64  
65      /** The attribute's values */
66      private Value attrValue;
67  
68      /** The allowed operations */
69      private Collection<MicroOperation> microOperations;
70  
71      /** The resulting tuples */
72      private Collection<ACITuple> aciTuples;
73  
74      /** The entry */
75      private Entry entry;
76  
77      /** ??? */
78      private Entry entryView;
79  
80  
81      /**
82       * Creates a new instance of AciContext.
83       *
84       * @param schemaManager The SchemaManager instance
85       * @param operationContext The OperationContext instance
86       */
87      public AciContext( SchemaManager schemaManager, OperationContext operationContext )
88      {
89          this.schemaManager = schemaManager;
90          this.operationContext = operationContext;
91      }
92  
93  
94      /**
95       * @return the schemaManager
96       */
97      public SchemaManager getSchemaManager()
98      {
99          return schemaManager;
100     }
101 
102 
103     /**
104      * @param schemaManager the schemaManager to set
105      */
106     public void setSchemaManager( SchemaManager schemaManager )
107     {
108         this.schemaManager = schemaManager;
109     }
110 
111 
112     /**
113      * @return the operationContext
114      */
115     public OperationContext getOperationContext()
116     {
117         return operationContext;
118     }
119 
120 
121     /**
122      * @param operationContext the operationContext to set
123      */
124     public void setOperationContext( OperationContext operationContext )
125     {
126         this.operationContext = operationContext;
127     }
128 
129 
130     /**
131      * @return the userGroupNames
132      */
133     public Collection<String> getUserGroupNames()
134     {
135         return userGroupNames;
136     }
137 
138 
139     /**
140      * @param userGroupNames the userGroupNames to set
141      */
142     public void setUserGroupNames( Collection<String> userGroupNames )
143     {
144         this.userGroupNames = userGroupNames;
145     }
146 
147 
148     /**
149      * @return the user Dn
150      */
151     public Dn getUserDn()
152     {
153         return userDn;
154     }
155 
156 
157     /**
158      * @param userDn the user Dn to set
159      */
160     public void setUserDn( Dn userDn )
161     {
162         this.userDn = userDn;
163     }
164 
165 
166     /**
167      * @return the authenticationLevel
168      */
169     public AuthenticationLevel getAuthenticationLevel()
170     {
171         return authenticationLevel;
172     }
173 
174 
175     /**
176      * @param authenticationLevel the authenticationLevel to set
177      */
178     public void setAuthenticationLevel( AuthenticationLevel authenticationLevel )
179     {
180         this.authenticationLevel = authenticationLevel;
181     }
182 
183 
184     /**
185      * @return the entry Dn
186      */
187     public Dn getEntryDn()
188     {
189         return entryDn;
190     }
191 
192 
193     /**
194      * @param entryDn the entry Dn to set
195      */
196     public void setEntryDn( Dn entryDn )
197     {
198         this.entryDn = entryDn;
199     }
200 
201 
202     /**
203      * @return the attributeType
204      */
205     public AttributeType getAttributeType()
206     {
207         return attributeType;
208     }
209 
210 
211     /**
212      * @param attributeType the attributeType to set
213      */
214     public void setAttributeType( AttributeType attributeType )
215     {
216         this.attributeType = attributeType;
217     }
218 
219 
220     /**
221      * @return the attrValue
222      */
223     public Value getAttrValue()
224     {
225         return attrValue;
226     }
227 
228 
229     /**
230      * @param attrValue the attrValue to set
231      */
232     public void setAttrValue( Value attrValue )
233     {
234         this.attrValue = attrValue;
235     }
236 
237 
238     /**
239      * @return the microOperations
240      */
241     public Collection<MicroOperation> getMicroOperations()
242     {
243         return microOperations;
244     }
245 
246 
247     /**
248      * @param microOperations the microOperations to set
249      */
250     public void setMicroOperations( Collection<MicroOperation> microOperations )
251     {
252         this.microOperations = microOperations;
253     }
254 
255 
256     /**
257      * @return the aciTuples
258      */
259     public Collection<ACITuple> getAciTuples()
260     {
261         return aciTuples;
262     }
263 
264 
265     /**
266      * @param aciTuples the aciTuples to set
267      */
268     public void setAciTuples( Collection<ACITuple> aciTuples )
269     {
270         this.aciTuples = aciTuples;
271     }
272 
273 
274     /**
275      * @return the entry
276      */
277     public Entry getEntry()
278     {
279         return entry;
280     }
281 
282 
283     /**
284      * @param entry the entry to set
285      */
286     public void setEntry( Entry entry )
287     {
288         this.entry = entry;
289     }
290 
291 
292     /**
293      * @return the entryView
294      */
295     public Entry getEntryView()
296     {
297         return entryView;
298     }
299 
300 
301     /**
302      * @param entryView the entryView to set
303      */
304     public void setEntryView( Entry entryView )
305     {
306         this.entryView = entryView;
307     }
308 }