Interface FoundryHierarchySession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for traversing a hierarchy of
Foundry objects. Each node in the hierarchy is a unique Foundry .
The hierarchy may be traversed recursively to establish the tree structure
through getParentFoundries() and getChildFoundries() . To
relate these Ids to another OSID, getFoundryNodes() can be
used for retrievals that can be used for bulk lookups in other OSIDs. Any
Foundry available in the Resourcing OSID is known to this
hierarchy but does not appear in the hierarchy traversal until added as a
root foundry or a child of another foundry.
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 getParentFoundries() or getChildFoundries() in lieu of
a PERMISSION_DENIED error that may disrupt the traversal through
authorized effortways.
This session defines views that offer differing behaviors when retrieving multiple objects.
- comparative foundry view: foundry elements may be silently omitted or re-ordered
- plenary foundry view: provides a complete set or is an error condition
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform hierarchy queries.getChildFoundries(Id foundryId) Gets the children of the given foundry.getChildFoundryIds(Id foundryId) Gets the childIdsof the given foundry.Gets the hierarchy associated with this session.Gets the hierarchyIdassociated with this session.getFoundryNodeIds(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given foundry.getFoundryNodes(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given foundry.getParentFoundries(Id foundryId) Gets the parents of the given foundry.getParentFoundryIds(Id foundryId) Gets the parentIdsof the given foundry.Gets the root foundry in the foundry hierarchy.Gets the root foundryIdsin this hierarchy.booleanhasChildFoundries(Id foundryId) Tests if a foundry has any children.booleanhasParentFoundries(Id foundryId) Tests if theFoundryhas any parents.booleanisAncestorOfFoundry(Id id, Id foundryId) Tests if anIdis an ancestor of a foundry.booleanisChildOfFoundry(Id id, Id foundryId) Tests if a foundry is a direct child of another.booleanisDescendantOfFoundry(Id id, Id foundryId) Tests if anIdis a descendant of a foundry.booleanisParentOfFoundry(Id id, Id foundryId) Tests if anIdis a direct parent of foundry.voidThe returns from the foundry methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidA complete view of theFoundriesreturns is desired.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getFoundryHierarchyId
Id getFoundryHierarchyId()Gets the hierarchyIdassociated with this session.- Returns:
- the hierarchy
Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getFoundryHierarchy
Gets the hierarchy associated with this session.- Returns:
- the hierarchy associated with this session
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canAccessFoundryHierarchy
boolean canAccessFoundryHierarchy()Tests if this user can perform hierarchy queries. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif hierarchy traversal methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeFoundryView
void useComparativeFoundryView()The returns from the foundry methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryFoundryView
void usePlenaryFoundryView()A complete view of theFoundriesreturns 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.- Compliance:
mandatory- This method is must be implemented.
-
getRootFoundryIds
Gets the root foundryIdsin this hierarchy.- Returns:
- the root foundry
Ids - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRootFoundries
Gets the root foundry in the foundry hierarchy. A foundry with no parents is an orphan. While all foundryIdsare known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root foundry or child of another foundry.- Returns:
- the root foundries
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
hasParentFoundries
boolean hasParentFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if theFoundryhas any parents.- Parameters:
foundryId- a foundryId- Returns:
trueif the foundry has parents, falseotherwise- Throws:
NotFoundException-foundryIdis not foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isParentOfFoundry
boolean isParentOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a direct parent of foundry.- Parameters:
id- anIdfoundryId- theIdof a foundry- Returns:
trueif thisidis a parent offoundryId, falseotherwise- Throws:
NotFoundException-foundryIdis not foundNullArgumentException-idorfoundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getParentFoundryIds
IdList getParentFoundryIds(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parentIdsof the given foundry.- Parameters:
foundryId- a foundryId- Returns:
- the parent
Idsof the foundry - Throws:
NotFoundException-foundryIdis not foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParentFoundries
FoundryList getParentFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parents of the given foundry.- Parameters:
foundryId- theIdto query- Returns:
- the parents of the foundry
- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isAncestorOfFoundry
boolean isAncestorOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis an ancestor of a foundry.- Parameters:
id- anIdfoundryId- theIdof a foundry- Returns:
trueif thisidis an ancestor offoundryId,falseotherwise- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdoridisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
hasChildFoundries
boolean hasChildFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if a foundry has any children.- Parameters:
foundryId- a foundryId- Returns:
trueif thefoundryIdhas children,falseotherwise- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isChildOfFoundry
boolean isChildOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if a foundry is a direct child of another.- Parameters:
id- anIdfoundryId- theIdof a foundry- Returns:
trueif theidis a child offoundryId,falseotherwise- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-idorfoundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getChildFoundryIds
IdList getChildFoundryIds(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the childIdsof the given foundry.- Parameters:
foundryId- theIdto query- Returns:
- the children of the foundry
- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getChildFoundries
FoundryList getChildFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the children of the given foundry.- Parameters:
foundryId- theIdto query- Returns:
- the children of the foundry
- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isDescendantOfFoundry
boolean isDescendantOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a descendant of a foundry.- Parameters:
id- anIdfoundryId- theIdof a foundry- Returns:
trueif theidis a descendant of thefoundryId,falseotherwise- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-idorfoundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} is not found return {@code false} .
-
getFoundryNodeIds
Node getFoundryNodeIds(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given foundry.- Parameters:
foundryId- theIdto 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 hier.archyincludeSiblings-trueto include the siblings of the given foundry,falseto omit the siblings- Returns:
- a foundry node
- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getFoundryNodes
FoundryNode getFoundryNodes(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given foundry.- Parameters:
foundryId- theIdto 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-trueto include the siblings of the given foundry,falseto omit the siblings- Returns:
- a foundry node
- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-