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 corba 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 CorbaObjectClassProducer extends AbstractBootstrapProducer
039 {
040
041 public CorbaObjectClassProducer()
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.42.2.27.4.2.10
063 // --------------------------------------------------------------------
064
065 objectClass = newObjectClass( "1.3.6.1.4.1.42.2.27.4.2.10", registries );
066 objectClass.setObsolete( false );
067
068 objectClass.setDescription( "Container for a CORBA object" );
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 objectClass.setMustListIds( array.toArray( EMPTY ) );
081
082 // set may list
083 array.clear();
084 objectClass.setMayListIds( array.toArray( EMPTY ) );
085
086 // set names
087 array.clear();
088 array.add( "corbaContainer" );
089 objectClass.setNames( array.toArray( EMPTY ) );
090 cb.schemaObjectProduced( this, "1.3.6.1.4.1.42.2.27.4.2.10", objectClass );
091 // --------------------------------------------------------------------
092 // ObjectClass 1.3.6.1.4.1.42.2.27.4.2.9
093 // --------------------------------------------------------------------
094
095 objectClass = newObjectClass( "1.3.6.1.4.1.42.2.27.4.2.9", registries );
096 objectClass.setObsolete( false );
097
098 objectClass.setDescription( "CORBA object representation" );
099 // set the objectclass type
100 objectClass.setType( ObjectClassTypeEnum.ABSTRACT );
101
102 // set superior objectClasses
103 array.clear();
104 array.add( "top" );
105 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
106
107 // set must list
108 array.clear();
109 objectClass.setMustListIds( array.toArray( EMPTY ) );
110
111 // set may list
112 array.clear();
113 array.add( "corbaRepositoryId" );
114 array.add( "description" );
115 objectClass.setMayListIds( array.toArray( EMPTY ) );
116
117 // set names
118 array.clear();
119 array.add( "corbaObject" );
120 objectClass.setNames( array.toArray( EMPTY ) );
121 cb.schemaObjectProduced( this, "1.3.6.1.4.1.42.2.27.4.2.9", objectClass );
122 // --------------------------------------------------------------------
123 // ObjectClass 1.3.6.1.4.1.42.2.27.4.2.11
124 // --------------------------------------------------------------------
125
126 objectClass = newObjectClass( "1.3.6.1.4.1.42.2.27.4.2.11", registries );
127 objectClass.setObsolete( false );
128
129 objectClass.setDescription( "CORBA interoperable object reference" );
130 // set the objectclass type
131 objectClass.setType( ObjectClassTypeEnum.AUXILIARY );
132
133 // set superior objectClasses
134 array.clear();
135 array.add( "corbaObject" );
136 objectClass.setSuperClassIds( array.toArray( EMPTY ) );
137
138 // set must list
139 array.clear();
140 array.add( "corbaIor" );
141 objectClass.setMustListIds( array.toArray( EMPTY ) );
142
143 // set may list
144 array.clear();
145 objectClass.setMayListIds( array.toArray( EMPTY ) );
146
147 // set names
148 array.clear();
149 array.add( "corbaObjectReference" );
150 objectClass.setNames( array.toArray( EMPTY ) );
151 cb.schemaObjectProduced( this, "1.3.6.1.4.1.42.2.27.4.2.11", objectClass );
152 }
153 }