public interface CatalogHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Catalog objects. Each node in the hierarchy is a unique
Catalog. The hierarchy may be traversed recursively to establish
the tree structure through getParentCatalogs() and
getChildCatalogs(). To relate these Ids to another
OSID, getCatalogNodes() can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Catalog
available in the Catalog 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 getParentCatalogs() or getChildCatalogs()
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 |
canAccessCatalogHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getCatalogHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getCatalogHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getCatalogNodeIds(Id catalogId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given catalog.
|
CatalogNode |
getCatalogNodes(Id catalogId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given catalog.
|
IdList |
getChildCatalogIds(Id catalogId)
Gets the child
Ids of the given catalog. |
CatalogList |
getChildCatalogs(Id catalogId)
Gets the child catalogs of the given
id. |
IdList |
getParentCatalogIds(Id catalogId)
Gets the parent
Ids of the given catalog. |
CatalogList |
getParentCatalogs(Id catalogId)
Gets the parent catalogs of the given
id. |
IdList |
getRootCatalogIds()
Gets the root catalog
Ids in this hierarchy. |
CatalogList |
getRootCatalogs()
Gets the root catalogs in the catalog hierarchy.
|
boolean |
hasChildCatalogs(Id catalogId)
Tests if a catalog has any children.
|
boolean |
hasParentCatalogs(Id catalogId)
Tests if the
Catalog has any parents. |
boolean |
isAncestorOfCatalog(Id id,
Id catalogId)
Tests if an
Id is an ancestor of a catalog. |
boolean |
isChildOfCatalog(Id id,
Id catalogId)
Tests if a catalog is a direct child of another.
|
boolean |
isDescendantOfCatalog(Id id,
Id catalogId)
Tests if an
Id is a descendant of a catalog. |
boolean |
isParentOfCatalog(Id id,
Id catalogId)
Tests if an
Id is a direct parent of a catalog. |
void |
useComparativeCatalogView()
The returns from the catalog methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryCatalogView()
A complete view of the
Catalog returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getCatalogHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getCatalogHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessCatalogHierarchy()
PERMISSION_DENIED. This is intended as a hint to an
application that may opt not to offer lookup operations. false if hierarchy traversal methods are not
authorized, true otherwisemandatory - This method must be implemented. void useComparativeCatalogView()
mandatory - This method is must be implemented. void usePlenaryCatalogView()
Catalog 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 getRootCatalogIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. CatalogList getRootCatalogs() 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 hasParentCatalogs(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Catalog has any parents.catalogId - a catalog Id true if the catalog has parents, false
otherwiseNotFoundException - catalogId is not
foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. boolean isParentOfCatalog(Id id, Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of a catalog.id - an Id catalogId - the Id of a catalog true if this id is a parent of
catalogId, false otherwiseNotFoundException - catalogId is not
foundNullArgumentException - id or
catalogId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. If - id not found return false. IdList getParentCatalogIds(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given catalog.catalogId - a catalog Id Ids of the catalogNotFoundException - catalogId is not
foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. CatalogList getParentCatalogs(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. catalogId - the Id of the Catalog
to query id NotFoundException - a Catalog identified
by Id is not foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfCatalog(Id id, Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of a catalog.id - an Id catalogId - the Id of a catalog true if this id is an ancestor
of catalogId. false otherwiseNotFoundException - catalogId not foundNullArgumentException - catalogId or
id is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failure
occurredmandatory - This method must be implemented. If - id not found return false. boolean hasChildCatalogs(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
catalogId - a catalogId true if the catalogId has
children, false otherwiseNotFoundException - catalogId is not
foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfCatalog(Id id, Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id catalogId - the Id of a catalog true if the id is a child of
catalogId, false otherwiseNotFoundException - catalogId not foundNullArgumentException - catalogId or
id is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildCatalogIds(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given catalog.catalogId - the Id to queryNotFoundException - catalogId is not
foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CatalogList getChildCatalogs(Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. catalogId - the Id of the Catalog
to query id NotFoundException - a Catalog identified
by Id is not foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfCatalog(Id id, Id catalogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of a catalog.id - an Id catalogId - the Id of a catalog true if the id is a descendant
of the catalogId, false
otherwiseNotFoundException - catalogId not foundNullArgumentException - catalogId or
id is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getCatalogNodeIds(Id catalogId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
catalogId - 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 - a Catalog identified
by Id is not foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CatalogNode getCatalogNodes(Id catalogId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
catalogId - 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 - a Catalog identified
by Id is not foundNullArgumentException - catalogId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.