Interface PressHierarchySession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for traversing a hierarchy of
Presses . Each node in the hierarchy is a unique Press . The
hierarchy may be traversed recursively to establish the tree structure
through getParentPresses() and getChildPresses() . To
relate these Ids to another OSID, getPressNodes() can be
used for retrievals that can be used for bulk lookups in other OSIDs. Any
Press available in the Lexicon OSID is known to this hierarchy but
does not appear in the hierarchy traversal until added as a root press or
a child of another press.
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 getParentPresses() or getChildPresses() in lieu of a
PERMISSION_DENIED error that may disrupt the traversal through
authorized textways.
This session defines views that offer differing behaviors when retrieving multiple objects.
- comparative press view: press elements may be silently omitted or re-ordered
- plenary press view: provides a complete set or is an error condition
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform hierarchy queries.getChildPresses(Id pressId) Gets the children of the given press.getChildPressIds(Id pressId) Gets the childIdsof the given press.getParentPresses(Id pressId) Gets the parents of the given press.getParentPressIds(Id pressId) Gets the parentIdsof the given press.Gets the hierarchy associated with this session.Gets the hierarchyIdassociated with this session.getPressNodeIds(Id pressId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given press.getPressNodes(Id pressId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given press.Gets the root press in the press hierarchy.Gets the root pressIdsin this hierarchy.booleanhasChildPresses(Id pressId) Tests if an press has any children.booleanhasParentPresses(Id pressId) Tests if thePresshas any parents.booleanisAncestorOfPress(Id id, Id pressId) Tests if anIdis an ancestor of an press.booleanisChildOfPress(Id id, Id pressId) Tests if an press is a direct child of another.booleanisDescendantOfPress(Id id, Id pressId) Tests if anIdis a descendant of an press.booleanisParentOfPress(Id id, Id pressId) Tests if anIdis a direct parent of press.voidThe returns from the press methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidA complete view of thePressesreturns 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
-
getPressHierarchyId
Id getPressHierarchyId()Gets the hierarchyIdassociated with this session.- Returns:
- the hierarchy
Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPressHierarchy
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.
-
canAccessPressHierarchy
boolean canAccessPressHierarchy()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 press that may opt not to offer lookup operations.- Returns:
falseif hierarchy traversal methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativePressView
void useComparativePressView()The returns from the press 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.
-
usePlenaryPressView
void usePlenaryPressView()A complete view of thePressesreturns 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.
-
getRootPressIds
Gets the root pressIdsin this hierarchy.- Returns:
- the root press
Ids - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRootPresses
Gets the root press in the press hierarchy. an press with no parents is an orphan. While all pressIdsare known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root press or child of another press.- Returns:
- the root presses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
hasParentPresses
boolean hasParentPresses(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if thePresshas any parents.- Parameters:
pressId- an pressId- Returns:
trueif the press has parents, falseotherwise- Throws:
NotFoundException-pressIdis not foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isParentOfPress
boolean isParentOfPress(Id id, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a direct parent of press.- Parameters:
id- anIdpressId- theIdof an press- Returns:
trueif thisidis a parent ofpressId, falseotherwise- Throws:
NotFoundException-pressIdis not foundNullArgumentException-idorpressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getParentPressIds
IdList getParentPressIds(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parentIdsof the given press.- Parameters:
pressId- an pressId- Returns:
- the parent
Idsof the press - Throws:
NotFoundException-pressIdis not foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParentPresses
PressList getParentPresses(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parents of the given press.- Parameters:
pressId- theIdto query- Returns:
- the parents of the press
- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isAncestorOfPress
boolean isAncestorOfPress(Id id, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis an ancestor of an press.- Parameters:
id- anIdpressId- theIdof an press- Returns:
trueif thisidis an ancestor ofpressId,falseotherwise- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdoridisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
hasChildPresses
boolean hasChildPresses(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if an press has any children.- Parameters:
pressId- an pressId- Returns:
trueif thepressIdhas children,falseotherwise- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isChildOfPress
boolean isChildOfPress(Id id, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if an press is a direct child of another.- Parameters:
id- anIdpressId- theIdof an press- Returns:
trueif theidis a child ofpressId,falseotherwise- Throws:
NotFoundException-pressIdnot foundNullArgumentException-idorpressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getChildPressIds
IdList getChildPressIds(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the childIdsof the given press.- Parameters:
pressId- theIdto query- Returns:
- the children of the press
- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getChildPresses
PressList getChildPresses(Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the children of the given press.- Parameters:
pressId- theIdto query- Returns:
- the children of the press
- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isDescendantOfPress
boolean isDescendantOfPress(Id id, Id pressId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a descendant of an press.- Parameters:
id- anIdpressId- theIdof an press- Returns:
trueif theidis a descendant of thepressId,falseotherwise- Throws:
NotFoundException-pressIdnot foundNullArgumentException-idorpressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} is not found return {@code false} .
-
getPressNodeIds
Node getPressNodeIds(Id pressId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given press.- Parameters:
pressId- theIdto queryancestorLevels- the maximum number of ancestor levels to include. A value of 0 returns no parents in the press.descendantLevels- the maximum number of descendant levels to include. A value of 0 returns no children in the press.includeSiblings-trueto include the siblings of the given press,falseto omit the siblings- Returns:
- an press node
- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPressNodes
PressNode getPressNodes(Id pressId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given press.- Parameters:
pressId- 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 press,falseto omit the siblings- Returns:
- an press node
- Throws:
NotFoundException-pressIdnot foundNullArgumentException-pressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-