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 autofs 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 AutofsObjectClassProducer extends AbstractBootstrapProducer
039    {
040    
041        public AutofsObjectClassProducer()
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.4.1.2312.4.2.3 
063            // --------------------------------------------------------------------
064    
065            objectClass = newObjectClass( "1.3.6.1.4.1.2312.4.2.3", registries );
066            objectClass.setObsolete( false );
067    
068            objectClass.setDescription( "An entry in an automounter map" );
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( "automountInformation" );
081            objectClass.setMustListIds( array.toArray( EMPTY ) );
082    
083            // set may list
084            array.clear();
085            array.add( "description" );
086            objectClass.setMayListIds( array.toArray( EMPTY ) );
087    
088            // set names
089            array.clear();
090            array.add( "automount" );
091            objectClass.setNames( array.toArray( EMPTY ) );
092            cb.schemaObjectProduced( this, "1.3.6.1.4.1.2312.4.2.3", objectClass );
093            // --------------------------------------------------------------------
094            // ObjectClass 1.3.6.1.4.1.2312.4.2.2 
095            // --------------------------------------------------------------------
096    
097            objectClass = newObjectClass( "1.3.6.1.4.1.2312.4.2.2", registries );
098            objectClass.setObsolete( false );
099    
100            objectClass.setDescription( "An group of related automount objects" );
101            // set the objectclass type
102            objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
103    
104            // set superior objectClasses
105            array.clear();
106            array.add( "top" );
107            objectClass.setSuperClassIds( array.toArray( EMPTY ) );
108    
109            // set must list
110            array.clear();
111            array.add( "ou" );
112            objectClass.setMustListIds( array.toArray( EMPTY ) );
113    
114            // set may list
115            array.clear();
116            objectClass.setMayListIds( array.toArray( EMPTY ) );
117    
118            // set names
119            array.clear();
120            array.add( "automountMap" );
121            objectClass.setNames( array.toArray( EMPTY ) );
122            cb.schemaObjectProduced( this, "1.3.6.1.4.1.2312.4.2.2", objectClass );
123        }
124    }