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 nis 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 NisObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public NisObjectClassProducer()
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 1.3.6.1.1.1.2.0
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "1.3.6.1.1.1.2.0", registries );
066 objectClass.setObsolete( false );
067
068 objectClass.setDescription( "Abstraction of an account with POSIX attributes" );
069 // set the objectclass type
070 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
071
072 // set superior objectClasses
073 array.clear();
074 array.add( "top" );
075 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
076
077 // set must list
078 array.clear();
079 array.add( "cn" );
080 array.add( "uid" );
081 array.add( "uidNumber" );
082 array.add( "gidNumber" );
083 array.add( "homeDirectory" );
084 objectClass.setMustListIds( array.toArray( EMPTY ) );
085
086 // set may list
087 array.clear();
088 array.add( "userPassword" );
089 array.add( "loginShell" );
090 array.add( "gecos" );
091 array.add( "description" );
092 objectClass.setMayListIds( array.toArray( EMPTY ) );
093
094 // set names
095 array.clear();
096 array.add( "posixAccount" );
097 objectClass.setNames( array.toArray( EMPTY ) );
098 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.0", objectClass );
099 // --------------------------------------------------------------------
100 // ObjectClass 1.3.6.1.1.1.2.1
101 // --------------------------------------------------------------------
102
103 objectClass = newObjectClass( "1.3.6.1.1.1.2.1", registries );
104 objectClass.setObsolete( false );
105
106 objectClass.setDescription( "Additional attributes for shadow passwords" );
107 // set the objectclass type
108 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
109
110 // set superior objectClasses
111 array.clear();
112 array.add( "top" );
113 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
114
115 // set must list
116 array.clear();
117 array.add( "uid" );
118 objectClass.setMustListIds( array.toArray( EMPTY ) );
119
120 // set may list
121 array.clear();
122 array.add( "userPassword" );
123 array.add( "shadowLastChange" );
124 array.add( "shadowMin" );
125 array.add( "shadowMax" );
126 array.add( "shadowWarning" );
127 array.add( "shadowInactive" );
128 array.add( "shadowExpire" );
129 array.add( "shadowFlag" );
130 array.add( "description" );
131 objectClass.setMayListIds( array.toArray( EMPTY ) );
132
133 // set names
134 array.clear();
135 array.add( "shadowAccount" );
136 objectClass.setNames( array.toArray( EMPTY ) );
137 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.1", objectClass );
138 // --------------------------------------------------------------------
139 // ObjectClass 1.3.6.1.1.1.2.2
140 // --------------------------------------------------------------------
141
142 objectClass = newObjectClass( "1.3.6.1.1.1.2.2", registries );
143 objectClass.setObsolete( false );
144
145 objectClass.setDescription( "Abstraction of a group of accounts" );
146 // set the objectclass type
147 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
148
149 // set superior objectClasses
150 array.clear();
151 array.add( "top" );
152 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
153
154 // set must list
155 array.clear();
156 array.add( "cn" );
157 array.add( "gidNumber" );
158 objectClass.setMustListIds( array.toArray( EMPTY ) );
159
160 // set may list
161 array.clear();
162 array.add( "userPassword" );
163 array.add( "memberUid" );
164 array.add( "description" );
165 objectClass.setMayListIds( array.toArray( EMPTY ) );
166
167 // set names
168 array.clear();
169 array.add( "posixGroup" );
170 objectClass.setNames( array.toArray( EMPTY ) );
171 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.2", objectClass );
172 // --------------------------------------------------------------------
173 // ObjectClass 1.3.6.1.1.1.2.3
174 // --------------------------------------------------------------------
175
176 objectClass = newObjectClass( "1.3.6.1.1.1.2.3", registries );
177 objectClass.setObsolete( false );
178
179 objectClass.setDescription( "Abstraction an Internet Protocol service" );
180 // set the objectclass type
181 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
182
183 // set superior objectClasses
184 array.clear();
185 array.add( "top" );
186 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
187
188 // set must list
189 array.clear();
190 array.add( "cn" );
191 array.add( "ipServicePort" );
192 array.add( "ipServiceProtocol" );
193 objectClass.setMustListIds( array.toArray( EMPTY ) );
194
195 // set may list
196 array.clear();
197 array.add( "description" );
198 objectClass.setMayListIds( array.toArray( EMPTY ) );
199
200 // set names
201 array.clear();
202 array.add( "ipService" );
203 objectClass.setNames( array.toArray( EMPTY ) );
204 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.3", objectClass );
205 // --------------------------------------------------------------------
206 // ObjectClass 1.3.6.1.1.1.2.4
207 // --------------------------------------------------------------------
208
209 objectClass = newObjectClass( "1.3.6.1.1.1.2.4", registries );
210 objectClass.setObsolete( false );
211
212 objectClass.setDescription( "Abstraction of an IP protocol" );
213 // set the objectclass type
214 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
215
216 // set superior objectClasses
217 array.clear();
218 array.add( "top" );
219 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
220
221 // set must list
222 array.clear();
223 array.add( "cn" );
224 array.add( "ipProtocolNumber" );
225 objectClass.setMustListIds( array.toArray( EMPTY ) );
226
227 // set may list
228 array.clear();
229 array.add( "description" );
230 objectClass.setMayListIds( array.toArray( EMPTY ) );
231
232 // set names
233 array.clear();
234 array.add( "ipProtocol" );
235 objectClass.setNames( array.toArray( EMPTY ) );
236 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.4", objectClass );
237 // --------------------------------------------------------------------
238 // ObjectClass 1.3.6.1.1.1.2.5
239 // --------------------------------------------------------------------
240
241 objectClass = newObjectClass( "1.3.6.1.1.1.2.5", registries );
242 objectClass.setObsolete( false );
243
244 objectClass.setDescription( "Abstraction of an ONC/RPC binding" );
245 // set the objectclass type
246 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
247
248 // set superior objectClasses
249 array.clear();
250 array.add( "top" );
251 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
252
253 // set must list
254 array.clear();
255 array.add( "cn" );
256 array.add( "oncRpcNumber" );
257 objectClass.setMustListIds( array.toArray( EMPTY ) );
258
259 // set may list
260 array.clear();
261 array.add( "description" );
262 objectClass.setMayListIds( array.toArray( EMPTY ) );
263
264 // set names
265 array.clear();
266 array.add( "oncRpc" );
267 objectClass.setNames( array.toArray( EMPTY ) );
268 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.5", objectClass );
269 // --------------------------------------------------------------------
270 // ObjectClass 1.3.6.1.1.1.2.6
271 // --------------------------------------------------------------------
272
273 objectClass = newObjectClass( "1.3.6.1.1.1.2.6", registries );
274 objectClass.setObsolete( false );
275
276 objectClass.setDescription( "Abstraction of a host, an IP device" );
277 // set the objectclass type
278 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
279
280 // set superior objectClasses
281 array.clear();
282 array.add( "top" );
283 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
284
285 // set must list
286 array.clear();
287 array.add( "cn" );
288 array.add( "ipHostNumber" );
289 objectClass.setMustListIds( array.toArray( EMPTY ) );
290
291 // set may list
292 array.clear();
293 array.add( "l" );
294 array.add( "description" );
295 array.add( "manager" );
296 objectClass.setMayListIds( array.toArray( EMPTY ) );
297
298 // set names
299 array.clear();
300 array.add( "ipHost" );
301 objectClass.setNames( array.toArray( EMPTY ) );
302 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.6", objectClass );
303 // --------------------------------------------------------------------
304 // ObjectClass 1.3.6.1.1.1.2.7
305 // --------------------------------------------------------------------
306
307 objectClass = newObjectClass( "1.3.6.1.1.1.2.7", registries );
308 objectClass.setObsolete( false );
309
310 objectClass.setDescription( "Abstraction of an IP network" );
311 // set the objectclass type
312 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
313
314 // set superior objectClasses
315 array.clear();
316 array.add( "top" );
317 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
318
319 // set must list
320 array.clear();
321 array.add( "cn" );
322 array.add( "ipNetworkNumber" );
323 objectClass.setMustListIds( array.toArray( EMPTY ) );
324
325 // set may list
326 array.clear();
327 array.add( "ipNetmaskNumber" );
328 array.add( "l" );
329 array.add( "description" );
330 array.add( "manager" );
331 objectClass.setMayListIds( array.toArray( EMPTY ) );
332
333 // set names
334 array.clear();
335 array.add( "ipNetwork" );
336 objectClass.setNames( array.toArray( EMPTY ) );
337 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.7", objectClass );
338 // --------------------------------------------------------------------
339 // ObjectClass 1.3.6.1.1.1.2.8
340 // --------------------------------------------------------------------
341
342 objectClass = newObjectClass( "1.3.6.1.1.1.2.8", registries );
343 objectClass.setObsolete( false );
344
345 objectClass.setDescription( "Abstraction of a netgroup" );
346 // set the objectclass type
347 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
348
349 // set superior objectClasses
350 array.clear();
351 array.add( "top" );
352 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
353
354 // set must list
355 array.clear();
356 array.add( "cn" );
357 objectClass.setMustListIds( array.toArray( EMPTY ) );
358
359 // set may list
360 array.clear();
361 array.add( "nisNetgroupTriple" );
362 array.add( "memberNisNetgroup" );
363 array.add( "description" );
364 objectClass.setMayListIds( array.toArray( EMPTY ) );
365
366 // set names
367 array.clear();
368 array.add( "nisNetgroup" );
369 objectClass.setNames( array.toArray( EMPTY ) );
370 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.8", objectClass );
371 // --------------------------------------------------------------------
372 // ObjectClass 1.3.6.1.1.1.2.9
373 // --------------------------------------------------------------------
374
375 objectClass = newObjectClass( "1.3.6.1.1.1.2.9", registries );
376 objectClass.setObsolete( false );
377
378 objectClass.setDescription( "A generic abstraction of a NIS map" );
379 // set the objectclass type
380 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
381
382 // set superior objectClasses
383 array.clear();
384 array.add( "top" );
385 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
386
387 // set must list
388 array.clear();
389 array.add( "nisMapName" );
390 objectClass.setMustListIds( array.toArray( EMPTY ) );
391
392 // set may list
393 array.clear();
394 array.add( "description" );
395 objectClass.setMayListIds( array.toArray( EMPTY ) );
396
397 // set names
398 array.clear();
399 array.add( "nisMap" );
400 objectClass.setNames( array.toArray( EMPTY ) );
401 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.9", objectClass );
402 // --------------------------------------------------------------------
403 // ObjectClass 1.3.6.1.1.1.2.10
404 // --------------------------------------------------------------------
405
406 objectClass = newObjectClass( "1.3.6.1.1.1.2.10", registries );
407 objectClass.setObsolete( false );
408
409 objectClass.setDescription( "An entry in a NIS map" );
410 // set the objectclass type
411 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
412
413 // set superior objectClasses
414 array.clear();
415 array.add( "top" );
416 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
417
418 // set must list
419 array.clear();
420 array.add( "cn" );
421 array.add( "nisMapEntry" );
422 array.add( "nisMapName" );
423 objectClass.setMustListIds( array.toArray( EMPTY ) );
424
425 // set may list
426 array.clear();
427 array.add( "description" );
428 objectClass.setMayListIds( array.toArray( EMPTY ) );
429
430 // set names
431 array.clear();
432 array.add( "nisObject" );
433 objectClass.setNames( array.toArray( EMPTY ) );
434 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.10", objectClass );
435 // --------------------------------------------------------------------
436 // ObjectClass 1.3.6.1.1.1.2.11
437 // --------------------------------------------------------------------
438
439 objectClass = newObjectClass( "1.3.6.1.1.1.2.11", registries );
440 objectClass.setObsolete( false );
441
442 objectClass.setDescription( "A device with a MAC address" );
443 // set the objectclass type
444 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
445
446 // set superior objectClasses
447 array.clear();
448 array.add( "top" );
449 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
450
451 // set must list
452 array.clear();
453 objectClass.setMustListIds( array.toArray( EMPTY ) );
454
455 // set may list
456 array.clear();
457 array.add( "macAddress" );
458 objectClass.setMayListIds( array.toArray( EMPTY ) );
459
460 // set names
461 array.clear();
462 array.add( "ieee802Device" );
463 objectClass.setNames( array.toArray( EMPTY ) );
464 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.11", objectClass );
465 // --------------------------------------------------------------------
466 // ObjectClass 1.3.6.1.1.1.2.12
467 // --------------------------------------------------------------------
468
469 objectClass = newObjectClass( "1.3.6.1.1.1.2.12", registries );
470 objectClass.setObsolete( false );
471
472 objectClass.setDescription( "A device with boot parameters" );
473 // set the objectclass type
474 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
475
476 // set superior objectClasses
477 array.clear();
478 array.add( "top" );
479 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
480
481 // set must list
482 array.clear();
483 objectClass.setMustListIds( array.toArray( EMPTY ) );
484
485 // set may list
486 array.clear();
487 array.add( "bootFile" );
488 array.add( "bootParameter" );
489 objectClass.setMayListIds( array.toArray( EMPTY ) );
490
491 // set names
492 array.clear();
493 array.add( "bootableDevice" );
494 objectClass.setNames( array.toArray( EMPTY ) );
495 cb.schemaObjectProduced( this, "1.3.6.1.1.1.2.12", objectClass );
496 }
497 }