View Javadoc

1   /*
2    *   Copyright 2004 The Apache Software Foundation
3    *
4    *   Licensed under the Apache License, Version 2.0 (the "License");
5    *   you may not use this file except in compliance with the License.
6    *   You may obtain a copy of the License at
7    *
8    *       http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *   Unless required by applicable law or agreed to in writing, software
11   *   distributed under the License is distributed on an "AS IS" BASIS,
12   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *   See the License for the specific language governing permissions and
14   *   limitations under the License.
15   *
16   */
17  package org.apache.jetspeed.security.ldap;
18  
19  
20  import java.util.ArrayList;
21  import javax.naming.NamingException;
22  import org.apache.ldap.common.schema.ObjectClassTypeEnum;
23  
24  import org.apache.ldap.server.schema.bootstrap.*;
25  
26  /***
27   * A producer of schema objectClass definations for the jetspeed schema.  This
28   * code has been automatically generated using schema files in the OpenLDAP
29   * format along with the directory plugin for maven.  This has been done
30   * to facilitate OpenLDAP schema interoperability.
31   *
32   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33   * @version $Rev$
34   */
35  public class JetspeedObjectClassProducer extends AbstractBootstrapProducer
36  {
37  
38      public JetspeedObjectClassProducer()
39      {
40          super( ProducerTypeEnum.OBJECT_CLASS_PRODUCER );
41      }
42  
43  
44      // ------------------------------------------------------------------------
45      // BootstrapProducer Methods
46      // ------------------------------------------------------------------------
47  
48  
49      /***
50       * @see BootstrapProducer#produce(BootstrapRegistries, ProducerCallback)
51       */
52      public void produce( BootstrapRegistries registries, ProducerCallback cb )
53          throws NamingException
54      {
55          ArrayList array = new ArrayList();
56          BootstrapObjectClass objectClass;
57  
58          
59          // --------------------------------------------------------------------
60          // ObjectClass 1.3.6.1.4.1.8100.1.2.4.2 
61          // --------------------------------------------------------------------
62  
63          objectClass = newObjectClass( "1.3.6.1.4.1.8100.1.2.4.2", registries );
64          objectClass.setObsolete( false );
65  
66          objectClass.setDescription( "Jetspeed-2 permission" );
67          // set the objectclass type
68          objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
69          
70          // set superior objectClasses
71          array.clear();
72          objectClass.setSuperClassIds( ( String[] ) array.toArray( EMPTY ) );
73          
74          // set must list
75          array.clear();
76          array.add( "j2-classname" );
77          array.add( "uid" );
78          objectClass.setMustListIds( ( String[] ) array.toArray( EMPTY ) );
79          
80          // set may list
81          array.clear();
82          array.add( "j2-action" );
83          array.add( "creation-date" );
84          array.add( "modified-date" );
85          objectClass.setMayListIds( ( String[] ) array.toArray( EMPTY ) );
86          
87          // set names
88          array.clear();
89          array.add( "jetspeed-2-permission" );
90          objectClass.setNames( ( String[] ) array.toArray( EMPTY ) );
91          cb.schemaObjectProduced( this, "1.3.6.1.4.1.8100.1.2.4.2", objectClass );
92  
93   
94          // --------------------------------------------------------------------
95          // ObjectClass 1.3.6.1.4.1.8100.1.2.4.4 
96          // --------------------------------------------------------------------
97  
98          objectClass = newObjectClass( "1.3.6.1.4.1.8100.1.2.4.4", registries );
99          objectClass.setObsolete( false );
100 
101         objectClass.setDescription( "Jetspeed-2 user" );
102         // set the objectclass type
103         objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
104         
105         // set superior objectClasses
106         array.clear();
107         array.add( "inetOrgPerson" );
108         objectClass.setSuperClassIds( ( String[] ) array.toArray( EMPTY ) );
109         
110         // set must list
111         array.clear();
112         array.add( "cn" );
113         array.add( "uid" );
114         objectClass.setMustListIds( ( String[] ) array.toArray( EMPTY ) );
115         
116         // set may list
117         array.clear();
118         array.add( "j2-role" );
119         array.add( "j2-group" );
120         array.add( "j2-permission" );
121         array.add( "creation-date" );
122         array.add( "modified-date" );
123         objectClass.setMayListIds( ( String[] ) array.toArray( EMPTY ) );
124         
125         // set names
126         array.clear();
127         array.add( "jetspeed-2-user" );
128         objectClass.setNames( ( String[] ) array.toArray( EMPTY ) );
129         cb.schemaObjectProduced( this, "1.3.6.1.4.1.8100.1.2.4.4", objectClass );
130 
131  
132         // --------------------------------------------------------------------
133         // ObjectClass 1.3.6.1.4.1.8100.1.2.4.1 
134         // --------------------------------------------------------------------
135 
136         objectClass = newObjectClass( "1.3.6.1.4.1.8100.1.2.4.1", registries );
137         objectClass.setObsolete( false );
138 
139         objectClass.setDescription( "Jetspeed-2 group" );
140         // set the objectclass type
141         objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
142         
143         // set superior objectClasses
144         array.clear();
145         array.add( "groupOfUniqueNames" );
146         objectClass.setSuperClassIds( ( String[] ) array.toArray( EMPTY ) );
147         
148         // set must list
149         array.clear();
150         array.add( "j2-classname" );
151         array.add( "uid" );
152         objectClass.setMustListIds( ( String[] ) array.toArray( EMPTY ) );
153         
154         // set may list
155         array.clear();
156         array.add( "j2-role" );
157         array.add( "creation-date" );
158         array.add( "modified-date" );
159         array.add( "cn" );
160         array.add( "ou" );
161         objectClass.setMayListIds( ( String[] ) array.toArray( EMPTY ) );
162         
163         // set names
164         array.clear();
165         array.add( "jetspeed-2-group" );
166         objectClass.setNames( ( String[] ) array.toArray( EMPTY ) );
167         cb.schemaObjectProduced( this, "1.3.6.1.4.1.8100.1.2.4.1", objectClass );
168 
169  
170         // --------------------------------------------------------------------
171         // ObjectClass 1.3.6.1.4.1.8100.1.2.4.3 
172         // --------------------------------------------------------------------
173 
174         objectClass = newObjectClass( "1.3.6.1.4.1.8100.1.2.4.3", registries );
175         objectClass.setObsolete( false );
176 
177         objectClass.setDescription( "Jetspeed-2 role" );
178         // set the objectclass type
179         objectClass.setType( ObjectClassTypeEnum.STRUCTURAL );
180         
181         // set superior objectClasses
182         array.clear();
183         array.add( "groupOfUniqueNames" );
184         objectClass.setSuperClassIds( ( String[] ) array.toArray( EMPTY ) );
185         
186         // set must list
187         array.clear();
188         array.add( "j2-classname" );
189         array.add( "uid" );
190         objectClass.setMustListIds( ( String[] ) array.toArray( EMPTY ) );
191         
192         // set may list
193         array.clear();
194         array.add( "creation-date" );
195         array.add( "modified-date" );
196         array.add( "cn" );
197         array.add( "ou" );
198         objectClass.setMayListIds( ( String[] ) array.toArray( EMPTY ) );
199         
200         // set names
201         array.clear();
202         array.add( "jetspeed-2-role" );
203         objectClass.setNames( ( String[] ) array.toArray( EMPTY ) );
204         cb.schemaObjectProduced( this, "1.3.6.1.4.1.8100.1.2.4.3", objectClass );
205 
206     }
207 }