public interface GraphHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Graph
objects. Each node in the hierarchy is a unique Graph.
The hierarchy may be traversed recursively to establish the tree
structure through getParentGraphs()
and
getChildGraphs().
To relate these Ids
to another
OSID, getGraphNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Graph
available in the Topology 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 getParentGraphs()
or getChildGraphs()
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 |
canAccessGraphHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildGraphIds(Id graphId)
Gets the child
Ids of the given graph. |
GraphList |
getChildGraphs(Id graphId)
Gets the children of the given graph.
|
Hierarchy |
getGraphHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getGraphHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getGraphNodeIds(Id graphId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given graph.
|
GraphNode |
getGraphNodes(Id graphId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given graph.
|
IdList |
getParentGraphIds(Id graphId)
Gets the parent
Ids of the given graph. |
GraphList |
getParentGraphs(Id graphId)
Gets the parents of the given graph.
|
IdList |
getRootGraphIds()
Gets the root graph
Ids in this hierarchy. |
GraphList |
getRootGraphs()
Gets the root graph in the graph hierarchy.
|
boolean |
hasChildGraphs(Id graphId)
Tests if a graph has any children.
|
boolean |
hasParentGraphs(Id graphId)
Tests if the
Graph has any parents. |
boolean |
isAncestorOfGraph(Id id,
Id graphId)
Tests if an
Id is an ancestor of a graph. |
boolean |
isChildOfGraph(Id id,
Id graphId)
Tests if a graph is a direct child of another.
|
boolean |
isDescendantOfGraph(Id id,
Id graphId)
Tests if an
Id is a descendant of a graph. |
boolean |
isParentOfGraph(Id id,
Id graphId)
Tests if an
Id is a direct parent of graph. |
void |
useComparativeGraphView()
The returns from the graph methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryGraphView()
A complete view of the
Graphs returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getGraphHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getGraphHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessGraphHierarchy()
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 useComparativeGraphView()
mandatory
- This method is must be implemented. void usePlenaryGraphView()
Graphs
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 getRootGraphIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. GraphList getRootGraphs() 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 hasParentGraphs(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Graph
has any parents.graphId
- a catalog Id
true
if the catalog has parents, f alse
otherwiseNotFoundException
- graphId
is not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfGraph(Id id, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of graph.id
- an Id
graphId
- the Id
of a graph true
if this id
is a parent of
graphId,
f alse
otherwiseNotFoundException
- graphId
is not foundNullArgumentException
- id
or
graphId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentGraphIds(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given graph.graphId
- a catalog Id
Ids
of the graphNotFoundException
- graphId
is not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. GraphList getParentGraphs(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
graphId
- the Id
to queryNotFoundException
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfGraph(Id id, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a graph.id
- an Id
graphId
- the Id
of a catalog tru
e if this id
is an ancestor
of graphId,
false
otherwiseNotFoundException
- graphId
not foundNullArgumentException
- graphId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildGraphs(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
graphId
- a graph Id
true
if the graphId
has
children, false
otherwiseNotFoundException
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfGraph(Id id, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
graphId
- the Id
of a graph true
if the id
is a child of
graphId,
false
otherwiseNotFoundException
- graphId
not foundNullArgumentException
- id
or
graphId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildGraphIds(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given graph.graphId
- the Id
to queryNotFoundException
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. GraphList getChildGraphs(Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
graphId
- the Id
to queryNotFoundException
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfGraph(Id id, Id graphId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a graph.id
- an Id
graphId
- the Id
of a catalog true
if the id
is a descendant
of the graphId,
false
otherwiseNotFoundException
- graphId
not foundNullArgumentException
- id
or
graphId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getGraphNodeIds(Id graphId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
graphId
- 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
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. GraphNode getGraphNodes(Id graphId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
graphId
- 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
- graphId
not foundNullArgumentException
- graphId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.