public interface BinHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Bin
objects. Each node in the hierarchy is a unique Bin.
The hierarchy may be traversed recursively to establish the tree
structure through getParentBins() and
getChildBins(). To relate these Ids to another
OSID, getBinNodes() can be used for retrievals that can be
used for bulk lookups in other OSIDs. Any Bin available in
the Resource OSID is known to this hierarchy but does not appear in the
hierarchy traversal until added as a root node or a child of another node.
A user may not be authorized to traverse the entire hierarchy. Parts
of the hierarchy may be made invisible through omission from the returns
of getParentBins() or getChildBins() in lieu
of a PERMISSION_DENIED error that may disrupt the traversal
through authorized pathways.
This session defines views that offer differing behaviors when retrieving multiple objects.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAccessBinHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getBinHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getBinHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getBinNodeIds(Id binId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given bin.
|
BinNode |
getBinNodes(Id binId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given bin.
|
IdList |
getChildBinIds(Id binId)
Gets the child
Ids of the given bin . |
BinList |
getChildBins(Id binId)
Gets the children of the given bin.
|
IdList |
getParentBinIds(Id binId)
Gets the parent
Ids of the given bin. |
BinList |
getParentBins(Id binId)
Gets the parents of the given bin.
|
IdList |
getRootBinIds()
Gets the root bin
Ids in this hierarchy. |
BinList |
getRootBins()
Gets the root bins in the bin hierarchy.
|
boolean |
hasChildBins(Id binId)
Tests if a bin has any children.
|
boolean |
hasParentBins(Id binId)
Tests if the
Bin has any parents. |
boolean |
isAncestorOfBin(Id id,
Id binId)
Tests if an
Id is an ancestor of a bin. |
boolean |
isChildOfBin(Id id,
Id binId)
Tests if a bin is a direct child of another.
|
boolean |
isDescendantOfBin(Id id,
Id binId)
Tests if an
Id is a descendant of a bin. |
boolean |
isParentOfBin(Id id,
Id binId)
Tests if an
Id is a direct parent of a bin. |
void |
useComparativeBinView()
The returns from the bin methods may omit or translate elements based
on this session, such as authorization, and not result in an error.
|
void |
usePlenaryBinView()
A complete view of the
Bin returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getBinHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getBinHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessBinHierarchy()
PERMISSION_DENIED. This is intended as a hint to an
an application that may not offer traversal functions to unauthorized
users. false if hierarchy traversal methods are not
authorized, true otherwisemandatory - This method must be implemented. void useComparativeBinView()
mandatory - This method is must be implemented. void usePlenaryBinView()
Bin returns is desired. Methods
will return what is requested or result in an error. This view is used
when greater precision is desired at the expense of interoperability.mandatory - This method is must be implemented. IdList getRootBinIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BinList getRootBins() throws OperationFailedException, PermissionDeniedException
Ids are known to the hierarchy,
an orphan does not appear in the hierarchy unless explicitly added as
a root node or child of another node.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method is must be implemented. boolean hasParentBins(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Bin has any parents.binId - the Id of a bin true if the bin has parents, false
otherwiseNotFoundException - binId is not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isParentOfBin(Id id, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of a bin.id - an Id binId - the Id of a bin true if this id is a parent of
binId, false otherwiseNotFoundException - binId is not foundNullArgumentException - id or
binId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getParentBinIds(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given bin.binId - the Id of a bin Ids of the binNotFoundException - binId is not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BinList getParentBins(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
binId - the Id to queryNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfBin(Id id, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of a bin.id - an Id binId - the Id of a bin true if this id is an ancestor
of binId, false otherwiseNotFoundException - binId is not foundNullArgumentException - id or
binId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. boolean hasChildBins(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
binId - the Id of a bin true if the binId has children,
false otherwiseNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfBin(Id id, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id binId - the Id of a bin true if the id is a child of
binId, false otherwiseNotFoundException - binId is not foundNullArgumentException - id or
binId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildBinIds(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given bin .binId - the Id to queryNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BinList getChildBins(Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
binId - the Id to queryNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfBin(Id id, Id binId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of a bin.id - an Id binId - the Id of a bin true if the id is a descendant
of the binId, false otherwiseNotFoundException - binId is not foundNullArgumentException - id or
binId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getBinNodeIds(Id binId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
binId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BinNode getBinNodes(Id binId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
binId - the Id to queryancestorLevels - the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels - the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings - true to include the siblings of
the given node, false to omit the siblingsNotFoundException - binId not foundNullArgumentException - binId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.