public interface ObjectiveHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Objective
objects. Each node in the hierarchy is a unique
Objective that contains its child objectives.
The hierarchy may be
traversed recursively to establish the tree structure through
getParentObjectives()
and getChildObjectives().
To
relate these Ids
to another OSID,
getObjectiveNodes()
can be used for retrievals that can be used
for bulk lookups in other OSIDs. Any Objective
available in
the Learning 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 getParentObjectives()
or getChildObjectives()
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 |
canAccessObjectiveHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildObjectiveIds(Id objectiveId)
Gets the child
Ids of the given objective. |
ObjectiveList |
getChildObjectives(Id objectiveId)
Gets the children of the given objective.
|
Hierarchy |
getObjectiveHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getObjectiveHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getObjectiveNodeIds(Id objectiveId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given objective.
|
ObjectiveNode |
getObjectiveNodes(Id objectiveId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given objective.
|
IdList |
getParentObjectiveIds(Id objectiveId)
Gets the parent
Ids of the given objective. |
ObjectiveList |
getParentObjectives(Id objectiveId)
Gets the parents of the given objective.
|
IdList |
getRootObjectiveIds()
Gets the root objective
Ids in this hierarchy. |
ObjectiveList |
getRootObjectives()
Gets the root objective in this objective hierarchy.
|
boolean |
hasChildObjectives(Id objectiveId)
Tests if an objective has any children.
|
boolean |
hasParentObjectives(Id objectiveId)
Tests if the
Objective has any parents. |
boolean |
isAncestorOfObjective(Id id,
Id objectiveId)
Tests if an
Id is an ancestor of an objective. |
boolean |
isChildOfObjective(Id id,
Id objectiveId)
Tests if an objective is a direct child of another.
|
boolean |
isDescendantOfObjective(Id id,
Id objectiveId)
Tests if an
Id is a descendant of an objective. |
boolean |
isParentOfObjective(Id id,
Id objectiveId)
Tests if an
Id is a direct parent of an objective. |
void |
useComparativeObjectiveView()
The returns from the objective methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryObjectiveView()
A complete view of the
Hierarchy returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getObjectiveHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getObjectiveHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessObjectiveHierarchy()
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 useComparativeObjectiveView()
mandatory
- This method is must be implemented. void usePlenaryObjectiveView()
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 getRootObjectiveIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ObjectiveList getRootObjectives() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentObjectives(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Objective
has any parents.objectiveId
- the Id
of an objective true
if the objective has parents, false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfObjective(Id id, Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of an objective.id
- an Id
objectiveId
- the Id
of an objective true
if this id
is a parent of
objectiveId,
false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- id
or
objectiveId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentObjectiveIds(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given objective.objectiveId
- the Id
of an objective Ids
of the objectiveNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ObjectiveList getParentObjectives(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId
- the Id
of an objectiveNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfObjective(Id id, Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of an objective.id
- an Id
objectiveId
- the Id
of an objective true
if this id
is an ancestor
of objectiveId,
false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- id
or
objectiveId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildObjectives(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId
- the Id
of an objective true
if the objectiveId
has
children, false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfObjective(Id id, Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
objectiveId
- the Id
of an objective true
if the id
is a child of
objectiveId,
false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- id
or
objectiveId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildObjectiveIds(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given objective.objectiveId
- the Id
to queryNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ObjectiveList getChildObjectives(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId
- the Id
to queryNotFoundException
- objectiveId
is not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfObjective(Id id, Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of an objective.id
- an Id
objectiveId
- the Id
of an objective true
if the id
is a descendant
of the objectiveId,
false
otherwiseNotFoundException
- objectiveId
is not
foundNullArgumentException
- id
or
objectiveId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getObjectiveNodeIds(Id objectiveId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId
- 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
- objectiveId
not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ObjectiveNode getObjectiveNodes(Id objectiveId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId
- 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
- objectiveId
not
foundNullArgumentException
- objectiveId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.