KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > directory > ldapstudio > browser > core > model > IAttribute


1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  *
19  */

20
21 package org.apache.directory.ldapstudio.browser.core.model;
22
23
24 import java.io.Serializable JavaDoc;
25
26 import org.apache.directory.ldapstudio.browser.core.internal.model.AttributeDescription;
27 import org.apache.directory.ldapstudio.browser.core.model.schema.AttributeTypeDescription;
28 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.AttributePropertyPageProvider;
29 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ConnectionPropertyPageProvider;
30 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.EntryPropertyPageProvider;
31 import org.eclipse.core.runtime.IAdaptable;
32
33
34 /**
35  * An IAttribute represents an LDAP attribute.
36  */

37 public interface IAttribute extends Serializable JavaDoc, IAdaptable, AttributePropertyPageProvider, EntryPropertyPageProvider,
38     ConnectionPropertyPageProvider
39 {
40
41     /**
42      * ( 2.5.18.3 NAME 'creatorsName' EQUALITY distinguishedNameMatch SYNTAX
43      * 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE
44      * directoryOperation )
45      */

46     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_CREATORS_NAME = "creatorsName"; //$NON-NLS-1$
47

48     /**
49      * ( 2.5.18.1 NAME 'createTimestamp' EQUALITY generalizedTimeMatch
50      * ORDERING generalizedTimeOrderingMatch SYNTAX
51      * 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE
52      * directoryOperation )
53      */

54     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP = "createTimestamp"; //$NON-NLS-1$
55

56     /**
57      * ( 2.5.18.4 NAME 'modifiersName' EQUALITY distinguishedNameMatch
58      * SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE
59      * NO-USER-MODIFICATION USAGE directoryOperation )
60      */

61     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_MODIFIERS_NAME = "modifiersName"; //$NON-NLS-1$
62

63     /**
64      * ( 2.5.18.2 NAME 'modifyTimestamp' EQUALITY generalizedTimeMatch
65      * ORDERING generalizedTimeOrderingMatch SYNTAX
66      * 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFICATION USAGE
67      * directoryOperation )
68      */

69     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_MODIFY_TIMESTAMP = "modifyTimestamp"; //$NON-NLS-1$
70

71     /**
72      * ( 2.5.21.9 NAME 'structuralObjectClass' EQUALITY
73      * objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.38
74      * SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
75      */

76     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_STRUCTURAL_OBJECT_CLASS = "structuralObjectClass"; //$NON-NLS-1$
77

78     /**
79      * ( 2.5.21.10 NAME 'governingStructureRule' EQUALITY integerMatch
80      * SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE
81      * NO-USER-MODIFICATION USAGE directoryOperation )
82      */

83     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_GOVERNING_STRUCTURE_RULE = "governingStructureRule"; //$NON-NLS-1$
84

85     /**
86      * ( 1.3.6.1.1.16.4 NAME 'entryUUID' DESC 'UUID of the entry' EQUALITY
87      * uuidMatch ORDERING uuidOrderingMatch SYNTAX 1.3.6.1.1.16.1
88      * SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
89      */

90     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_ENTRY_UUID = "entryUUID"; //$NON-NLS-1$
91

92     /**
93      * ( 2.5.18.10 NAME 'subschemaSubentry' EQUALITY distinguishedNameMatch
94      * SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE
95      * NO-USER-MODIFICATION USAGE directoryOperation )
96      */

97     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_SUBSCHEMA_SUBENTRY = "subschemaSubentry"; //$NON-NLS-1$
98

99     /**
100      * ( 2.5.18.9 NAME 'hasSubordinates' DESC 'X.501: entry has children'
101      * EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
102      * SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
103      */

104     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_HAS_SUBORDINATES = "hasSubordinates"; //$NON-NLS-1$
105

106     /**
107      * ( 1.3.1.1.4.1.453.16.2.103 NAME 'numSubordinates' DESC 'count of
108      * immediate subordinates' EQUALITY integerMatch ORDERING
109      * integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
110      * SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN
111      * 'numSubordinates Internet Draft' )
112      */

113     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_NUM_SUBORDINATES = "numSubordinates"; //$NON-NLS-1$
114

115     /**
116      * ( 2.16.840.1.113719.1.27.4.49 NAME 'subordinateCount' DESC
117      * 'Operational Attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
118      * SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
119      */

120     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_SUBORDINATE_COUNT = "subordinateCount"; //$NON-NLS-1$
121

122     /**
123      * ( 1.3.6.1.1.4 NAME 'vendorName' EQUALITY caseExactIA5Match SYNTAX
124      * 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE
125      * dSAOperation )
126      */

127     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_VENDOR_NAME = "vendorName"; //$NON-NLS-1$
128

129     /**
130      * ( 1.3.6.1.1.5 NAME 'vendorVersion' EQUALITY caseExactIA5Match SYNTAX
131      * 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE NO-USER-MODIFICATION USAGE
132      * dSAOperation )
133      */

134     public static final String JavaDoc OPERATIONAL_ATTRIBUTE_VENDOR_VERSION = "vendorVersion"; //$NON-NLS-1$
135

136     /** The attribute type objectClass */
137     public static final String JavaDoc OBJECTCLASS_ATTRIBUTE = "objectClass"; //$NON-NLS-1$
138

139     /** The OID of the objectClass attribute, 2.5.4.0 */
140     public static final String JavaDoc OBJECTCLASS_ATTRIBUTE_OID = "2.5.4.0"; //$NON-NLS-1$
141

142     /** The attribute type ref */
143     public static final String JavaDoc REFERRAL_ATTRIBUTE = "ref"; //$NON-NLS-1$
144

145     /** The attribute type aliasedObjectName */
146     public static final String JavaDoc ALIAS_ATTRIBUTE = "aliasedObjectName"; //$NON-NLS-1$
147

148     /** The options delimiter ';' */
149     public static final String JavaDoc OPTION_DELIMITER = ";"; //$NON-NLS-1$
150

151     /** The language tag prefix 'lang-' */
152     public static final String JavaDoc OPTION_LANG_PREFIX = "lang-"; //$NON-NLS-1$
153

154
155     /**
156      * Gets the entry of this attribute.
157      *
158      * @return the entry of this attribute, never null
159      */

160     public abstract IEntry getEntry();
161
162
163     /**
164      * Returns true if this attribute is consistent. The following
165      * conditions must be fulfilled:
166      *
167      * <ul>
168      * <li>The attribute must contain at least one value</li>
169      * <li>The attribute mustn't contain any empty value</li>
170      * </ul>
171      *
172      * @return true if the attribute ist consistent
173      */

174     public abstract boolean isConsistent();
175
176
177     /**
178      * Returns true if this attribute is a must attribute of its entry
179      * according to the schema and the entry's object classes.
180      *
181      * @return true if this attribute is a must attribute of its entry.
182      */

183     public abstract boolean isMustAttribute();
184
185
186     /**
187      * Returns true if this attribute is a may attribute of its entry
188      * according to the schema and the entry's object classes.
189      *
190      * @return true if this attribute is a may attribute of its entry.
191      */

192     public abstract boolean isMayAttribute();
193
194
195     /**
196      * Returns true if this attribute is an operational attribute according
197      * to the schema.
198      *
199      * @return true if this attribute is an operational attribute.
200      */

201     public abstract boolean isOperationalAttribute();
202
203
204     /**
205      * Return true if this attribute is the objeCtclass attribute.
206      *
207      * @return true if this attribute is the objectClass attribute.
208      */

209     public abstract boolean isObjectClassAttribute();
210
211
212     /**
213      * Return true if the attribute is of type String.
214      *
215      * @return true if the attribute is of type String.
216      */

217     public abstract boolean isString();
218
219
220     /**
221      * Return true if the attribute is of type byte[].
222      *
223      * @return true if the attribute is of type byte[].
224      */

225     public abstract boolean isBinary();
226
227
228     /**
229      * Adds an empty value.
230      *
231      */

232     public abstract void addEmptyValue();
233
234
235     /**
236      * Removes one empty value if one is present.
237      *
238      */

239     public abstract void deleteEmptyValue();
240
241
242     /**
243      * Adds the given value to this attribute. The value's attribute must be
244      * this attribute.
245      *
246      * @param valueToAdd
247      * the value to add
248      * @throws ModelModificationException
249      * if the value is null or if the value's attribute
250      * isn't this attribute.
251      */

252     public abstract void addValue( IValue valueToAdd ) throws ModelModificationException;
253
254
255     /**
256      * Deletes the given value from this attribute.
257      *
258      * @param valueToDelete
259      * the value to delete
260      * @throws ModelModificationException
261      * if the value is null or if the value's attribute
262      * isn't this attribute.
263      */

264     public abstract void deleteValue( IValue valueToDelete ) throws ModelModificationException;
265
266
267     /**
268      * Replaces the old value with the new value.
269      *
270      * @param oldValue
271      * the value that should be replaced
272      * @param newValue
273      * the value that should be added
274      * @throws ModelModificationException
275      * if the value is null or if the value's attribute
276      * isn't this attribute.
277      */

278     public abstract void modifyValue( IValue oldValue, IValue newValue )
279         throws ModelModificationException;
280
281
282     /**
283      * Gets the values of this attribute.
284      *
285      * @return the values of this attribute, may be an empty array, never null.
286      */

287     public abstract IValue[] getValues();
288
289
290     /**
291      * Gets the number of values in this attribute.
292      *
293      * @return the number of values in this attribute.
294      */

295     public abstract int getValueSize();
296
297
298     /**
299      * Gets the description of this attribute. The description
300      * consists of the attribute type and optional options.
301      *
302      * @return the description of this attribute.
303      */

304     public abstract String JavaDoc getDescription();
305
306
307     /**
308      * Gets the type of this attribute (description without options).
309      *
310      * @return the attribute type.
311      */

312     public abstract String JavaDoc getType();
313
314
315     /**
316      * Gets all values as byte[]. If the values aren't binary they are
317      * converted to byte[] using UTF-8 encoding.
318      *
319      * @return The binary values
320      */

321     public abstract byte[][] getBinaryValues();
322
323
324     /**
325      * Gets the first value as string if one is present, null otherwise
326      *
327      * @return The first value if one present, null otherwise
328      */

329     public abstract String JavaDoc getStringValue();
330
331
332     /**
333      * Gets all values as String. If the values aren't strings they are
334      * converted using UTF-8 encoding.
335      *
336      * @return The string values
337      */

338     public abstract String JavaDoc[] getStringValues();
339
340
341     /**
342      * Returns true if the argument is also of type IAttribute and they are
343      * equal.
344      *
345      * IAttributes are equal if there entries and there attribute
346      * description are equal.
347      *
348      * @param o
349      * The attribute to compare, must be of type IAttribute
350      * @return true if the argument is equal to this.
351      */

352     public abstract boolean equals( Object JavaDoc o );
353
354
355     /**
356      * Gets the AttributeTypeDescription of this attribute.
357      *
358      * @return the AttributeTypeDescription of this attribute, may be the
359      * default or a dummy
360      */

361     public abstract AttributeTypeDescription getAttributeTypeDescription();
362
363
364     /**
365      * Gets the AttributeDescription of this attribute.
366      *
367      * @return the AttributeDescription of this attribute,.
368      */

369     public abstract AttributeDescription getAttributeDescription();
370
371 }
372
Popular Tags