Hierarchy Design Session Pattern

Mutate the parent-child tree — add and remove nodes to reshape a domain hierarchy.

Overview

A hierarchy design session is the write side of the hierarchy. Where the hierarchy session lets you traverse the tree, the design session lets you reshape it: adding a node as a child of an existing node, removing a parent-child relationship, and moving subtrees. Override the add and remove adjacency methods to persist changes to your back-end.

Javadoc Reference

net.okapia.osid.jamocha.spi

Class Declaration Pattern

public abstract class AbstractOsidObjectHierarchyDesignSession
extends AbstractOsidSession
implements OsidObjectHierarchyDesignSession

Constructor Pattern

AbstractOsidObjectHierarchyDesignSession(OsidObjectManager manager, Id hierarchyId)
ParameterTypeDescription
manager OsidObjectManager the manager that opened this session
hierarchyId Id the hierarchy being designed

Key Override Pattern

public void addRootOsidObject(Id osidObjectId) throws OperationFailedException
public void addChildOsidObject(Id osidObjectId, Id childId) throws OperationFailedException
public void removeChildOsidObject(Id osidObjectId, Id childId) throws OperationFailedException