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