KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > aciitemeditor > model > ProtectedItemWrapperFactory


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20 package org.apache.directory.ldapstudio.aciitemeditor.model;
21
22
23 import org.apache.directory.ldapstudio.aciitemeditor.valueeditors.AttributeTypeAndValueValueEditor;
24 import org.apache.directory.ldapstudio.aciitemeditor.valueeditors.AttributeTypeValueEditor;
25 import org.apache.directory.ldapstudio.aciitemeditor.valueeditors.FilterValueEditor;
26 import org.apache.directory.ldapstudio.aciitemeditor.valueeditors.MaxValueCountValueEditor;
27 import org.apache.directory.ldapstudio.aciitemeditor.valueeditors.RestrictedByValueEditor;
28 import org.apache.directory.ldapstudio.valueeditors.TextValueEditor;
29 import org.apache.directory.ldapstudio.valueeditors.integer.IntegerValueEditor;
30 import org.apache.directory.shared.ldap.aci.ProtectedItem;
31
32
33 /**
34  * The ProtectedItemWrapperFactory creates the ProtectedItemWrappers, ready to
35  * be used in the protected item table.
36  *
37  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
38  * @version $Rev$, $Date$
39  */

40 public class ProtectedItemWrapperFactory
41 {
42
43     /**
44      * Creates the protected item wrappers.
45      *
46      * @return the protected item wrapper[]
47      */

48     public static final ProtectedItemWrapper[] createProtectedItemWrappers()
49     {
50         ProtectedItemWrapper[] protectedItemWrappers = new ProtectedItemWrapper[]
51             {
52                 // entry
53
new ProtectedItemWrapper( ProtectedItem.Entry.class, false, "", //$NON-NLS-1$
54
"", //$NON-NLS-1$
55
null ),
56
57                 // allUserAttributeTypes
58
new ProtectedItemWrapper( ProtectedItem.AllUserAttributeTypes.class, false, "", //$NON-NLS-1$
59
"", //$NON-NLS-1$
60
null ),
61
62                 // attributeType { 1.2.3, cn }
63
new ProtectedItemWrapper( ProtectedItem.AttributeType.class, true, "", //$NON-NLS-1$
64
"", //$NON-NLS-1$
65
new AttributeTypeValueEditor() ),
66
67                 // allAttributeValues { 1.2.3, cn }
68
new ProtectedItemWrapper( ProtectedItem.AllAttributeValues.class, true, "", //$NON-NLS-1$
69
"", //$NON-NLS-1$
70
new AttributeTypeValueEditor() ),
71
72                 // attributeType
73
new ProtectedItemWrapper( ProtectedItem.AllUserAttributeTypesAndValues.class, false, "", //$NON-NLS-1$
74
"", //$NON-NLS-1$
75
null ),
76
77                 // attributeValue { ou=people, cn=Ersin }
78
new ProtectedItemWrapper( ProtectedItem.AttributeValue.class, true, "", //$NON-NLS-1$
79
"", //$NON-NLS-1$
80
new AttributeTypeAndValueValueEditor() ),
81
82                 // selfValue { 1.2.3, cn }
83
new ProtectedItemWrapper( ProtectedItem.SelfValue.class, true, "", //$NON-NLS-1$
84
"", //$NON-NLS-1$
85
new AttributeTypeValueEditor() ),
86
87                 // rangeOfValues (cn=E*)
88
new ProtectedItemWrapper( ProtectedItem.RangeOfValues.class, false, "", //$NON-NLS-1$
89
"", //$NON-NLS-1$
90
new FilterValueEditor() ),
91
92                 // maxValueCount { { type 10.11.12, maxCount 10 }, { maxCount 20, type 11.12.13 } }
93
new ProtectedItemWrapper( ProtectedItem.MaxValueCount.class, true, "", //$NON-NLS-1$
94
"", //$NON-NLS-1$
95
new MaxValueCountValueEditor() ),
96
97                 // maxImmSub 3
98
new ProtectedItemWrapper( ProtectedItem.MaxImmSub.class, false, "", //$NON-NLS-1$
99
"", //$NON-NLS-1$
100
new IntegerValueEditor() ),
101
102                 // restrictedBy { { type 10.11.12, valuesIn ou }, { valuesIn cn, type 11.12.13 } }
103
new ProtectedItemWrapper( ProtectedItem.RestrictedBy.class, true, "", //$NON-NLS-1$
104
"", //$NON-NLS-1$
105
new RestrictedByValueEditor() ),
106
107                 // classes and : { item: xyz , or:{item:X,item:Y} }
108
new ProtectedItemWrapper( ProtectedItem.Classes.class, false, "", //$NON-NLS-1$
109
"", //$NON-NLS-1$
110
new TextValueEditor() // TODO: RefinementValueEditor
111
),
112
113             };
114
115         return protectedItemWrappers;
116     }
117
118 }
119
Popular Tags