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 inetorgperson 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 InetorgpersonObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public InetorgpersonObjectClassProducer()
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.113730.3.2.2
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "2.16.840.1.113730.3.2.2", registries );
066 objectClass.setObsolete( false );
067
068 objectClass.setDescription( "RFC2798: Internet Organizational Person" );
069 // set the objectclass type
070 objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
071
072 // set superior objectClasses
073 array.clear();
074 array.add( "organizationalPerson" );
075 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
076
077 // set must list
078 array.clear();
079 objectClass.setMustListIds( array.toArray( EMPTY ) );
080
081 // set may list
082 array.clear();
083 array.add( "audio" );
084 array.add( "businessCategory" );
085 array.add( "carLicense" );
086 array.add( "departmentNumber" );
087 array.add( "displayName" );
088 array.add( "employeeNumber" );
089 array.add( "employeeType" );
090 array.add( "givenName" );
091 array.add( "homePhone" );
092 array.add( "homePostalAddress" );
093 array.add( "initials" );
094 array.add( "jpegPhoto" );
095 array.add( "labeledURI" );
096 array.add( "mail" );
097 array.add( "manager" );
098 array.add( "mobile" );
099 array.add( "o" );
100 array.add( "pager" );
101 array.add( "photo" );
102 array.add( "roomNumber" );
103 array.add( "secretary" );
104 array.add( "uid" );
105 array.add( "userCertificate" );
106 array.add( "x500uniqueIdentifier" );
107 array.add( "preferredLanguage" );
108 array.add( "userSMIMECertificate" );
109 array.add( "userPKCS12" );
110 objectClass.setMayListIds( array.toArray( EMPTY ) );
111
112 // set names
113 array.clear();
114 array.add( "inetOrgPerson" );
115 objectClass.setNames( array.toArray( EMPTY ) );
116 cb.schemaObjectProduced( this, "2.16.840.1.113730.3.2.2", objectClass );
117 }
118 }