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
25 import org.apache.directory.api.i18n.I18n;
26 import org.apache.directory.api.ldap.model.exception.LdapException;
27 import org.apache.directory.api.ldap.model.exception.LdapUnwillingToPerformException;
28 import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
29 import org.apache.directory.api.ldap.model.schema.DitStructureRule;
30 import org.apache.directory.api.ldap.model.schema.SchemaObjectType;
31
32
33
34
35
36
37
38 public class ImmutableDitStructureRuleRegistry implements DitStructureRuleRegistry
39 {
40
41 DitStructureRuleRegistry immutableDITStructureRuleRegistry;
42
43
44
45
46
47
48
49 public ImmutableDitStructureRuleRegistry( DitStructureRuleRegistry ditStructureRuleRegistry )
50 {
51 immutableDITStructureRuleRegistry = ditStructureRuleRegistry;
52 }
53
54
55
56
57
58 @Override
59 public boolean contains( int ruleId )
60 {
61 return immutableDITStructureRuleRegistry.contains( ruleId );
62 }
63
64
65
66
67
68 @Override
69 public Iterator<DitStructureRule> iterator()
70 {
71 return immutableDITStructureRuleRegistry.iterator();
72 }
73
74
75
76
77
78 @Override
79 public Iterator<Integer> ruleIdIterator()
80 {
81 return immutableDITStructureRuleRegistry.ruleIdIterator();
82 }
83
84
85
86
87
88 @Override
89 public String getSchemaName( int ruleId ) throws LdapException
90 {
91 return immutableDITStructureRuleRegistry.getSchemaName( ruleId );
92 }
93
94
95
96
97
98 @Override
99 public void register( DitStructureRule ditStructureRule ) throws LdapException
100 {
101 }
102
103
104
105
106
107 @Override
108 public DitStructureRule lookup( int ruleId ) throws LdapException
109 {
110 return immutableDITStructureRuleRegistry.lookup( ruleId );
111 }
112
113
114
115
116
117 @Override
118 public void unregister( int ruleId ) throws LdapException
119 {
120 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
121 }
122
123
124
125
126
127 @Override
128 public void unregisterSchemaElements( String schemaName ) throws LdapException
129 {
130 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
131 }
132
133
134
135
136
137 @Override
138 public void renameSchema( String originalSchemaName, String newSchemaName ) throws LdapException
139 {
140 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
141 }
142
143
144
145
146
147 @Override
148 public ImmutableDitStructureRuleRegistry copy()
149 {
150 return ( ImmutableDitStructureRuleRegistry ) immutableDITStructureRuleRegistry.copy();
151 }
152
153
154
155
156
157 @Override
158 public int size()
159 {
160 return immutableDITStructureRuleRegistry.size();
161 }
162
163
164
165
166
167 @Override
168 public boolean contains( String oid )
169 {
170 return immutableDITStructureRuleRegistry.contains( oid );
171 }
172
173
174
175
176
177 @Override
178 public String getOidByName( String name ) throws LdapException
179 {
180 return immutableDITStructureRuleRegistry.getOidByName( name );
181 }
182
183
184
185
186
187 @Override
188 public String getSchemaName( String oid ) throws LdapException
189 {
190 return immutableDITStructureRuleRegistry.getSchemaName( oid );
191 }
192
193
194
195
196
197 @Override
198 public SchemaObjectType getType()
199 {
200 return immutableDITStructureRuleRegistry.getType();
201 }
202
203
204
205
206
207 @Override
208 public DitStructureRule lookup( String oid ) throws LdapException
209 {
210 return immutableDITStructureRuleRegistry.lookup( oid );
211 }
212
213
214
215
216
217 @Override
218 public Iterator<String> oidsIterator()
219 {
220 return immutableDITStructureRuleRegistry.oidsIterator();
221 }
222
223
224
225
226
227 @Override
228 public DitStructureRule unregister( String numericOid ) throws LdapException
229 {
230 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
231 }
232
233
234
235
236
237 @Override
238 public DitStructureRule get( String oid )
239 {
240 return immutableDITStructureRuleRegistry.get( oid );
241 }
242
243
244
245
246
247 @Override
248 public void clear() throws LdapException
249 {
250 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
251 }
252
253
254
255
256
257 @Override
258 public DitStructureRule unregister( DitStructureRule schemaObject ) throws LdapException
259 {
260 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04278 ) );
261 }
262 }