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    
027    import org.apache.directory.server.schema.registries.Registries;
028    import org.apache.directory.shared.ldap.schema.UsageEnum;
029    
030    
031    /**
032     * A producer of schema attributeType definations for the autofs schema.  This
033     * code has been automatically generated using schema files in the OpenLDAP
034     * format along with the directory plugin for maven.  This has been done
035     * to facilitate Eve<->OpenLDAP schema interoperability.
036     *
037     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
038     */
039    public class AutofsAttributeTypeProducer extends AbstractBootstrapProducer
040    {
041    
042        public AutofsAttributeTypeProducer()
043        {
044            super( ProducerTypeEnum.ATTRIBUTE_TYPE_PRODUCER );
045        }
046    
047    
048        // ------------------------------------------------------------------------
049        // BootstrapProducer Methods
050        // ------------------------------------------------------------------------
051    
052    
053        /**
054         * @see BootstrapProducer#produce( Registries, ProducerCallback )
055         */
056        public void produce( Registries registries, ProducerCallback cb )
057            throws NamingException
058        {
059            ArrayList<String> names = new ArrayList<String>();
060            BootstrapAttributeType attributeType;
061    
062    
063            // --------------------------------------------------------------------
064            // AttributeType 1.3.6.1.4.1.2312.4.1.2 
065            // --------------------------------------------------------------------
066    
067            attributeType = newAttributeType( "1.3.6.1.4.1.2312.4.1.2", registries );
068            attributeType.setDescription( "Information used by the autofs automounter" );
069            attributeType.setCanUserModify( ! false );
070            attributeType.setSingleValue( true );
071            attributeType.setCollective( false );
072            attributeType.setObsolete( false );
073            attributeType.setLength( 0 );
074            attributeType.setUsage( UsageEnum.getUsage( "USER_APPLICATIONS" ) );
075            attributeType.setEqualityId( "caseExactMatch" );
076            attributeType.setSyntaxId( "1.3.6.1.4.1.1466.115.121.1.26" );
077    
078            names.clear();
079            names.add( "automountInformation" );
080            attributeType.setNames( names.toArray( EMPTY ) );
081            cb.schemaObjectProduced( this, "1.3.6.1.4.1.2312.4.1.2", attributeType );
082        }
083    }