/**
* The parent {@link HierarchyUnit}, or <code>null</code> if a
- * {@link Directory}.
+ * {@link CmsDirectory}.
*/
HierarchyUnit getParent();
* @return <code>true</code> if functional, <code>false</code> is technical
* (e.g. People, Groups, etc.)
*/
- boolean isFunctional();
+ default boolean isFunctional() {
+ return isType(Type.FUNCTIONAL);
+ }
+
+ boolean isType(Type type);
+
+ /** A technical direct child. */
+ HierarchyUnit getDirectChild(Type type);
/**
* The base of this organisational unit within the hierarchy. This would
*/
String getBase();
- /** The related {@link Directory}. */
- Directory getDirectory();
+ /** The related {@link CmsDirectory}. */
+ CmsDirectory getDirectory();
/** Its metadata (typically LDAP attributes). */
Dictionary<String, Object> getProperties();
+
+ enum Type {
+ PEOPLE, //
+ GROUPS, //
+ ROLES, //
+ FUNCTIONAL;
+ }
}