public interface RealmHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Realm
objects. Each node in the hierarchy is a unique Realm.
The hierarchy may be traversed recursively to establish the tree
structure through getParentRealms() and
getChildRealms(). To relate these Ids to another
OSID, getRealmNodes() can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Realm
available in the Personnel 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 getParentRealms() or getChildRealms() 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 |
canAccessRealmHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildRealmIds(Id realmId)
Gets the child
Ids of the given realm. |
RealmList |
getChildRealms(Id realmId)
Gets the child realms of the given
id. |
IdList |
getParentRealmIds(Id realmId)
Gets the parent
Ids of the given realm. |
RealmList |
getParentRealms(Id realmId)
Gets the parent realms of the given
id. |
Hierarchy |
getRealmHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getRealmHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getRealmNodeIds(Id realmId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given realm.
|
RealmNode |
getRealmNodes(Id realmId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given realm.
|
IdList |
getRootRealmIds()
Gets the root realm
Ids in this hierarchy. |
RealmList |
getRootRealms()
Gets the root realms in the realm hierarchy.
|
boolean |
hasChildRealms(Id realmId)
Tests if a realm has any children.
|
boolean |
hasParentRealms(Id realmId)
Tests if the
Realm has any parents. |
boolean |
isAncestorOfRealm(Id id,
Id realmId)
Tests if an
Id is an ancestor of a realm. |
boolean |
isChildOfRealm(Id id,
Id realmId)
Tests if a realm is a direct child of another.
|
boolean |
isDescendantOfRealm(Id id,
Id realmId)
Tests if an
Id is a descendant of a realm. |
boolean |
isParentOfRealm(Id id,
Id realmId)
Tests if an
Id is a direct parent of realm. |
void |
useComparativeRealmView()
The returns from the realm methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryRealmView()
A complete view of the
Realm returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getRealmHierarchyId()
Id associated with this session. Id associated with this sessionmandatory - This method must be implemented. Hierarchy getRealmHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canAccessRealmHierarchy()
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 useComparativeRealmView()
mandatory - This method is must be implemented. void usePlenaryRealmView()
Realm 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 getRootRealmIds() throws OperationFailedException, PermissionDeniedException
Ids in this hierarchy. Ids OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RealmList getRootRealms() 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 hasParentRealms(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Realm has any parents.realmId - a realm Id true if the realm has parents, f alse
otherwiseNotFoundException - realmId is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isParentOfRealm(Id id, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a direct parent of realm.id - an Id realmId - the Id of a realm true if this id is a parent of
realmId, f alse otherwiseNotFoundException - realmId is not foundNullArgumentException - id or
realmId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getParentRealmIds(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given realm.realmId - a realm Id Ids of the realmNotFoundException - realmId is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RealmList getParentRealms(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. realmId - the Id of the Realm to
query id NotFoundException - a Realm identified
by Id is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isAncestorOfRealm(Id id, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is an ancestor of a realm.id - an Id realmId - the Id of a realm tru e if this id is an ancestor
of realmId, false otherwiseNotFoundException - realmId is not foundNullArgumentException - id or
realmId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. boolean hasChildRealms(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
realmId - a realm Id true if the realmId has
children, false otherwiseNotFoundException - realmId is not foundNullArgumentException - borealmId is null okId
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isChildOfRealm(Id id, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id - an Id realmId - the Id of a realm true if the id is a child of
realmId, false otherwiseNotFoundException - realmId is not foundNullArgumentException - id or
realmId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id not found return false. IdList getChildRealmIds(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids of the given realm.realmId - the Id to queryNotFoundException - realmId is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RealmList getChildRealms(Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id. realmId - the Id of the Realm to
query id NotFoundException - a Realm identified
by Id is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean isDescendantOfRealm(Id id, Id realmId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id is a descendant of a realm.id - an Id realmId - the Id of a realm true if the id is a descendant
of the realmId, false otherwiseNotFoundException - realmId is not foundNullArgumentException - id or
realmId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. If - id is not found return false. Node getRealmNodeIds(Id realmId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
realmId - 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 - realmId is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RealmNode getRealmNodes(Id realmId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
realmId - 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 - realmId is not foundNullArgumentException - realmId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.