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.MatchingRule;
30 import org.apache.directory.api.ldap.model.schema.SchemaObjectType;
31
32
33
34
35
36
37
38 public class ImmutableMatchingRuleRegistry implements MatchingRuleRegistry
39 {
40
41 MatchingRuleRegistry immutableMatchingRuleRegistry;
42
43
44
45
46
47
48
49 public ImmutableMatchingRuleRegistry( MatchingRuleRegistry matchingRuleRegistry )
50 {
51 immutableMatchingRuleRegistry = matchingRuleRegistry;
52 }
53
54
55
56
57
58 public ImmutableMatchingRuleRegistry copy()
59 {
60 return ( ImmutableMatchingRuleRegistry ) immutableMatchingRuleRegistry.copy();
61 }
62
63
64
65
66
67 public int size()
68 {
69 return immutableMatchingRuleRegistry.size();
70 }
71
72
73
74
75
76 public boolean contains( String oid )
77 {
78 return immutableMatchingRuleRegistry.contains( oid );
79 }
80
81
82
83
84
85 public String getOidByName( String name ) throws LdapException
86 {
87 return immutableMatchingRuleRegistry.getOidByName( name );
88 }
89
90
91
92
93
94 public String getSchemaName( String oid ) throws LdapException
95 {
96 return immutableMatchingRuleRegistry.getSchemaName( oid );
97 }
98
99
100
101
102
103 public SchemaObjectType getType()
104 {
105 return immutableMatchingRuleRegistry.getType();
106 }
107
108
109
110
111
112 public Iterator<MatchingRule> iterator()
113 {
114 return immutableMatchingRuleRegistry.iterator();
115 }
116
117
118
119
120
121 public MatchingRule lookup( String oid ) throws LdapException
122 {
123 return immutableMatchingRuleRegistry.lookup( oid );
124 }
125
126
127
128
129
130 public Iterator<String> oidsIterator()
131 {
132 return immutableMatchingRuleRegistry.oidsIterator();
133 }
134
135
136
137
138
139 public void register( MatchingRule schemaObject ) throws LdapException
140 {
141 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
142 }
143
144
145
146
147
148 public void renameSchema( String originalSchemaName, String newSchemaName ) throws LdapException
149 {
150 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
151 }
152
153
154
155
156
157 public MatchingRule unregister( String numericOid ) throws LdapException
158 {
159 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
160 }
161
162
163
164
165
166 public void unregisterSchemaElements( String schemaName ) throws LdapException
167 {
168 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
169 }
170
171
172
173
174
175 public MatchingRule get( String oid )
176 {
177 return immutableMatchingRuleRegistry.get( oid );
178 }
179
180
181
182
183
184 public void clear() throws LdapException
185 {
186 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
187 }
188
189
190
191
192
193 public MatchingRule unregister( MatchingRule schemaObject ) throws LdapException
194 {
195 throw new LdapUnwillingToPerformException( ResultCodeEnum.NO_SUCH_OPERATION, I18n.err( I18n.ERR_04280 ) );
196 }
197 }