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 cosine 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 CosineObjectClassProducer extends AbstractBootstrapProducer
039    {
040    
041        public CosineObjectClassProducer()
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 0.9.2342.19200300.100.4.4 
063            // --------------------------------------------------------------------
064    
065            objectClass = newObjectClass( "0.9.2342.19200300.100.4.4", registries );
066            objectClass.setObsolete( false );
067    
068            // set the objectclass type
069            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
070    
071            // set superior objectClasses
072            array.clear();
073            array.add( "person" );
074            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
075    
076            // set must list
077            array.clear();
078            objectClass.setMustListIds( array.toArray( EMPTY ) );
079    
080            // set may list
081            array.clear();
082            array.add( "userid" );
083            array.add( "textEncodedORAddress" );
084            array.add( "rfc822Mailbox" );
085            array.add( "favouriteDrink" );
086            array.add( "roomNumber" );
087            array.add( "userClass" );
088            array.add( "homeTelephoneNumber" );
089            array.add( "homePostalAddress" );
090            array.add( "secretary" );
091            array.add( "personalTitle" );
092            array.add( "preferredDeliveryMethod" );
093            array.add( "businessCategory" );
094            array.add( "janetMailbox" );
095            array.add( "otherMailbox" );
096            array.add( "mobileTelephoneNumber" );
097            array.add( "pagerTelephoneNumber" );
098            array.add( "organizationalStatus" );
099            array.add( "mailPreferenceOption" );
100            array.add( "personalSignature" );
101            objectClass.setMayListIds( array.toArray( EMPTY ) );
102    
103            // set names
104            array.clear();
105            array.add( "pilotPerson" );
106            array.add( "newPilotPerson" );
107            objectClass.setNames( array.toArray( EMPTY ) );
108            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.4", objectClass );
109            // --------------------------------------------------------------------
110            // ObjectClass 0.9.2342.19200300.100.4.5 
111            // --------------------------------------------------------------------
112    
113            objectClass = newObjectClass( "0.9.2342.19200300.100.4.5", registries );
114            objectClass.setObsolete( false );
115    
116            // set the objectclass type
117            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
118    
119            // set superior objectClasses
120            array.clear();
121            array.add( "top" );
122            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
123    
124            // set must list
125            array.clear();
126            array.add( "userid" );
127            objectClass.setMustListIds( array.toArray( EMPTY ) );
128    
129            // set may list
130            array.clear();
131            array.add( "description" );
132            array.add( "seeAlso" );
133            array.add( "localityName" );
134            array.add( "organizationName" );
135            array.add( "organizationalUnitName" );
136            array.add( "host" );
137            objectClass.setMayListIds( array.toArray( EMPTY ) );
138    
139            // set names
140            array.clear();
141            array.add( "account" );
142            objectClass.setNames( array.toArray( EMPTY ) );
143            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.5", objectClass );
144            // --------------------------------------------------------------------
145            // ObjectClass 0.9.2342.19200300.100.4.6 
146            // --------------------------------------------------------------------
147    
148            objectClass = newObjectClass( "0.9.2342.19200300.100.4.6", registries );
149            objectClass.setObsolete( false );
150    
151            // set the objectclass type
152            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
153    
154            // set superior objectClasses
155            array.clear();
156            array.add( "top" );
157            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
158    
159            // set must list
160            array.clear();
161            array.add( "documentIdentifier" );
162            objectClass.setMustListIds( array.toArray( EMPTY ) );
163    
164            // set may list
165            array.clear();
166            array.add( "commonName" );
167            array.add( "description" );
168            array.add( "seeAlso" );
169            array.add( "localityName" );
170            array.add( "organizationName" );
171            array.add( "organizationalUnitName" );
172            array.add( "documentTitle" );
173            array.add( "documentVersion" );
174            array.add( "documentAuthor" );
175            array.add( "documentLocation" );
176            array.add( "documentPublisher" );
177            objectClass.setMayListIds( array.toArray( EMPTY ) );
178    
179            // set names
180            array.clear();
181            array.add( "document" );
182            objectClass.setNames( array.toArray( EMPTY ) );
183            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.6", objectClass );
184            // --------------------------------------------------------------------
185            // ObjectClass 0.9.2342.19200300.100.4.7 
186            // --------------------------------------------------------------------
187    
188            objectClass = newObjectClass( "0.9.2342.19200300.100.4.7", registries );
189            objectClass.setObsolete( false );
190    
191            // set the objectclass type
192            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
193    
194            // set superior objectClasses
195            array.clear();
196            array.add( "top" );
197            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
198    
199            // set must list
200            array.clear();
201            array.add( "commonName" );
202            objectClass.setMustListIds( array.toArray( EMPTY ) );
203    
204            // set may list
205            array.clear();
206            array.add( "roomNumber" );
207            array.add( "description" );
208            array.add( "seeAlso" );
209            array.add( "telephoneNumber" );
210            objectClass.setMayListIds( array.toArray( EMPTY ) );
211    
212            // set names
213            array.clear();
214            array.add( "room" );
215            objectClass.setNames( array.toArray( EMPTY ) );
216            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.7", objectClass );
217            // --------------------------------------------------------------------
218            // ObjectClass 0.9.2342.19200300.100.4.9 
219            // --------------------------------------------------------------------
220    
221            objectClass = newObjectClass( "0.9.2342.19200300.100.4.9", registries );
222            objectClass.setObsolete( false );
223    
224            // set the objectclass type
225            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
226    
227            // set superior objectClasses
228            array.clear();
229            array.add( "top" );
230            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
231    
232            // set must list
233            array.clear();
234            array.add( "commonName" );
235            objectClass.setMustListIds( array.toArray( EMPTY ) );
236    
237            // set may list
238            array.clear();
239            array.add( "description" );
240            array.add( "seeAlso" );
241            array.add( "telephonenumber" );
242            array.add( "localityName" );
243            array.add( "organizationName" );
244            array.add( "organizationalUnitName" );
245            objectClass.setMayListIds( array.toArray( EMPTY ) );
246    
247            // set names
248            array.clear();
249            array.add( "documentSeries" );
250            objectClass.setNames( array.toArray( EMPTY ) );
251            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.9", objectClass );
252            // --------------------------------------------------------------------
253            // ObjectClass 0.9.2342.19200300.100.4.13 
254            // --------------------------------------------------------------------
255    
256            objectClass = newObjectClass( "0.9.2342.19200300.100.4.13", registries );
257            objectClass.setObsolete( false );
258    
259            // set the objectclass type
260            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
261    
262            // set superior objectClasses
263            array.clear();
264            array.add( "top" );
265            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
266    
267            // set must list
268            array.clear();
269            array.add( "domainComponent" );
270            objectClass.setMustListIds( array.toArray( EMPTY ) );
271    
272            // set may list
273            array.clear();
274            array.add( "associatedName" );
275            array.add( "organizationName" );
276            array.add( "description" );
277            array.add( "businessCategory" );
278            array.add( "seeAlso" );
279            array.add( "searchGuide" );
280            array.add( "userPassword" );
281            array.add( "localityName" );
282            array.add( "stateOrProvinceName" );
283            array.add( "streetAddress" );
284            array.add( "physicalDeliveryOfficeName" );
285            array.add( "postalAddress" );
286            array.add( "postalCode" );
287            array.add( "postOfficeBox" );
288            array.add( "streetAddress" );
289            array.add( "facsimileTelephoneNumber" );
290            array.add( "internationalISDNNumber" );
291            array.add( "telephoneNumber" );
292            array.add( "teletexTerminalIdentifier" );
293            array.add( "telexNumber" );
294            array.add( "preferredDeliveryMethod" );
295            array.add( "destinationIndicator" );
296            array.add( "registeredAddress" );
297            array.add( "x121Address" );
298            objectClass.setMayListIds( array.toArray( EMPTY ) );
299    
300            // set names
301            array.clear();
302            array.add( "domain" );
303            objectClass.setNames( array.toArray( EMPTY ) );
304            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.13", objectClass );
305            // --------------------------------------------------------------------
306            // ObjectClass 0.9.2342.19200300.100.4.14 
307            // --------------------------------------------------------------------
308    
309            objectClass = newObjectClass( "0.9.2342.19200300.100.4.14", registries );
310            objectClass.setObsolete( false );
311    
312            // set the objectclass type
313            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
314    
315            // set superior objectClasses
316            array.clear();
317            array.add( "domain" );
318            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
319    
320            // set must list
321            array.clear();
322            objectClass.setMustListIds( array.toArray( EMPTY ) );
323    
324            // set may list
325            array.clear();
326            array.add( "commonName" );
327            array.add( "surname" );
328            array.add( "description" );
329            array.add( "seeAlso" );
330            array.add( "telephoneNumber" );
331            array.add( "physicalDeliveryOfficeName" );
332            array.add( "postalAddress" );
333            array.add( "postalCode" );
334            array.add( "postOfficeBox" );
335            array.add( "streetAddress" );
336            array.add( "facsimileTelephoneNumber" );
337            array.add( "internationalISDNNumber" );
338            array.add( "telephoneNumber" );
339            array.add( "teletexTerminalIdentifier" );
340            array.add( "telexNumber" );
341            array.add( "preferredDeliveryMethod" );
342            array.add( "destinationIndicator" );
343            array.add( "registeredAddress" );
344            array.add( "x121Address" );
345            objectClass.setMayListIds( array.toArray( EMPTY ) );
346    
347            // set names
348            array.clear();
349            array.add( "RFC822localPart" );
350            objectClass.setNames( array.toArray( EMPTY ) );
351            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.14", objectClass );
352            // --------------------------------------------------------------------
353            // ObjectClass 0.9.2342.19200300.100.4.15 
354            // --------------------------------------------------------------------
355    
356            objectClass = newObjectClass( "0.9.2342.19200300.100.4.15", registries );
357            objectClass.setObsolete( false );
358    
359            // set the objectclass type
360            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
361    
362            // set superior objectClasses
363            array.clear();
364            array.add( "domain" );
365            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
366    
367            // set must list
368            array.clear();
369            objectClass.setMustListIds( array.toArray( EMPTY ) );
370    
371            // set may list
372            array.clear();
373            array.add( "ARecord" );
374            array.add( "MDRecord" );
375            array.add( "MXRecord" );
376            array.add( "NSRecord" );
377            array.add( "SOARecord" );
378            array.add( "CNAMERecord" );
379            objectClass.setMayListIds( array.toArray( EMPTY ) );
380    
381            // set names
382            array.clear();
383            array.add( "dNSDomain" );
384            objectClass.setNames( array.toArray( EMPTY ) );
385            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.15", objectClass );
386            // --------------------------------------------------------------------
387            // ObjectClass 0.9.2342.19200300.100.4.17 
388            // --------------------------------------------------------------------
389    
390            objectClass = newObjectClass( "0.9.2342.19200300.100.4.17", registries );
391            objectClass.setObsolete( false );
392    
393            objectClass.setDescription( "RFC1274: an object related to an domain" );
394            // set the objectclass type
395            objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
396    
397            // set superior objectClasses
398            array.clear();
399            array.add( "top" );
400            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
401    
402            // set must list
403            array.clear();
404            array.add( "associatedDomain" );
405            objectClass.setMustListIds( array.toArray( EMPTY ) );
406    
407            // set may list
408            array.clear();
409            objectClass.setMayListIds( array.toArray( EMPTY ) );
410    
411            // set names
412            array.clear();
413            array.add( "domainRelatedObject" );
414            objectClass.setNames( array.toArray( EMPTY ) );
415            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.17", objectClass );
416            // --------------------------------------------------------------------
417            // ObjectClass 0.9.2342.19200300.100.4.18 
418            // --------------------------------------------------------------------
419    
420            objectClass = newObjectClass( "0.9.2342.19200300.100.4.18", registries );
421            objectClass.setObsolete( false );
422    
423            // set the objectclass type
424            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
425    
426            // set superior objectClasses
427            array.clear();
428            array.add( "country" );
429            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
430    
431            // set must list
432            array.clear();
433            array.add( "friendlyCountryName" );
434            objectClass.setMustListIds( array.toArray( EMPTY ) );
435    
436            // set may list
437            array.clear();
438            objectClass.setMayListIds( array.toArray( EMPTY ) );
439    
440            // set names
441            array.clear();
442            array.add( "friendlyCountry" );
443            objectClass.setNames( array.toArray( EMPTY ) );
444            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.18", objectClass );
445            // --------------------------------------------------------------------
446            // ObjectClass 0.9.2342.19200300.100.4.20 
447            // --------------------------------------------------------------------
448    
449            objectClass = newObjectClass( "0.9.2342.19200300.100.4.20", registries );
450            objectClass.setObsolete( false );
451    
452            // set the objectclass type
453            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
454    
455            // set superior objectClasses
456            array.clear();
457            array.add( "organization" );
458            array.add( "organizationalUnit" );
459            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
460    
461            // set must list
462            array.clear();
463            objectClass.setMustListIds( array.toArray( EMPTY ) );
464    
465            // set may list
466            array.clear();
467            array.add( "buildingName" );
468            objectClass.setMayListIds( array.toArray( EMPTY ) );
469    
470            // set names
471            array.clear();
472            array.add( "pilotOrganization" );
473            objectClass.setNames( array.toArray( EMPTY ) );
474            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.20", objectClass );
475            // --------------------------------------------------------------------
476            // ObjectClass 0.9.2342.19200300.100.4.21 
477            // --------------------------------------------------------------------
478    
479            objectClass = newObjectClass( "0.9.2342.19200300.100.4.21", registries );
480            objectClass.setObsolete( false );
481    
482            // set the objectclass type
483            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
484    
485            // set superior objectClasses
486            array.clear();
487            array.add( "dsa" );
488            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
489    
490            // set must list
491            array.clear();
492            objectClass.setMustListIds( array.toArray( EMPTY ) );
493    
494            // set may list
495            array.clear();
496            array.add( "dSAQuality" );
497            objectClass.setMayListIds( array.toArray( EMPTY ) );
498    
499            // set names
500            array.clear();
501            array.add( "pilotDSA" );
502            objectClass.setNames( array.toArray( EMPTY ) );
503            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.21", objectClass );
504            // --------------------------------------------------------------------
505            // ObjectClass 0.9.2342.19200300.100.4.22 
506            // --------------------------------------------------------------------
507    
508            objectClass = newObjectClass( "0.9.2342.19200300.100.4.22", registries );
509            objectClass.setObsolete( false );
510    
511            // set the objectclass type
512            objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
513    
514            // set superior objectClasses
515            array.clear();
516            array.add( "top" );
517            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
518    
519            // set must list
520            array.clear();
521            array.add( "dsaQuality" );
522            objectClass.setMustListIds( array.toArray( EMPTY ) );
523    
524            // set may list
525            array.clear();
526            array.add( "subtreeMinimumQuality" );
527            array.add( "subtreeMaximumQuality" );
528            objectClass.setMayListIds( array.toArray( EMPTY ) );
529    
530            // set names
531            array.clear();
532            array.add( "qualityLabelledData" );
533            objectClass.setNames( array.toArray( EMPTY ) );
534            cb.schemaObjectProduced( this, "0.9.2342.19200300.100.4.22", objectClass );
535        }
536    }