001
002 /*
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements. See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership. The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied. See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 *
020 */
021 package org.apache.directory.server.schema.bootstrap;
022
023
024 import java.util.ArrayList;
025 import javax.naming.NamingException;
026 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
027 import org.apache.directory.server.schema.registries.Registries;
028
029
030 /**
031 * A producer of schema objectClass definations for the system schema. This
032 * code has been automatically generated using schema files in the OpenLDAP
033 * format along with the directory plugin for maven. This has been done
034 * to facilitate OpenLDAP schema interoperability.
035 *
036 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
037 */
038 public class SystemObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public SystemObjectClassProducer()
042 {
043 super( ProducerTypeEnum.OBJECT_CLASS_PRODUCER );
044 }
045
046
047 // ------------------------------------------------------------------------
048 // BootstrapProducer Methods
049 // ------------------------------------------------------------------------
050
051
052 /**
053 * @see BootstrapProducer#produce(Registries, ProducerCallback)
054 */
055 public void produce( Registries registries, ProducerCallback cb )
056 throws NamingException
057 {
058 ArrayList<String> array = new ArrayList<String>();
059 BootstrapObjectClass objectClass;
060
061 // --------------------------------------------------------------------
062 // ObjectClass 2.5.6.0
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "2.5.6.0", registries );
066 objectClass.setObsolete( false );
067
068 objectClass.setDescription( "top of the superclass chain" );
069 // set the objectclass type
070 objectClass.setType( ObjectClassTypeEnum.ABSTRACT );
071
072 // set superior objectClasses
073 array.clear();
074 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
075
076 // set must list
077 array.clear();
078 array.add( "objectClass" );
079 objectClass.setMustListIds( array.toArray( EMPTY ) );
080
081 // set may list
082 array.clear();
083 objectClass.setMayListIds( array.toArray( EMPTY ) );
084
085 // set names
086 array.clear();
087 array.add( "top" );
088 objectClass.setNames( array.toArray( EMPTY ) );
089 cb.schemaObjectProduced( this, "2.5.6.0", objectClass );
090 // --------------------------------------------------------------------
091 // ObjectClass 1.3.6.1.4.1.1466.101.120.111
092 // --------------------------------------------------------------------
093
094 objectClass = newObjectClass( "1.3.6.1.4.1.1466.101.120.111", registries );
095 objectClass.setObsolete( false );
096
097 objectClass.setDescription( "RFC2252: extensible object" );
098 // set the objectclass type
099 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
100
101 // set superior objectClasses
102 array.clear();
103 array.add( "top" );
104 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
105
106 // set must list
107 array.clear();
108 objectClass.setMustListIds( array.toArray( EMPTY ) );
109
110 // set may list
111 array.clear();
112 objectClass.setMayListIds( array.toArray( EMPTY ) );
113
114 // set names
115 array.clear();
116 array.add( "extensibleObject" );
117 objectClass.setNames( array.toArray( EMPTY ) );
118 cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.101.120.111", objectClass );
119 // --------------------------------------------------------------------
120 // ObjectClass 2.5.6.1
121 // --------------------------------------------------------------------
122
123 objectClass = newObjectClass( "2.5.6.1", registries );
124 objectClass.setObsolete( false );
125
126 objectClass.setDescription( "RFC2256: an alias" );
127 // set the objectclass type
128 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
129
130 // set superior objectClasses
131 array.clear();
132 array.add( "top" );
133 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
134
135 // set must list
136 array.clear();
137 array.add( "aliasedObjectName" );
138 objectClass.setMustListIds( array.toArray( EMPTY ) );
139
140 // set may list
141 array.clear();
142 objectClass.setMayListIds( array.toArray( EMPTY ) );
143
144 // set names
145 array.clear();
146 array.add( "alias" );
147 objectClass.setNames( array.toArray( EMPTY ) );
148 cb.schemaObjectProduced( this, "2.5.6.1", objectClass );
149 // --------------------------------------------------------------------
150 // ObjectClass 2.16.840.1.113730.3.2.6
151 // --------------------------------------------------------------------
152
153 objectClass = newObjectClass( "2.16.840.1.113730.3.2.6", registries );
154 objectClass.setObsolete( false );
155
156 objectClass.setDescription( "namedref: named subordinate referral" );
157 // set the objectclass type
158 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
159
160 // set superior objectClasses
161 array.clear();
162 array.add( "top" );
163 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
164
165 // set must list
166 array.clear();
167 array.add( "ref" );
168 objectClass.setMustListIds( array.toArray( EMPTY ) );
169
170 // set may list
171 array.clear();
172 objectClass.setMayListIds( array.toArray( EMPTY ) );
173
174 // set names
175 array.clear();
176 array.add( "referral" );
177 objectClass.setNames( array.toArray( EMPTY ) );
178 cb.schemaObjectProduced( this, "2.16.840.1.113730.3.2.6", objectClass );
179 // --------------------------------------------------------------------
180 // ObjectClass 1.3.6.1.4.1.4203.1.4.1
181 // --------------------------------------------------------------------
182
183 objectClass = newObjectClass( "1.3.6.1.4.1.4203.1.4.1", registries );
184 objectClass.setObsolete( false );
185
186 objectClass.setDescription( "OpenLDAP Root DSE object" );
187 // set the objectclass type
188 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
189
190 // set superior objectClasses
191 array.clear();
192 array.add( "top" );
193 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
194
195 // set must list
196 array.clear();
197 objectClass.setMustListIds( array.toArray( EMPTY ) );
198
199 // set may list
200 array.clear();
201 array.add( "cn" );
202 objectClass.setMayListIds( array.toArray( EMPTY ) );
203
204 // set names
205 array.clear();
206 array.add( "OpenLDAProotDSE" );
207 array.add( "LDAProotDSE" );
208 objectClass.setNames( array.toArray( EMPTY ) );
209 cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.1.4.1", objectClass );
210 // --------------------------------------------------------------------
211 // ObjectClass 2.5.17.0
212 // --------------------------------------------------------------------
213
214 objectClass = newObjectClass( "2.5.17.0", registries );
215 objectClass.setObsolete( false );
216
217 // set the objectclass type
218 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
219
220 // set superior objectClasses
221 array.clear();
222 array.add( "top" );
223 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
224
225 // set must list
226 array.clear();
227 array.add( "cn" );
228 array.add( "subtreeSpecification" );
229 objectClass.setMustListIds( array.toArray( EMPTY ) );
230
231 // set may list
232 array.clear();
233 objectClass.setMayListIds( array.toArray( EMPTY ) );
234
235 // set names
236 array.clear();
237 array.add( "subentry" );
238 objectClass.setNames( array.toArray( EMPTY ) );
239 cb.schemaObjectProduced( this, "2.5.17.0", objectClass );
240 // --------------------------------------------------------------------
241 // ObjectClass 2.5.20.1
242 // --------------------------------------------------------------------
243
244 objectClass = newObjectClass( "2.5.20.1", registries );
245 objectClass.setObsolete( false );
246
247 objectClass.setDescription( "RFC2252: controlling subschema (sub)entry" );
248 // set the objectclass type
249 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
250
251 // set superior objectClasses
252 array.clear();
253 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
254
255 // set must list
256 array.clear();
257 objectClass.setMustListIds( array.toArray( EMPTY ) );
258
259 // set may list
260 array.clear();
261 array.add( "dITStructureRules" );
262 array.add( "nameForms" );
263 array.add( "ditContentRules" );
264 array.add( "objectClasses" );
265 array.add( "attributeTypes" );
266 array.add( "matchingRules" );
267 array.add( "matchingRuleUse" );
268 objectClass.setMayListIds( array.toArray( EMPTY ) );
269
270 // set names
271 array.clear();
272 array.add( "subschema" );
273 objectClass.setNames( array.toArray( EMPTY ) );
274 cb.schemaObjectProduced( this, "2.5.20.1", objectClass );
275 // --------------------------------------------------------------------
276 // ObjectClass 2.5.17.2
277 // --------------------------------------------------------------------
278
279 objectClass = newObjectClass( "2.5.17.2", registries );
280 objectClass.setObsolete( false );
281
282 // set the objectclass type
283 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
284
285 // set superior objectClasses
286 array.clear();
287 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
288
289 // set must list
290 array.clear();
291 objectClass.setMustListIds( array.toArray( EMPTY ) );
292
293 // set may list
294 array.clear();
295 objectClass.setMayListIds( array.toArray( EMPTY ) );
296
297 // set names
298 array.clear();
299 array.add( "collectiveAttributeSubentry" );
300 objectClass.setNames( array.toArray( EMPTY ) );
301 cb.schemaObjectProduced( this, "2.5.17.2", objectClass );
302 // --------------------------------------------------------------------
303 // ObjectClass 1.3.6.1.4.1.1466.101.119.2
304 // --------------------------------------------------------------------
305
306 objectClass = newObjectClass( "1.3.6.1.4.1.1466.101.119.2", registries );
307 objectClass.setObsolete( false );
308
309 objectClass.setDescription( "RFC2589: Dynamic Object" );
310 // set the objectclass type
311 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
312
313 // set superior objectClasses
314 array.clear();
315 array.add( "top" );
316 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
317
318 // set must list
319 array.clear();
320 objectClass.setMustListIds( array.toArray( EMPTY ) );
321
322 // set may list
323 array.clear();
324 objectClass.setMayListIds( array.toArray( EMPTY ) );
325
326 // set names
327 array.clear();
328 array.add( "dynamicObject" );
329 objectClass.setNames( array.toArray( EMPTY ) );
330 cb.schemaObjectProduced( this, "1.3.6.1.4.1.1466.101.119.2", objectClass );
331 }
332 }