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 @Override
60 public boolean hasDescendants( String ancestorId ) throws LdapException
61 {
62 return immutableObjectClassRegistry.hasDescendants( ancestorId );
63 }
64
65
66
67
68
69 @Override
70 public Iterator<ObjectClass> descendants( String ancestorId ) throws LdapException
71 {
72 return immutableObjectClassRegistry.descendants( ancestorId );
73 }
74
75
76
77
78
79 @Override
80 public void registerDescendants( ObjectClass objectClass, List<ObjectClass> ancestors ) throws LdapException
81 {
82 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
83 }
84
85
86
87
88
89 @Override
90 public void unregisterDescendants( ObjectClass attributeType, List<ObjectClass> ancestors ) throws LdapException
91 {
92 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
93 }
94
95
96
97
98
99 @Override
100 public void register( ObjectClass objectClass ) throws LdapException
101 {
102 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
103 }
104
105
106
107
108
109 @Override
110 public ObjectClass unregister( String numericOid ) throws LdapException
111 {
112 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
113 }
114
115
116
117
118
119 @Override
120 public ImmutableObjectClassRegistry copy()
121 {
122 return ( ImmutableObjectClassRegistry ) immutableObjectClassRegistry.copy();
123 }
124
125
126
127
128
129 @Override
130 public int size()
131 {
132 return immutableObjectClassRegistry.size();
133 }
134
135
136
137
138
139 @Override
140 public boolean contains( String oid )
141 {
142 return immutableObjectClassRegistry.contains( oid );
143 }
144
145
146
147
148
149 @Override
150 public String getOidByName( String name ) throws LdapException
151 {
152 return immutableObjectClassRegistry.getOidByName( name );
153 }
154
155
156
157
158
159 @Override
160 public String getSchemaName( String oid ) throws LdapException
161 {
162 return immutableObjectClassRegistry.getSchemaName( oid );
163 }
164
165
166
167
168
169 @Override
170 public SchemaObjectType getType()
171 {
172 return immutableObjectClassRegistry.getType();
173 }
174
175
176
177
178
179 @Override
180 public Iterator<ObjectClass> iterator()
181 {
182 return immutableObjectClassRegistry.iterator();
183 }
184
185
186
187
188
189 @Override
190 public ObjectClass lookup( String oid ) throws LdapException
191 {
192 return immutableObjectClassRegistry.lookup( oid );
193 }
194
195
196
197
198
199 @Override
200 public Iterator<String> oidsIterator()
201 {
202 return immutableObjectClassRegistry.oidsIterator();
203 }
204
205
206
207
208
209 @Override
210 public void renameSchema( String originalSchemaName, String newSchemaName ) throws LdapException
211 {
212 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
213 }
214
215
216
217
218
219 @Override
220 public void unregisterSchemaElements( String schemaName ) throws LdapException
221 {
222 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
223 }
224
225
226
227
228
229 @Override
230 public ObjectClass get( String oid )
231 {
232 return immutableObjectClassRegistry.get( oid );
233 }
234
235
236
237
238
239 @Override
240 public void clear() throws LdapException
241 {
242 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
243 }
244
245
246
247
248
249 @Override
250 public ObjectClass unregister( ObjectClass schemaObject ) throws LdapException
251 {
252 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04284 ) );
253 }
254 }