public interface CampusHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Campus objects. Each node in the hierarchy is a unique
Campus. The hierarchy may be traversed recursively to establish
the tree structure through getParentCampuses() and
getChildCampuses(). To relate these Ids to another
OSID, getCampusNodes() can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Campus
available in the Room 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 getParentCampuses() or getChildCampuses()
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 |
canAccessCampusHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getCampusHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getCampusHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getCampusNodeIds(Id campusId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given campus.
|
CampusNode |
getCampusNodes(Id campusId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given campus.
|
CampusList |
getChildCampuses(Id campusId)
Gets the child campuses of the given
id. |
IdList |
getChildCampusIds(Id campusId)
Gets the child
Ids of the given campus. |
CampusList |
getParentCampuses(Id campusId)
Gets the parent campuses of the given
id. |
IdList |
getParentCampusIds(Id campusId)
Gets the parent
Ids of the given campus. |
CampusList |
getRootCampuses()
Gets the root campuses in the campus hierarchy.
|
IdList |
getRootCampusIds()
Gets the root campus
Ids in this hierarchy. |
boolean |
hasChildCampuses(Id campusId)
Tests if a campus has any children.
|
boolean |
hasParentCampuses(Id campusId)
Tests if the
Campus has any parents. |
boolean |
isAncestorOfCampus(Id id,
Id campusId)
Tests if an
Id is an ancestor of a campus. |
boolean |
isChildOfCampus(Id id,
Id campusId)
Tests if a campus is a direct child of another.
|
boolean |
isDescendantOfCampus(Id id,
Id campusId)
Tests if an
Id is a descendant of a campus. |
boolean |
isParentOfCampus(Id id,
Id campusId)
Tests if an
Id is a direct parent of campus. |
void |
useComparativeCampusView()
The returns from the campus methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryCampusView()
A complete view of the
Campus returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getCampusHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getCampusHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessCampusHierarchy()
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 useComparativeCampusView()
mandatory - This method is must be implemented. void usePlenaryCampusView()
Campus 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 getRootCampusIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CampusList getRootCampuses() 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 hasParentCampuses(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Campus has any parents.campusId - a campus Id true if the campus has parents, f alse
otherwiseNotFoundException - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isParentOfCampus(Id id, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of campus.id - an Id campusId - the Id of a campus true if this id is a parent of
campusId, f alse otherwiseNotFoundException - campusId is not
foundNullArgumentException - id or
campusId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getParentCampusIds(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given campus.campusId - a campus Id Ids of the campusNotFoundException - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CampusList getParentCampuses(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. campusId - the Id of the Campus to
query id NotFoundException - a Campus identified
by Id is not foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfCampus(Id id, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of a campus.id - an Id campusId - the Id of a campus tru e if this id is an ancestor
of campusId, false otherwiseNotFoundException - campusId is not
foundNullArgumentException - id or
campusId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. boolean hasChildCampuses(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
campusId - a campus Id true if the campusId has
children, false otherwiseNotFoundException - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfCampus(Id id, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id campusId - the Id of a campus true if the id is a child of
campusId, false otherwiseNotFoundException - campusId is not
foundNullArgumentException - id or
campusId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildCampusIds(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given campus.campusId - the Id to queryNotFoundException - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CampusList getChildCampuses(Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. campusId - the Id of the Campus to
query id NotFoundException - a Campus identified
by Id is not foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfCampus(Id id, Id campusId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of a campus.id - an Id campusId - the Id of a campus true if the id is a descendant
of the campusId, false otherwiseNotFoundException - campusId is not
foundNullArgumentException - id or
campusId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getCampusNodeIds(Id campusId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
campusId - 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 - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. CampusNode getCampusNodes(Id campusId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
campusId - 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 - campusId is not
foundNullArgumentException - campusId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.