Interface OfficeHierarchySession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for traversing a hierarchy of
Offices . Each node in the hierarchy is a unique Office . The
hierarchy may be traversed recursively to establish the tree structure
through getParentOffices() and getChildOffices() . To
relate these Ids to another OSID, getOfficeNodes() can be
used for retrievals that can be used for bulk lookups in other OSIDs. Any
Office available in the Workflow OSID is known to this hierarchy
but does not appear in the hierarchy traversal until added as a root
availability or a child of another availability.
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 getParentOffices() or getChildOffices() in lieu of a
PERMISSION_DENIED error that may disrupt the traversal through
authorized stepways.
This session defines views that offer differing behaviors when retrieving multiple objects.
- comparative office view: office elements may be silently omitted or re-ordered
- plenary office view: provides a complete set or is an error condition
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform hierarchy queries.getChildOfficeIds(Id officeId) Gets the childIdsof the given office.getChildOffices(Id officeId) Gets the children of the given office.Gets the hierarchy associated with this session.Gets the hierarchyIdassociated with this session.getOfficeNodeIds(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given office.getOfficeNodes(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given office.getParentOfficeIds(Id officeId) Gets the parentIdsof the given office.getParentOffices(Id officeId) Gets the parents of the given office.Gets the root officeIdsin this hierarchy.Gets the root office in the office hierarchy.booleanhasChildOffices(Id officeId) Tests if an office has any children.booleanhasParentOffices(Id officeId) Tests if theOfficehas any parents.booleanisAncestorOfOffice(Id id, Id officeId) Tests if anIdis an ancestor of an office.booleanisChildOfOffice(Id id, Id officeId) Tests if an office is a direct child of another.booleanisDescendantOfOffice(Id id, Id officeId) Tests if anIdis a descendant of an office.booleanisParentOfOffice(Id id, Id officeId) Tests if anIdis a direct parent of office.voidThe returns from the office methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidA complete view of theOfficesreturns 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
-
getOfficeHierarchyId
Id getOfficeHierarchyId()Gets the hierarchyIdassociated with this session.- Returns:
- the hierarchy
Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getOfficeHierarchy
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.
-
canAccessOfficeHierarchy
boolean canAccessOfficeHierarchy()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.
-
useComparativeOfficeView
void useComparativeOfficeView()The returns from the office 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.
-
usePlenaryOfficeView
void usePlenaryOfficeView()A complete view of theOfficesreturns 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.
-
getRootOfficeIds
Gets the root officeIdsin this hierarchy.- Returns:
- the root office
Ids - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRootOffices
Gets the root office in the office hierarchy. An availability with no parents is an orphan. While all officeIdsare known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root availability or child of another availability.- Returns:
- the root offices
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
hasParentOffices
boolean hasParentOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if theOfficehas any parents.- Parameters:
officeId- an officeId- Returns:
trueif the office has parents, falseotherwise- Throws:
NotFoundException-officeIdis not foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isParentOfOffice
boolean isParentOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a direct parent of office.- Parameters:
id- anIdofficeId- theIdof an office- Returns:
trueif thisidis a parent ofofficeId, falseotherwise- Throws:
NotFoundException-officeIdis not foundNullArgumentException-idorofficeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getParentOfficeIds
IdList getParentOfficeIds(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parentIdsof the given office.- Parameters:
officeId- an officeId- Returns:
- the parent
Idsof the office - Throws:
NotFoundException-officeIdis not foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParentOffices
OfficeList getParentOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parents of the given office.- Parameters:
officeId- theIdto query- Returns:
- the parents of the office
- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isAncestorOfOffice
boolean isAncestorOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis an ancestor of an office.- Parameters:
id- anIdofficeId- theIdof an office- Returns:
trueif thisidis an ancestor ofofficeId,falseotherwise- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdoridisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
hasChildOffices
boolean hasChildOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if an office has any children.- Parameters:
officeId- an officeId- Returns:
trueif theofficeIdhas children,falseotherwise- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isChildOfOffice
boolean isChildOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if an office is a direct child of another.- Parameters:
id- anIdofficeId- theIdof an office- Returns:
trueif theIdis a child ofofficeId,falseotherwise- Throws:
NotFoundException-officeIdnot foundNullArgumentException-idorofficeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getChildOfficeIds
IdList getChildOfficeIds(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the childIdsof the given office.- Parameters:
officeId- theIdto query- Returns:
- the children of the office
- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getChildOffices
OfficeList getChildOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the children of the given office.- Parameters:
officeId- theIdto query- Returns:
- the children of the office
- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isDescendantOfOffice
boolean isDescendantOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a descendant of an office.- Parameters:
id- anIdofficeId- theIdof an office- Returns:
trueif theidis a descendant of theofficeId,falseotherwise- Throws:
NotFoundException-officeIdnot foundNullArgumentException-idorofficeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} is not found return {@code false} .
-
getOfficeNodeIds
Node getOfficeNodeIds(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given office.- Parameters:
officeId- theIdto queryancestorLevels- the maximum number of ancestor levels to include. A value of 0 returns no parents in the availability.descendantLevels- the maximum number of descendant levels to include. A value of 0 returns no children in the availability.includeSiblings-trueto include the siblings of the given availability,falseto omit the siblings- Returns:
- an office node
- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getOfficeNodes
OfficeNode getOfficeNodes(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given office.- Parameters:
officeId- theIdto queryancestorLevels- the maximum number of ancestor levels to include. A value of 0 returns no parents in the availability.descendantLevels- the maximum number of descendant levels to include. A value of 0 returns no children in the availability.includeSiblings-trueto include the siblings of the given availability,falseto omit the siblings- Returns:
- an office node
- Throws:
NotFoundException-officeIdnot foundNullArgumentException-officeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-