1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.directory.api.ldap.model.schema.registries;
21
22
23 import java.util.Iterator;
24 import java.util.List;
25
26 import org.apache.directory.api.i18n.I18n;
27 import org.apache.directory.api.ldap.model.exception.LdapException;
28 import org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException;
29 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
30 import org.apache.directory.api.ldap.model.schema.ObjectClass;
31 import org.apache.directory.api.ldap.model.schema.SchemaObjectType;
32
33
34
35
36
37
38
39 public class ImmutableObjectClassRegistry implements ObjectClassRegistry, Cloneable
40 {
41
42 private ObjectClassRegistry immutableObjectClassRegistry;
43
44
45
46
47
48
49
50 public ImmutableObjectClassRegistry( ObjectClassRegistry ocRegistry )
51 {
52 immutableObjectClassRegistry = ocRegistry;
53 }
54
55
56
57
58
59 public boolean hasDescendants( String ancestorId ) throws LdapException
60 {
61 return immutableObjectClassRegistry.hasDescendants( ancestorId );
62 }
63
64
65
66
67
68 public Iterator<ObjectClass> descendants( String ancestorId ) throws LdapException
69 {
70 return immutableObjectClassRegistry.descendants( ancestorId );
71 }
72
73
74
75
76
77 public void registerDescendants( ObjectClass objectClass, List<ObjectClass> ancestors ) throws LdapException
78 {
79 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
80 }
81
82
83
84
85
86 public void unregisterDescendants( ObjectClass attributeType, List<ObjectClass> ancestors ) throws LdapException
87 {
88 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
89 }
90
91
92
93
94
95 public void register( ObjectClass objectClass ) throws LdapException
96 {
97 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
98 }
99
100
101
102
103
104 public ObjectClass unregister( String numericOid ) throws LdapException
105 {
106 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
107 }
108
109
110
111
112
113 public ImmutableObjectClassRegistry copy()
114 {
115 return ( ImmutableObjectClassRegistry ) immutableObjectClassRegistry.copy();
116 }
117
118
119
120
121
122 public int size()
123 {
124 return immutableObjectClassRegistry.size();
125 }
126
127
128
129
130
131 public boolean contains( String oid )
132 {
133 return immutableObjectClassRegistry.contains( oid );
134 }
135
136
137
138
139
140 public String getOidByName( String name ) throws LdapException
141 {
142 return immutableObjectClassRegistry.getOidByName( name );
143 }
144
145
146
147
148
149 public String getSchemaName( String oid ) throws LdapException
150 {
151 return immutableObjectClassRegistry.getSchemaName( oid );
152 }
153
154
155
156
157
158 public SchemaObjectType getType()
159 {
160 return immutableObjectClassRegistry.getType();
161 }
162
163
164
165
166
167 public Iterator<ObjectClass> iterator()
168 {
169 return immutableObjectClassRegistry.iterator();
170 }
171
172
173
174
175
176 public ObjectClass lookup( String oid ) throws LdapException
177 {
178 return immutableObjectClassRegistry.lookup( oid );
179 }
180
181
182
183
184
185 public Iterator<String> oidsIterator()
186 {
187 return immutableObjectClassRegistry.oidsIterator();
188 }
189
190
191
192
193
194 public void renameSchema( String originalSchemaName, String newSchemaName ) throws LdapException
195 {
196 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
197 }
198
199
200
201
202
203 public void unregisterSchemaElements( String schemaName ) throws LdapException
204 {
205 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
206 }
207
208
209
210
211
212 public ObjectClass get( String oid )
213 {
214 return immutableObjectClassRegistry.get( oid );
215 }
216
217
218
219
220
221 public void clear() throws LdapException
222 {
223 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
224 }
225
226
227
228
229
230 public ObjectClass unregister( ObjectClass schemaObject ) throws LdapException
231 {
232 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
233 }
234 }