]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.api.cms/src/org/argeo/api/cms/directory/HierarchyUnit.java
1 package org
.argeo
.api
.cms
.directory
;
3 import java
.util
.Dictionary
;
4 import java
.util
.Locale
;
6 /** A unit within the high-level organisational structure of a directory. */
7 public interface HierarchyUnit
{
8 /** Name to use in paths. */
9 String
getHierarchyUnitName();
11 /** Name to use in UI. */
12 String
getHierarchyUnitLabel(Locale locale
);
15 * The parent {@link HierarchyUnit}, or <code>null</code> if a
16 * {@link CmsDirectory}.
18 HierarchyUnit
getParent();
20 /** Direct children {@link HierarchyUnit}s. */
21 Iterable
<HierarchyUnit
> getDirectHierarchyUnits(boolean functionalOnly
);
24 * Whether this is an arbitrary named and placed {@link HierarchyUnit}.
26 * @return <code>true</code> if functional, <code>false</code> is technical
27 * (e.g. People, Groups, etc.)
29 default boolean isFunctional() {
30 return isType(Type
.FUNCTIONAL
);
33 boolean isType(Type type
);
35 /** A technical direct child. */
36 HierarchyUnit
getDirectChild(Type type
);
39 * The base of this organisational unit within the hierarchy. This would
40 * typically be an LDAP base DN.
44 /** The related {@link CmsDirectory}. */
45 CmsDirectory
getDirectory();
47 /** Its metadata (typically LDAP attributes). */
48 Dictionary
<String
, Object
> getProperties();