public interface DepotHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Depot
objects. Each node in the hierarchy is a unique Depot.
The hierarchy may be traversed recursively to establish the tree
structure through getParentDepots()
and
getChildDepots().
To relate these Ids
to another
OSID, getDepotNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Depot
available in the Depoting 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 getParentDepots()
or getChildDepots()
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 |
canAccessDepotHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildDepotIds(Id depotId)
Gets the child
Ids of the given depot. |
DepotList |
getChildDepots(Id depotId)
Gets the children of the given depot.
|
Hierarchy |
getDepotHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getDepotHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getDepotNodeIds(Id depotId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given depot.
|
DepotNode |
getDepotNodes(Id depotId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given depot.
|
IdList |
getParentDepotIds(Id depotId)
Gets the parent
Ids of the given depot. |
DepotList |
getParentDepots(Id depotId)
Gets the parents of the given depot.
|
IdList |
getRootDepotIds()
Gets the root depot
Ids in this hierarchy. |
DepotList |
getRootDepots()
Gets the root depots in this depot hierarchy.
|
boolean |
hasChildDepots(Id depotId)
Tests if a depot has any children.
|
boolean |
hasParentDepots(Id depotId)
Tests if the
Depot has any parents. |
boolean |
isAncestorOfDepot(Id id,
Id depotId)
Tests if an
Id is an ancestor of a depot. |
boolean |
isChildOfDepot(Id id,
Id depotId)
Tests if a depot is a direct child of another.
|
boolean |
isDescendantOfDepot(Id id,
Id depotId)
Tests if an
Id is a descendant of a depot. |
boolean |
isParentOfDepot(Id id,
Id depotId)
Tests if an
Id is a direct parent of a depot. |
void |
useComparativeDepotView()
The returns from the depot methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryDepotView()
A complete view of the
Hierarchy returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDepotHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getDepotHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessDepotHierarchy()
PERMISSION_DENIED.
This is intended as a hint to an
an application that may not offer hierrachy traversal operations to
unauthorized users. false
if hierarchy traversal methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useComparativeDepotView()
mandatory
- This method is must be implemented. void usePlenaryDepotView()
Hierarchy
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 getRootDepotIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DepotList getRootDepots() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentDepots(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Depot
has any parents.depotId
- the Id
of a depot true
if the depot has parents, false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfDepot(Id id, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of a depot.id
- an Id
depotId
- the Id
of a depot true
if this id
is a parent of
depotId,
false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- id
or
depotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentDepotIds(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given depot.depotId
- the Id
of a depot Ids
of the depotNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DepotList getParentDepots(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId
- the Id
of a depotNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfDepot(Id id, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a depot.id
- an Id
depotId
- the Id
of a depot true
if this id
is an ancestor
of depotId,
false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- id
or
depotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildDepots(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId
- the Id
of a depot true
if the depotId
has
children, false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfDepot(Id id, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
depotId
- the Id
of a depot true
if the id
is a child of
depotId,
false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- id
or
depotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildDepotIds(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given depot.depotId
- the Id
to queryNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DepotList getChildDepots(Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId
- the Id
to queryNotFoundException
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfDepot(Id id, Id depotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a depot.id
- an Id
depotId
- the Id
of a depot true
if the id
is a descendant
of the depotId,
false
otherwiseNotFoundException
- depotId
is not foundNullArgumentException
- id
or
depotId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getDepotNodeIds(Id depotId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId
- 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
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DepotNode getDepotNodes(Id depotId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
depotId
- 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
- depotId
is not foundNullArgumentException
- depotId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.