public interface SystemHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
System
objects. Each node in the hierarchy is a unique
System.
The hierarchy may be traversed recursively to establish
the tree structure through getParentSystems()
and
getChildSystems().
To relate these Ids
to another
OSID, getSystemNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any System
available in the Control OSID is known to this hierarchy but does not
appear in the hierarchy traversal until added as a root system or a child
of another system.
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 getParentSystems()
or getChildSystems()
in lieu of a PERMISSION_DENIED
error that may disrupt the
traversal through authorized deviceways.
This session defines views that offer differing behaviors when retrieving multiple objects.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccessSystemHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildSystemIds(Id systemId)
Gets the child
Ids of the given system. |
SystemList |
getChildSystems(Id systemId)
Gets the children of the given system.
|
IdList |
getParentSystemIds(Id systemId)
Gets the parent
Ids of the given system. |
SystemList |
getParentSystems(Id systemId)
Gets the parents of the given system.
|
IdList |
getRootSystemIds()
Gets the root system
Ids in this hierarchy. |
SystemList |
getRootSystems()
Gets the root system in the system hierarchy.
|
Hierarchy |
getSystemHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getSystemHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getSystemNodeIds(Id systemId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given system.
|
SystemNode |
getSystemNodes(Id systemId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given system.
|
boolean |
hasChildSystems(Id systemId)
Tests if a system has any children.
|
boolean |
hasParentSystems(Id systemId)
Tests if the
System has any parents. |
boolean |
isAncestorOfSystem(Id id,
Id systemId)
Tests if an
Id is an ancestor of a system. |
boolean |
isChildOfSystem(Id id,
Id systemId)
Tests if a system is a direct child of another.
|
boolean |
isDescendantOfSystem(Id id,
Id systemId)
Tests if an
Id is a descendant of a system. |
boolean |
isParentOfSystem(Id id,
Id systemId)
Tests if an
Id is a direct parent of system. |
void |
useComparativeSystemView()
The returns from the system methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenarySystemView()
A complete view of the
Systems returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getSystemHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getSystemHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessSystemHierarchy()
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 useComparativeSystemView()
mandatory
- This method is must be implemented. void usePlenarySystemView()
Systems
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 getRootSystemIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. SystemList getRootSystems() throws OperationFailedException, PermissionDeniedException
Ids
are known to the
hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root system or child of another system.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentSystems(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
System
has any parents.systemId
- a system Id
true
if the system has parents, f alse
otherwiseNotFoundException
- systemId
is not
foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfSystem(Id id, Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of system.id
- an Id
systemId
- the Id
of a system true
if this id
is a parent of
systemId,
f alse
otherwiseNotFoundException
- systemId
is not
foundNullArgumentException
- id
or
systemId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentSystemIds(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given system.systemId
- a system Id
Ids
of the systemNotFoundException
- systemId
is not
foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. SystemList getParentSystems(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
systemId
- the Id
to queryNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfSystem(Id id, Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a system.id
- an Id
systemId
- the Id
of a system tru
e if this id
is an ancestor
of systemId,
false
otherwiseNotFoundException
- systemId
not foundNullArgumentException
- systemId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildSystems(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
systemId
- a system Id
true
if the systemId
has
children, false
otherwiseNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfSystem(Id id, Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
systemId
- the Id
of a system true
if the id
is a child of
systemId,
false
otherwiseNotFoundException
- systemId
not foundNullArgumentException
- id
or
systemId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildSystemIds(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given system.systemId
- the Id
to queryNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. SystemList getChildSystems(Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
systemId
- the Id
to queryNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfSystem(Id id, Id systemId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a system.id
- an Id
systemId
- the Id
of a system true
if the id
is a descendant
of the systemId,
false
otherwiseNotFoundException
- systemId
not foundNullArgumentException
- id
or
systemId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getSystemNodeIds(Id systemId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
systemId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the system.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the system.includeSiblings
- true
to include the siblings of
the given system, false
to omit the siblingsNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. SystemNode getSystemNodes(Id systemId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
systemId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the hierarchy.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the hierarchy.includeSiblings
- true
to include the siblings of
the given system, false
to omit the siblingsNotFoundException
- systemId
not foundNullArgumentException
- systemId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.