public interface ActivityHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Activity
objects. Each node in the hierarchy is a unique
Activity.
The hierarchy may be traversed recursively to establish
the tree structure through getActivityNodes().
To relate
these Ids
to another OSID, getAncestorActivities()
and getDescendantActivities()
can be used for
retrievals that can be used for bulk lookups in other OSIDs. Any
Activity
available in the Business 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 getParentActivities()
or getChildActivities()
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 |
canAccessActivityHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getActivityHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getActivityHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getActivityNodeIds(Id activityId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given activity.
|
ActivityNode |
getActivityNodes(Id activityId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given activity.
|
ActivityList |
getChildActivities(Id activityId)
Gets the children of the given activity.
|
IdList |
getChildActivityIds(Id activityId)
Gets the child
Ids of the given activity. |
ActivityList |
getParentActivities(Id activityId)
Gets the parents of the given activity.
|
IdList |
getParentActivityIds(Id activityId)
Gets the parent Ids of the given activity.
|
ActivityList |
getRootActivities()
Gets the root activities in this activity hierarchy.
|
IdList |
getRootActivityIds()
Gets the root activity
Ids in this hierarchy. |
boolean |
hasChildActivities(Id activityId)
Tests if an activity has any children.
|
boolean |
hasParentActivities(Id activityId)
Tests if the
Activity has any parents. |
boolean |
isAncestorOfActivity(Id id,
Id activityId)
Tests if an
Id is an ancestor of an activity. |
boolean |
isChildOfActivity(Id id,
Id activityId)
Tests if an activity is a direct child of another.
|
boolean |
isDescendantOfActivity(Id id,
Id activityId)
Tests if an
Id is a descendant of an activity. |
boolean |
isParentOfActivity(Id id,
Id activityId)
Tests if an
Id is a direct parent of an activity. |
void |
useComparativeActivityView()
The returns from the activity methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryActivityView()
A complete view of the
Hierarchy returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getActivityHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getActivityHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessActivityHierarchy()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer traversal operations. false
if hierarchy traversal methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useComparativeActivityView()
mandatory
- This method is must be implemented. void usePlenaryActivityView()
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 getRootActivityIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ActivityList getRootActivities() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentActivities(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Activity
has any parents.activityId
- the Id
of an activity true
if the activity has parents, false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfActivity(Id id, Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of an activity.id
- an Id
activityId
- the Id
of an activity true
if this id
is a parent of
activityId,
false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- id
or
activityId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentActivityIds(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- the Id
of an activity Ids
of the activityNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ActivityList getParentActivities(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- the Id
of an activityNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfActivity(Id id, Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of an activity.id
- an Id
activityId
- the Id
of an activity true
if this id
is an ancestor
of activityId,
false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- id
or
activityId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildActivities(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- the Id
of an activity true
if the activityId
has
children, false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfActivity(Id id, Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
activityId
- the Id
of an activity true
if the id
is a child of
activityId,
false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- id
or
activityId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildActivityIds(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given activity.activityId
- the Id
to queryNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ActivityList getChildActivities(Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- the Id
to queryNotFoundException
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfActivity(Id id, Id activityId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of an activity.id
- an Id
activityId
- the Id
of an activity true
if the id
is a descendant
of the activityId,
false
otherwiseNotFoundException
- activityId
is not
foundNullArgumentException
- id
or
activityId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getActivityNodeIds(Id activityId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- 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
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. ActivityNode getActivityNodes(Id activityId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
activityId
- 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
- activityId
is not
foundNullArgumentException
- activityId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.