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.api.ldap.model.schema.registries;
21  
22  
23  import java.io.IOException;
24  import java.util.Collection;
25  import java.util.List;
26  
27  import org.apache.directory.api.ldap.model.entry.Entry;
28  import org.apache.directory.api.ldap.model.exception.LdapException;
29  
30  
31  /**
32   * Loads schemas into registries.
33   *
34   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
35   */
36  public interface SchemaLoader
37  {
38      /**
39       * Gets a schema object based on it's name.
40       * 
41       * @param schemaName the name of the schema to load
42       * @return the Schema object associated with the name
43       */
44      Schema getSchema( String schemaName );
45  
46  
47      /**
48       * Build a list of AttributeTypes read from the underlying storage for
49       * a list of specified schema
50       *
51       * @param schemas the schemas from which AttributeTypes are loaded
52       * @throws Exception if there are failures accessing AttributeType information
53       */
54      List<Entry> loadAttributeTypes( Schema... schemas ) throws LdapException, IOException;
55  
56  
57      /**
58       * Build a list of AttributeTypes read from the underlying storage for
59       * a list of specific schema, using their name
60       *
61       * @param schemaNames the schema names from which AttributeTypes are loaded
62       * @throws Exception if there are failures accessing AttributeType information
63       */
64      List<Entry> loadAttributeTypes( String... schemaNames ) throws Exception;
65  
66  
67      /**
68       * Build a list of Comparators read from the underlying storage for
69       * a list of specific schema.
70       *
71       * @param schemas the schemas from which Comparators are loaded
72       * @throws Exception if there are failures accessing Comparator information
73       */
74      List<Entry> loadComparators( Schema... schemas ) throws LdapException, IOException;
75  
76  
77      /**
78       * Build a list of Comparators read from the underlying storage for
79       * a list of specific schema, using their name
80       *
81       * @param schemaNames the schema names from which Comparators are loaded
82       * @throws Exception if there are failures accessing Comparator information
83       */
84      List<Entry> loadComparators( String... schemaNames ) throws Exception;
85  
86  
87      /**
88       * Build a list of DitContentRules read from the underlying storage for
89       * a list of specific schema.
90       *
91       * @param schemas the schemas from which DitContentRules are loaded
92       * @throws Exception if there are failures accessing DitContentRule information
93       */
94      List<Entry> loadDitContentRules( Schema... schemas ) throws LdapException, IOException;
95  
96  
97      /**
98       * Build a list of DitContentRules read from the underlying storage for
99       * a list of specified schema names
100      *
101      * @param schemaNames the schema names from which DitContentRules are loaded
102      * @throws Exception if there are failures accessing DitContentRule information
103      */
104     List<Entry> loadDitContentRules( String... schemaNames ) throws Exception;
105 
106 
107     /**
108      * Build a list of DitStructureRules read from the underlying storage for
109      * a list of specific schema.
110      *
111      * @param schemas the schemas from which DitStructureRules are loaded
112      * @throws Exception if there are failures accessing DitStructureRule information
113      */
114     List<Entry> loadDitStructureRules( Schema... schemas ) throws LdapException, IOException;
115 
116 
117     /**
118      * Build a list of DitStructureRules read from the underlying storage for
119      * a list of specified schema names
120      *
121      * @param schemaNames the schema names from which DitStructureRules are loaded
122      * @throws Exception if there are failures accessing DitStructureRule information
123      */
124     List<Entry> loadDitStructureRules( String... schemaNames ) throws Exception;
125 
126 
127     /**
128      * Build a list of MatchingRules read from the underlying storage for
129      * a list of specific schema
130      *
131      * @param schemas the schemas from which MatchingRules are loaded
132      * @throws Exception if there are failures accessing MatchingRule information
133      */
134     List<Entry> loadMatchingRules( Schema... schemas ) throws LdapException, IOException;
135 
136 
137     /**
138      * Build a list of MatchingRules read from the underlying storage for
139      * a list of specific schema, using their name
140      *
141      * @param schemaNames the schema names from which MatchingRules are loaded
142      * @throws Exception if there are failures accessing MatchingRule information
143      */
144     List<Entry> loadMatchingRules( String... schemaNames ) throws Exception;
145 
146 
147     /**
148      * Build a list of MatchingRuleUses read from the underlying storage for
149      * a list of specific schema.
150      *
151      * @param schemas the schemas from which MatchingRuleUses are loaded
152      * @throws Exception if there are failures accessing MatchingRuleUse information
153      */
154     List<Entry> loadMatchingRuleUses( Schema... schemas ) throws LdapException, IOException;
155 
156 
157     /**
158      * Build a list of MatchingRuleUses read from the underlying storage for
159      * a list of specified schema names
160      *
161      * @param schemaNames the schema names from which MatchingRuleUses are loaded
162      * @throws Exception if there are failures accessing MatchingRuleUses information
163      */
164     List<Entry> loadMatchingRuleUses( String... schemaNames ) throws Exception;
165 
166 
167     /**
168      * Build a list of NameForms read from the underlying storage for
169      * a list of specific schema.
170      *
171      * @param schemas the schemas from which NameForms are loaded
172      * @throws Exception if there are failures accessing NameForm information
173      */
174     List<Entry> loadNameForms( Schema... schemas ) throws LdapException, IOException;
175 
176 
177     /**
178      * Build a list of NameForms read from the underlying storage for
179      * a list of specified schema names
180      *
181      * @param schemaNames the schema names from which NameForms are loaded
182      * @throws Exception if there are failures accessing NameForms information
183      */
184     List<Entry> loadNameForms( String... schemaNames ) throws Exception;
185 
186 
187     /**
188      * Build a list of Normalizers read from the underlying storage for
189      * a list of specified schema
190      *
191      * @param schemas the schemas from which Normalizers are loaded
192      * @throws Exception if there are failures accessing Normalizer information
193      */
194     List<Entry> loadNormalizers( Schema... schemas ) throws LdapException, IOException;
195 
196 
197     /**
198      * Build a list of Normalizers read from the underlying storage for
199      * a list of specified schema names
200      *
201      * @param schemaNames the schema names from which Normalizers are loaded
202      * @throws Exception if there are failures accessing Normalizer information
203      */
204     List<Entry> loadNormalizers( String... schemaNames ) throws Exception;
205 
206 
207     /**
208      * Build a list of ObjectClasses read from the underlying storage for
209      * a list of specific schema.
210      *
211      * @param schemas the schemas from which ObjectClasses are loaded
212      * @throws Exception if there are failures accessing ObjectClass information
213      */
214     List<Entry> loadObjectClasses( Schema... schemas ) throws LdapException, IOException;
215 
216 
217     /**
218      * Build a list of ObjectClasses read from the underlying storage for
219      * a list of specified schema names
220      *
221      * @param schemaNames the schema names from which ObjectClasses are loaded
222      * @throws Exception if there are failures accessing ObjectClasses information
223      */
224     List<Entry> loadObjectClasses( String... schemaNames ) throws Exception;
225 
226 
227     /**
228      * Build a list of Syntaxes read from the underlying storage for
229      * a list of specified schema
230      *
231      * @param schemas the schemas from which Syntaxes are loaded
232      * @throws Exception if there are failures accessing Syntax information
233      */
234     List<Entry> loadSyntaxes( Schema... schemas ) throws LdapException, IOException;
235 
236 
237     /**
238      * Build a list of Syntaxes read from the underlying storage for
239      * a list of specified schema names
240      *
241      * @param schemaNames the schema names from which Syntaxes are loaded
242      * @throws Exception if there are failures accessing Syntax information
243      */
244     List<Entry> loadSyntaxes( String... schemaNames ) throws Exception;
245 
246 
247     /**
248      * Build a list of SyntaxCheckers read from the underlying storage for
249      * a list of specified schema
250      *
251      * @param schemas the schemas from which SyntaxCheckers are loaded
252      * @throws Exception if there are failures accessing SyntaxChecker information
253      */
254     List<Entry> loadSyntaxCheckers( Schema... schemas ) throws LdapException, IOException;
255 
256 
257     /**
258      * Build a list of SyntaxCheckers read from the underlying storage for
259      * a list of specified schema names
260      *
261      * @param schemaNames the schema names from which SyntaxCheckers are loaded
262      * @throws Exception if there are failures accessing SyntaxChecker information
263      */
264     List<Entry> loadSyntaxCheckers( String... schemaNames ) throws Exception;
265 
266 
267     /**
268      * @return the list of enabled schemas
269      * @throws Exception TODO
270      */
271     Collection<Schema> getAllEnabled() throws Exception;
272 
273 
274     /**
275      * @return the list of all schemas
276      * @throws Exception TODO
277      */
278     Collection<Schema> getAllSchemas() throws Exception;
279 
280 
281     /**
282      * Add a new schema to the schema's list
283      */
284     void addSchema( Schema schema );
285 
286 
287     /**
288      * Remove a schema from the schema's list
289      */
290     void removeSchema( Schema schema );
291 }