Interface ConfigurationHierarchySession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for traversing a hierarchy of
Configurations . Each node in the hierarchy is a unique
Configuration . The hierarchy may be traversed recursively to establish
the tree structure through getParentConfigurations() and
getChildConfigurations() . To relate these Ids to another OSID,
getConfigurationNodes() can be used for retrievals that can be
used for bulk lookups in other OSIDs. Any Configuration available
in the Configuration 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 getParentConfigurationss() or getChildConfigurations()
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.
- comparative view: configuration elements may be silently omitted or re-ordered
- plenary view: provides a complete set or is an error condition
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can perform hierarchy queries.getChildConfigurationIds(Id configurationId) Gets the childIdsof the given configuration.getChildConfigurations(Id configurationId) Gets the children of the given configuration.Gets the hierarchy associated with this session.Gets the hierarchyIdassociated with this session.getConfigurationNodeIds(Id configurationId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given configuration.getConfigurationNodes(Id configurationId, long ancestorLevels, long descendantLevels, boolean includeSiblings) Gets a portion of the hierarchy for the given configuration.getParentConfigurationIds(Id configurationId) Gets the parentIdsof the given configuration.getParentConfigurations(Id configurationId) Gets the parents of the given configuration.Gets the root configurationIdsin this hierarchy.Gets the root configurations in the configuration hierarchy.booleanhasChildConfigurations(Id configurationId) Tests if a configuration has any children.booleanhasParentConfigurations(Id configurationId) Tests if theConfigurationhas any parents.booleanisAncestorOfConfiguration(Id id, Id configurationId) Tests if an Id is an ancestor of a configuration.booleanisChildOfConfiguration(Id id, Id configurationId) Tests if a node is a direct child of another.booleanisDescendantOfConfiguration(Id id, Id configurationId) Tests if anIdis a descendant of a configuration.booleanisParentOfConfiguration(Id id, Id configurationId) Tests if anIdis a direct parent of configuration.voidThe returns from the configuration methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidA complete view of theConfigurationreturns 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
-
getConfigurationHierarchyId
Id getConfigurationHierarchyId()Gets the hierarchyIdassociated with this session.- Returns:
- the configuration
Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getConfigurationHierarchy
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.
-
canAccessConfigurationHierarchy
boolean canAccessConfigurationHierarchy()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.
-
useComparativeConfigurationView
void useComparativeConfigurationView()The returns from the configuration 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.
-
usePlenaryConfigurationView
void usePlenaryConfigurationView()A complete view of theConfigurationreturns 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.
-
getRootConfigurationIds
Gets the root configurationIdsin this hierarchy.- Returns:
- the root configuration
Ids - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getRootConfigurations
ConfigurationList getRootConfigurations() throws OperationFailedException, PermissionDeniedExceptionGets the root configurations in the configuration hierarchy. A node with no parents is an orphan. While all configurationIdsare known to the hierarchy, an orphan does not appear in the hierarchy unless explicitly added as a root node or child of another node.- Returns:
- the root configurations
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
hasParentConfigurations
boolean hasParentConfigurations(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if theConfigurationhas any parents.- Parameters:
configurationId- a configuration Id- Returns:
trueif the configuration has parents, falseotherwise- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isParentOfConfiguration
boolean isParentOfConfiguration(Id id, Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a direct parent of configuration.- Parameters:
id- anIdconfigurationId- a configuration Id- Returns:
trueif thisidis a parent ofconfigurationId, falseotherwise- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-idorconfigurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getParentConfigurationIds
IdList getParentConfigurationIds(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parentIdsof the given configuration.- Parameters:
configurationId- a configuration Id- Returns:
- the parent Ids of the configuration
- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getParentConfigurations
ConfigurationList getParentConfigurations(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the parents of the given configuration.- Parameters:
configurationId- theIdto query- Returns:
- the parents of the configuration
- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isAncestorOfConfiguration
boolean isAncestorOfConfiguration(Id id, Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if an Id is an ancestor of a configuration.- Parameters:
id- anIdconfigurationId- theIdof a configuration- Returns:
trueif thisidis an ancestor ofconfigurationId,falseotherwise- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-idorconfigurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
hasChildConfigurations
boolean hasChildConfigurations(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if a configuration has any children.- Parameters:
configurationId- aconfigurationId- Returns:
trueif theconfigurationIdhas children,falseotherwise- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isChildOfConfiguration
boolean isChildOfConfiguration(Id id, Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if a node is a direct child of another.- Parameters:
id- anIdconfigurationId- theIdof a configuration- Returns:
trueif theidis a child ofconfigurationId,falseotherwise- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-idorconfigurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} not found return {@code false} .
-
getChildConfigurationIds
IdList getChildConfigurationIds(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the childIdsof the given configuration.- Parameters:
configurationId- theIdto query- Returns:
- the children of the configuration
- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getChildConfigurations
ConfigurationList getChildConfigurations(Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the children of the given configuration.- Parameters:
configurationId- theIdto query- Returns:
- the children of the configuration
- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
isDescendantOfConfiguration
boolean isDescendantOfConfiguration(Id id, Id configurationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Tests if anIdis a descendant of a configuration.- Parameters:
id- anIdconfigurationId- theIdof a configuration- Returns:
trueif theidis a descendant of theconfigurationId,falseotherwise- Throws:
NotFoundException-configurationIdis not foundNullArgumentException-idorconfigurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.- Notes:
If- {@code id} is not found return {@code false} .
-
getConfigurationNodeIds
Node getConfigurationNodeIds(Id configurationId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given configuration.- Parameters:
configurationId- theIdto 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-trueto include the siblings of the given node,falseto omit the siblings- Returns:
- a configuration node
- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getConfigurationNodes
ConfigurationNode getConfigurationNodes(Id configurationId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets a portion of the hierarchy for the given configuration.- Parameters:
configurationId- theIdto 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-trueto include the siblings of the given node,falseto omit the siblings- Returns:
- a configuration node
- Throws:
NotFoundException-configurationIdnot foundNullArgumentException-configurationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-