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 dhcp 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 DhcpObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public DhcpObjectClassProducer()
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.16.840.1.113719.1.203.6.1
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.1", registries );
066 objectClass.setObsolete( false );
067
068 objectClass.setDescription( "Service object that represents the actual DHCP Service configuration. This is a container object." );
069 // set the objectclass type
070 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
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( "dhcpPrimaryDN" );
081 objectClass.setMustListIds( array.toArray( EMPTY ) );
082
083 // set may list
084 array.clear();
085 array.add( "dhcpSecondaryDN" );
086 array.add( "dhcpSharedNetworkDN" );
087 array.add( "dhcpSubnetDN" );
088 array.add( "dhcpGroupDN" );
089 array.add( "dhcpHostDN" );
090 array.add( "dhcpClassesDN" );
091 array.add( "dhcpOptionsDN" );
092 array.add( "dhcpStatements" );
093 objectClass.setMayListIds( array.toArray( EMPTY ) );
094
095 // set names
096 array.clear();
097 array.add( "dhcpService" );
098 objectClass.setNames( array.toArray( EMPTY ) );
099 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.1", objectClass );
100 // --------------------------------------------------------------------
101 // ObjectClass 2.16.840.1.113719.1.203.6.2
102 // --------------------------------------------------------------------
103
104 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.2", registries );
105 objectClass.setObsolete( false );
106
107 objectClass.setDescription( "This stores configuration information for a shared network." );
108 // set the objectclass type
109 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
110
111 // set superior objectClasses
112 array.clear();
113 array.add( "top" );
114 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
115
116 // set must list
117 array.clear();
118 array.add( "cn" );
119 objectClass.setMustListIds( array.toArray( EMPTY ) );
120
121 // set may list
122 array.clear();
123 array.add( "dhcpSubnetDN" );
124 array.add( "dhcpPoolDN" );
125 array.add( "dhcpOptionsDN" );
126 array.add( "dhcpStatements" );
127 objectClass.setMayListIds( array.toArray( EMPTY ) );
128
129 // set names
130 array.clear();
131 array.add( "dhcpSharedNetwork" );
132 objectClass.setNames( array.toArray( EMPTY ) );
133 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.2", objectClass );
134 // --------------------------------------------------------------------
135 // ObjectClass 2.16.840.1.113719.1.203.6.3
136 // --------------------------------------------------------------------
137
138 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.3", registries );
139 objectClass.setObsolete( false );
140
141 objectClass.setDescription( "This class defines a subnet. This is a container object." );
142 // set the objectclass type
143 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
144
145 // set superior objectClasses
146 array.clear();
147 array.add( "top" );
148 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
149
150 // set must list
151 array.clear();
152 array.add( "cn" );
153 array.add( "dhcpNetMask" );
154 objectClass.setMustListIds( array.toArray( EMPTY ) );
155
156 // set may list
157 array.clear();
158 array.add( "dhcpRange" );
159 array.add( "dhcpPoolDN" );
160 array.add( "dhcpGroupDN" );
161 array.add( "dhcpHostDN" );
162 array.add( "dhcpClassesDN" );
163 array.add( "dhcpLeasesDN" );
164 array.add( "dhcpOptionsDN" );
165 array.add( "dhcpStatements" );
166 objectClass.setMayListIds( array.toArray( EMPTY ) );
167
168 // set names
169 array.clear();
170 array.add( "dhcpSubnet" );
171 objectClass.setNames( array.toArray( EMPTY ) );
172 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.3", objectClass );
173 // --------------------------------------------------------------------
174 // ObjectClass 2.16.840.1.113719.1.203.6.4
175 // --------------------------------------------------------------------
176
177 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.4", registries );
178 objectClass.setObsolete( false );
179
180 objectClass.setDescription( "This stores configuration information about a pool." );
181 // set the objectclass type
182 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
183
184 // set superior objectClasses
185 array.clear();
186 array.add( "top" );
187 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
188
189 // set must list
190 array.clear();
191 array.add( "cn" );
192 array.add( "dhcpRange" );
193 objectClass.setMustListIds( array.toArray( EMPTY ) );
194
195 // set may list
196 array.clear();
197 array.add( "dhcpClassesDN" );
198 array.add( "dhcpPermitList" );
199 array.add( "dhcpLeasesDN" );
200 array.add( "dhcpOptionsDN" );
201 array.add( "dhcpStatements" );
202 objectClass.setMayListIds( array.toArray( EMPTY ) );
203
204 // set names
205 array.clear();
206 array.add( "dhcpPool" );
207 objectClass.setNames( array.toArray( EMPTY ) );
208 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.4", objectClass );
209 // --------------------------------------------------------------------
210 // ObjectClass 2.16.840.1.113719.1.203.6.5
211 // --------------------------------------------------------------------
212
213 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.5", registries );
214 objectClass.setObsolete( false );
215
216 objectClass.setDescription( "Group object that lists host DNs and parameters. This is a container object." );
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 objectClass.setMustListIds( array.toArray( EMPTY ) );
229
230 // set may list
231 array.clear();
232 array.add( "dhcpHostDN" );
233 array.add( "dhcpOptionsDN" );
234 array.add( "dhcpStatements" );
235 objectClass.setMayListIds( array.toArray( EMPTY ) );
236
237 // set names
238 array.clear();
239 array.add( "dhcpGroup" );
240 objectClass.setNames( array.toArray( EMPTY ) );
241 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.5", objectClass );
242 // --------------------------------------------------------------------
243 // ObjectClass 2.16.840.1.113719.1.203.6.6
244 // --------------------------------------------------------------------
245
246 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.6", registries );
247 objectClass.setObsolete( false );
248
249 objectClass.setDescription( "This represents information about a particular client" );
250 // set the objectclass type
251 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
252
253 // set superior objectClasses
254 array.clear();
255 array.add( "top" );
256 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
257
258 // set must list
259 array.clear();
260 array.add( "cn" );
261 objectClass.setMustListIds( array.toArray( EMPTY ) );
262
263 // set may list
264 array.clear();
265 array.add( "dhcpLeaseDN" );
266 array.add( "dhcpHWAddress" );
267 array.add( "dhcpOptionsDN" );
268 array.add( "dhcpStatements" );
269 objectClass.setMayListIds( array.toArray( EMPTY ) );
270
271 // set names
272 array.clear();
273 array.add( "dhcpHost" );
274 objectClass.setNames( array.toArray( EMPTY ) );
275 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.6", objectClass );
276 // --------------------------------------------------------------------
277 // ObjectClass 2.16.840.1.113719.1.203.6.7
278 // --------------------------------------------------------------------
279
280 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.7", registries );
281 objectClass.setObsolete( false );
282
283 objectClass.setDescription( "Represents information about a collection of related clients." );
284 // set the objectclass type
285 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
286
287 // set superior objectClasses
288 array.clear();
289 array.add( "top" );
290 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
291
292 // set must list
293 array.clear();
294 array.add( "cn" );
295 objectClass.setMustListIds( array.toArray( EMPTY ) );
296
297 // set may list
298 array.clear();
299 array.add( "dhcpSubClassesDN" );
300 array.add( "dhcpOptionsDN" );
301 array.add( "dhcpStatements" );
302 objectClass.setMayListIds( array.toArray( EMPTY ) );
303
304 // set names
305 array.clear();
306 array.add( "dhcpClass" );
307 objectClass.setNames( array.toArray( EMPTY ) );
308 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.7", objectClass );
309 // --------------------------------------------------------------------
310 // ObjectClass 2.16.840.1.113719.1.203.6.8
311 // --------------------------------------------------------------------
312
313 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.8", registries );
314 objectClass.setObsolete( false );
315
316 objectClass.setDescription( "Represents information about a collection of related classes." );
317 // set the objectclass type
318 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
319
320 // set superior objectClasses
321 array.clear();
322 array.add( "top" );
323 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
324
325 // set must list
326 array.clear();
327 array.add( "cn" );
328 objectClass.setMustListIds( array.toArray( EMPTY ) );
329
330 // set may list
331 array.clear();
332 array.add( "dhcpClassData" );
333 array.add( "dhcpOptionsDN" );
334 array.add( "dhcpStatements" );
335 objectClass.setMayListIds( array.toArray( EMPTY ) );
336
337 // set names
338 array.clear();
339 array.add( "dhcpSubClass" );
340 objectClass.setNames( array.toArray( EMPTY ) );
341 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.8", objectClass );
342 // --------------------------------------------------------------------
343 // ObjectClass 2.16.840.1.113719.1.203.6.9
344 // --------------------------------------------------------------------
345
346 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.9", registries );
347 objectClass.setObsolete( false );
348
349 objectClass.setDescription( "Represents information about a collection of options defined." );
350 // set the objectclass type
351 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
352
353 // set superior objectClasses
354 array.clear();
355 array.add( "top" );
356 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
357
358 // set must list
359 array.clear();
360 array.add( "cn" );
361 objectClass.setMustListIds( array.toArray( EMPTY ) );
362
363 // set may list
364 array.clear();
365 array.add( "dhcpOption" );
366 objectClass.setMayListIds( array.toArray( EMPTY ) );
367
368 // set names
369 array.clear();
370 array.add( "dhcpOptions" );
371 objectClass.setNames( array.toArray( EMPTY ) );
372 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.9", objectClass );
373 // --------------------------------------------------------------------
374 // ObjectClass 2.16.840.1.113719.1.203.6.10
375 // --------------------------------------------------------------------
376
377 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.10", registries );
378 objectClass.setObsolete( false );
379
380 objectClass.setDescription( "This class represents an IP Address, which may or may not have been leased." );
381 // set the objectclass type
382 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
383
384 // set superior objectClasses
385 array.clear();
386 array.add( "top" );
387 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
388
389 // set must list
390 array.clear();
391 array.add( "cn" );
392 array.add( "dhcpAddressState" );
393 objectClass.setMustListIds( array.toArray( EMPTY ) );
394
395 // set may list
396 array.clear();
397 array.add( "dhcpExpirationTime" );
398 array.add( "dhcpStartTimeOfState" );
399 array.add( "dhcpLastTransactionTime" );
400 array.add( "dhcpBootpFlag" );
401 array.add( "dhcpDomainName" );
402 array.add( "dhcpDnsStatus" );
403 array.add( "dhcpRequestedHostName" );
404 array.add( "dhcpAssignedHostName" );
405 array.add( "dhcpReservedForClient" );
406 array.add( "dhcpAssignedToClient" );
407 array.add( "dhcpRelayAgentInfo" );
408 array.add( "dhcpHWAddress" );
409 objectClass.setMayListIds( array.toArray( EMPTY ) );
410
411 // set names
412 array.clear();
413 array.add( "dhcpLeases" );
414 objectClass.setNames( array.toArray( EMPTY ) );
415 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.10", objectClass );
416 // --------------------------------------------------------------------
417 // ObjectClass 2.16.840.1.113719.1.203.6.11
418 // --------------------------------------------------------------------
419
420 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.11", registries );
421 objectClass.setObsolete( false );
422
423 objectClass.setDescription( "This is the object that holds past information about the IP address. The cn is the time/date stamp when the address was assigned or released, the address state at the time, if the address was assigned or released." );
424 // set the objectclass type
425 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
426
427 // set superior objectClasses
428 array.clear();
429 array.add( "top" );
430 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
431
432 // set must list
433 array.clear();
434 array.add( "cn" );
435 objectClass.setMustListIds( array.toArray( EMPTY ) );
436
437 // set may list
438 array.clear();
439 array.add( "dhcpAddressState" );
440 array.add( "dhcpExpirationTime" );
441 array.add( "dhcpStartTimeOfState" );
442 array.add( "dhcpLastTransactionTime" );
443 array.add( "dhcpBootpFlag" );
444 array.add( "dhcpDomainName" );
445 array.add( "dhcpDnsStatus" );
446 array.add( "dhcpRequestedHostName" );
447 array.add( "dhcpAssignedHostName" );
448 array.add( "dhcpReservedForClient" );
449 array.add( "dhcpAssignedToClient" );
450 array.add( "dhcpRelayAgentInfo" );
451 array.add( "dhcpHWAddress" );
452 array.add( "dhcpErrorLog" );
453 objectClass.setMayListIds( array.toArray( EMPTY ) );
454
455 // set names
456 array.clear();
457 array.add( "dhcpLog" );
458 objectClass.setNames( array.toArray( EMPTY ) );
459 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.11", objectClass );
460 // --------------------------------------------------------------------
461 // ObjectClass 2.16.840.1.113719.1.203.6.12
462 // --------------------------------------------------------------------
463
464 objectClass = newObjectClass( "2.16.840.1.113719.1.203.6.12", registries );
465 objectClass.setObsolete( false );
466
467 objectClass.setDescription( "DHCP Server Object" );
468 // set the objectclass type
469 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
470
471 // set superior objectClasses
472 array.clear();
473 array.add( "top" );
474 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
475
476 // set must list
477 array.clear();
478 array.add( "cn" );
479 array.add( "dhcpServiceDN" );
480 objectClass.setMustListIds( array.toArray( EMPTY ) );
481
482 // set may list
483 array.clear();
484 array.add( "dhcpVersion" );
485 array.add( "dhcpImplementation" );
486 array.add( "dhcpHashBucketAssignment" );
487 array.add( "dhcpDelayedServiceParameter" );
488 array.add( "dhcpMaxClientLeadTime" );
489 array.add( "dhcpFailOverEndpointState" );
490 array.add( "dhcpStatements" );
491 objectClass.setMayListIds( array.toArray( EMPTY ) );
492
493 // set names
494 array.clear();
495 array.add( "dhcpServer" );
496 objectClass.setNames( array.toArray( EMPTY ) );
497 cb.schemaObjectProduced( this, "2.16.840.1.113719.1.203.6.12", objectClass );
498 }
499 }