Hierarchy Session Pattern

Traverse the parent-child tree of a domain — walk ancestors and descendants of any node.

Overview

A hierarchy session exposes the tree structure of a catalog hierarchy. It is scoped to a single hierarchy root and supports traversal in both directions: ancestors (parents, grandparents) and descendants (children, subtrees). Override the adjacency methods to resolve parent/child relationships from your back-end.

Javadoc Reference

net.okapia.osid.jamocha.spi

Class Declaration Pattern

public abstract class AbstractOsidObjectHierarchySession
extends AbstractOsidSession
implements OsidObjectHierarchySession

Constructor Pattern

AbstractOsidObjectHierarchySession(OsidObjectManager manager, Id hierarchyId)
ParameterTypeDescription
manager OsidObjectManager the manager that opened this session
hierarchyId Id the hierarchy this session traverses

Key Override Pattern

public OsidObjectList getParentOsidObjects(Id osidObjectId) throws OperationFailedException
public OsidObjectList getChildOsidObjects(Id osidObjectId) throws OperationFailedException