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 krb5kdc 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 Krb5kdcObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public Krb5kdcObjectClassProducer()
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.5322.10.2.1
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "1.3.6.1.4.1.5322.10.2.1", registries );
066 objectClass.setObsolete( false );
067
068 // set the objectclass type
069 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
070
071 // set superior objectClasses
072 array.clear();
073 array.add( "top" );
074 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
075
076 // set must list
077 array.clear();
078 array.add( "krb5PrincipalName" );
079 objectClass.setMustListIds( array.toArray( EMPTY ) );
080
081 // set may list
082 array.clear();
083 array.add( "cn" );
084 array.add( "krb5PrincipalRealm" );
085 objectClass.setMayListIds( array.toArray( EMPTY ) );
086
087 // set names
088 array.clear();
089 array.add( "krb5Principal" );
090 objectClass.setNames( array.toArray( EMPTY ) );
091 cb.schemaObjectProduced( this, "1.3.6.1.4.1.5322.10.2.1", objectClass );
092 // --------------------------------------------------------------------
093 // ObjectClass 1.3.6.1.4.1.5322.10.2.2
094 // --------------------------------------------------------------------
095
096 objectClass = newObjectClass( "1.3.6.1.4.1.5322.10.2.2", registries );
097 objectClass.setObsolete( false );
098
099 // set the objectclass type
100 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
101
102 // set superior objectClasses
103 array.clear();
104 array.add( "krb5Principal" );
105 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
106
107 // set must list
108 array.clear();
109 array.add( "krb5KeyVersionNumber" );
110 objectClass.setMustListIds( array.toArray( EMPTY ) );
111
112 // set may list
113 array.clear();
114 array.add( "krb5ValidStart" );
115 array.add( "krb5ValidEnd" );
116 array.add( "krb5PasswordEnd" );
117 array.add( "krb5MaxLife" );
118 array.add( "krb5MaxRenew" );
119 array.add( "krb5KDCFlags" );
120 array.add( "krb5EncryptionType" );
121 array.add( "krb5Key" );
122 array.add( "krb5AccountDisabled" );
123 array.add( "krb5AccountLockedOut" );
124 array.add( "krb5AccountExpirationTime" );
125 objectClass.setMayListIds( array.toArray( EMPTY ) );
126
127 // set names
128 array.clear();
129 array.add( "krb5KDCEntry" );
130 objectClass.setNames( array.toArray( EMPTY ) );
131 cb.schemaObjectProduced( this, "1.3.6.1.4.1.5322.10.2.2", objectClass );
132 // --------------------------------------------------------------------
133 // ObjectClass 1.3.6.1.4.1.5322.10.2.3
134 // --------------------------------------------------------------------
135
136 objectClass = newObjectClass( "1.3.6.1.4.1.5322.10.2.3", registries );
137 objectClass.setObsolete( false );
138
139 // set the objectclass type
140 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
141
142 // set superior objectClasses
143 array.clear();
144 array.add( "top" );
145 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
146
147 // set must list
148 array.clear();
149 array.add( "krb5RealmName" );
150 objectClass.setMustListIds( array.toArray( EMPTY ) );
151
152 // set may list
153 array.clear();
154 objectClass.setMayListIds( array.toArray( EMPTY ) );
155
156 // set names
157 array.clear();
158 array.add( "krb5Realm" );
159 objectClass.setNames( array.toArray( EMPTY ) );
160 cb.schemaObjectProduced( this, "1.3.6.1.4.1.5322.10.2.3", objectClass );
161 }
162 }