KickJava   Java API By Example, From Geeks To Geeks.

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


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.model.schema.Subschema;
27 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.ConnectionPropertyPageProvider;
28 import org.apache.directory.ldapstudio.browser.core.propertypageproviders.EntryPropertyPageProvider;
29 import org.eclipse.core.runtime.IAdaptable;
30
31
32 /**
33  * An IEntry represents an LDAP entry.
34  *
35  * @author <a HREF="mailto:dev@directory.apache.org">Apache Directory Project</a>
36  * @version $Rev$, $Date$
37  */

38 public interface IEntry extends Serializable JavaDoc, IAdaptable, EntryPropertyPageProvider, ConnectionPropertyPageProvider
39 {
40
41     /**
42      * Adds the given child to this entry.
43      *
44      * @param childToAdd
45      * the child to add
46      */

47     public abstract void addChild( IEntry childToAdd );
48
49
50     /**
51      * Deletes the given child and all its children from this entry.
52      *
53      * @param childToDelete
54      * the child to delete
55      */

56     public abstract void deleteChild( IEntry childToDelete );
57
58
59     /**
60      * Adds the given attribute to this entry. The attribute's entry must be
61      * this entry.
62      *
63      * @param attributeToAdd
64      * the attribute to add
65      * @throws ModelModificationException
66      * if the attribute is alreade present in this entry or
67      * if the attribute's entry isn't this entry.
68      */

69     public abstract void addAttribute( IAttribute attributeToAdd ) throws ModelModificationException;
70
71
72     /**
73      * Deletes the given attribute from this entry.
74      *
75      * @param attributeToDelete
76      * the attribute to delete
77      * @throws ModelModificationException
78      * if the attribute isn't present in this entry.
79      */

80     public abstract void deleteAttribute( IAttribute attributeToDelete ) throws ModelModificationException;
81
82
83     /**
84      * Checks if this entry with its attributes is consistent. The following
85      * conditions must be fulfilled:
86      *
87      * <ul>
88      * <li>The objectClass attrbute must be present</li>
89      * <li>All must attributes must be present</li>
90      * <li>There mustn't be any empty value</li>
91      * </ul>
92      *
93      * @return true if this entry is consistent
94      */

95     public abstract boolean isConsistent();
96
97
98     /**
99      * TODO: still needed?
100      *
101      * Indicates wheter this entry exists in directory. Otherwise it
102      * is a new entry created from the user and not still written to directory.
103      *
104      * @return true it this entry is a directory entry
105      */

106     public abstract boolean isDirectoryEntry();
107
108
109     /**
110      * TODO: still needed?
111      *
112      * Sets wheter this entry exists in directory.
113      *
114      * @param isDirectoryEntry
115      * true if this entry exists in directory.
116      */

117     public abstract void setDirectoryEntry( boolean isDirectoryEntry );
118
119
120     /**
121      * Indicates wheter this entry is an alias entry.
122      *
123      * An entry is an alias entry if it has the object class 'alias'.
124      *
125      * Even if the object class attribute is not initialized an entry
126      * is supposed to be an alias entry if the alias flag is set.
127      *
128      * @return true, if this entry is an alias entry
129      */

130     public abstract boolean isAlias();
131
132
133     /**
134      * Sets a flag wheter this entry is an alias entry.
135      *
136      * This method is called during a search if the initialization
137      * of the alias flag is requested.
138      *
139      * @param b the alias flag
140      */

141     public abstract void setAlias( boolean b );
142
143
144     /**
145      * Indicates wheter this entry is a referral entry.
146      *
147      * An entry is a referral entry if it has the objectClass 'referral'.
148      *
149      * Even if the object class attribute is not initialized an entry
150      * is supposed to be a referral entry if the referral flag is set.
151      *
152      * @return true, if this entry is a referral entry
153      */

154     public abstract boolean isReferral();
155
156
157     /**
158      * Sets a flag wheter this entry is a referral entry.
159      *
160      * This method is called during a search if the initialization
161      * fo the referral hint is requested.
162      *
163      * @param b the referral flag
164      */

165     public abstract void setReferral( boolean b );
166
167
168     /**
169      * Indicates wheter this entry is a subentry.
170      *
171      * An entry is a subentry if it has the objectClass 'subentry'.
172      *
173      * Even if the object class attribute is not initialized an entry
174      * is supposed to be a subentry if the subentry flag is set.
175      *
176      * @return true, if this entry is a subentry entry
177      */

178     public abstract boolean isSubentry();
179
180
181     /**
182      * Sets a flag wheter this entry is a subentry.
183      *
184      * This method is called during a search if the initialization
185      * fo the subentry is requested.
186      *
187      * @param b the subentry flag
188      */

189     public abstract void setSubentry( boolean b );
190
191
192     /**
193      * Gets the DN of this entry, never null.
194      *
195      * @return the DN of this entry, never null.
196      */

197     public abstract DN getDn();
198
199
200     /**
201      * Gets the RDN of this entry, never null.
202      *
203      * @return the RDN of this entry, never null.
204      */

205     public abstract RDN getRdn();
206
207
208     /**
209      * Indicates wheater this entry's attributes are initialized.
210      *
211      * True means that the entry's attributes are completely initialized
212      * and getAttributes() will return all attributes.
213      *
214      * False means that the attributes are not or only partially
215      * initialized. The getAttributes() method will return null
216      * or only a part of the entry's attributes.
217      *
218      * @return true if this entry's attributes are initialized
219      */

220     public abstract boolean isAttributesInitialized();
221
222
223     /**
224      * Sets a flag wheter this entry's attributes are initialized.
225      *
226      * @param b the attributes initialized flag
227      */

228     public abstract void setAttributesInitialized( boolean b );
229
230
231     /**
232      * Gets the attributes of the entry.
233      *
234      * If isAttributesInitialized() returns false the returned attributes
235      * may only be a subset of the attributes in directory.
236      *
237      * @return The attributes of the entry or null if no attribute was added yet
238      */

239     public abstract IAttribute[] getAttributes();
240
241
242     /**
243      * Gets the attribute of the entry.
244      *
245      * @param attributeDescription the attribute description
246      * @return The attributes of the entry or null if the attribute doesn't
247      * exist or if the attributes aren't initialized
248      */

249     public abstract IAttribute getAttribute( String JavaDoc attributeDescription );
250
251
252     /**
253      * Gets a AttributeHierachie containing the requested attribute and
254      * all its subtypes.
255      *
256      * @param attributeDescription the attribute description
257      * @return The attributes of the entry or null if the attribute doesn't
258      * exist or if the attributes aren't initialized
259      */

260     public abstract AttributeHierarchy getAttributeWithSubtypes( String JavaDoc attributeDescription );
261
262
263     /**
264      * Returns the subschema of the entry.
265      *
266      * @return The subschema of the entry or null if the attributes aren't
267      * initialized
268      */

269     public abstract Subschema getSubschema();
270
271
272     /**
273      * Indicates wheater the entry's children are initialized.
274      *
275      * True means that the entry's children are completely initialized
276      * and getChildren() will return all children.
277      *
278      * False means that the children are not or only partially
279      * initialized. The getChildren() method will return null
280      * or only a part of the entry's children.
281      *
282      * @return true if this entry's children are initialized
283      */

284     public abstract boolean isChildrenInitialized();
285
286
287     /**
288      * Sets a flag wheter this entry's children are initialized..
289      *
290      * @param b the children initialized flag
291      */

292     public abstract void setChildrenInitialized( boolean b );
293
294
295     /**
296      * Returns true if the entry has children.
297      *
298      * @return true if the entry has children.
299      */

300     public abstract boolean hasChildren();
301
302
303     /**
304      * Sets a hint wheter this entry has children.
305      *
306      * @param b the has children hint
307      */

308     public abstract void setHasChildrenHint( boolean b );
309
310
311     /**
312      * Gets the children of the entry.
313      *
314      * If isChildrenInitialized() returns false the returned children
315      * may only be a subset of the children in directory.
316      *
317      * @return The children of the entry or null if no child was added yet.
318      */

319     public abstract IEntry[] getChildren();
320
321
322     /**
323      * Gets the number of children of the entry.
324      *
325      * @return The number of children of the entry or -1 if no child was added yet
326      */

327     public abstract int getChildrenCount();
328
329
330     /**
331      * Indicates wheather this entry has more children than
332      * getChildrenCount() returns. This occurs if the count or time limit
333      * was exceeded while fetching children.
334      *
335      * @return true if this entry has (maybe) more children.
336      */

337     public abstract boolean hasMoreChildren();
338
339
340     /**
341      * Sets a flag wheter this entry more children.
342      *
343      * @param b the has more children flag
344      */

345     public abstract void setHasMoreChildren( boolean b );
346
347
348     /**
349      * Indicates wheather this entry has a parent entry. Each entry except
350      * the root DSE and the base entries should have a parent entry.
351      *
352      * @return true if the entry has a parent entry.
353      */

354     public abstract boolean hasParententry();
355
356
357     /**
358      * Gets the parent entry.
359      *
360      * @return the parent entry or null if this entry hasn't a parent.
361      */

362     public abstract IEntry getParententry();
363
364
365     /**
366      * Gets the children filter or null if none is set
367      *
368      * @return the children filter or null if none is set
369      */

370     public abstract String JavaDoc getChildrenFilter();
371
372
373     /**
374      * Sets the children filter. Null clears the filter.
375      *
376      * @param filter the children filter
377      */

378     public abstract void setChildrenFilter( String JavaDoc filter );
379
380
381     /**
382      * Gets the connection of this entry.
383      *
384      * @return the connection of this entry, never null.
385      */

386     public abstract IConnection getConnection();
387
388
389     /**
390      * Gets the LDAP URL of this entry.
391      *
392      * @return the LDAP URL of this entry
393      */

394     public abstract URL getUrl();
395
396 }
397
Popular Tags