public interface RepositoryHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Repository
objects. Each node in the hierarchy is a unique
Repository.
The hierarchy may be traversed recursively to
establish the tree structure through getParents()
and
getChildren().
To relate these Ids
to
another OSID, getAncestors()
and getDescendants()
can be used for retrievals that can be used for bulk lookups in
other OSIDs. Any Repository
available in the Repository
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 getParents()
or getChildren()
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 |
canAccessRepositoryHierarchy()
Tests if this user can perform hierarchy queries.
|
RepositoryList |
getChildRepositories(Id repositoryId)
Gets the children of the given repository.
|
IdList |
getChildRepositoryIds(Id repositoryId)
Gets the
Ids of the children of the given repository. |
RepositoryList |
getParentRepositories(Id repositoryId)
Gets the parents of the given repository.
|
IdList |
getParentRepositoryIds(Id repositoryId)
Gets the parent
Ids of the given repository. |
Hierarchy |
getRepositoryHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getRepositoryHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getRepositoryNodeIds(Id repositoryId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given repository.
|
RepositoryNode |
getRepositoryNodes(Id repositoryId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given repository.
|
RepositoryList |
getRootRepositories()
Gets the root repositories in the repository hierarchy.
|
IdList |
getRootRepositoryIds()
Gets the root repository
Ids in this hierarchy. |
boolean |
hasChildRepositories(Id repositoryId)
Tests if a repository has any children.
|
boolean |
hasParentRepositories(Id repositoryId)
Tests if the
Repository has any parents. |
boolean |
isAncestorOfRepository(Id id,
Id repositoryId)
Tests if an
Id is an ancestor of a repository. |
boolean |
isChildOfRepository(Id id,
Id repositoryId)
Tests if a node is a direct child of another.
|
boolean |
isDescendantOfRepository(Id id,
Id repositoryId)
Tests if an
Id is a descendant of a repository. |
boolean |
isParentOfRepository(Id id,
Id repositoryId)
Tests if an
Id is a direct parent of a repository. |
void |
useComparativeRepositoryView()
The returns from the repository methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryRepositoryView()
A complete view of the
Repository returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getRepositoryHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getRepositoryHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessRepositoryHierarchy()
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 useComparativeRepositoryView()
mandatory
- This method is must be implemented. void usePlenaryRepositoryView()
Repository
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 getRootRepositoryIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. RepositoryList getRootRepositories() 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 hasParentRepositories(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Repository
has any parents.repositoryId
- a repository Id
true
if the repository has parents,
false
otherwiseNotFoundException
- repositoryId
is not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfRepository(Id id, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of a repository.id
- an Id
repositoryId
- the Id
of a repository true
if this id
is a parent of
repositoryId,
false
otherwiseNotFoundException
- repositoryId
is not
foundNullArgumentException
- id
or
repositoryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentRepositoryIds(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given repository.repositoryId
- a repository Id
Ids
of the repositoryNotFoundException
- repositoryId
is not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. RepositoryList getParentRepositories(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
repositoryId
- the Id
to queryNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfRepository(Id id, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a repository.id
- an Id
repositoryId
- the Id of a repository true
if this id
is an ancestor
of repositoryId,
false
otherwiseNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildRepositories(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
repositoryId
- a repository Id
true
if the repositoryId
has
children, false
otherwiseNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfRepository(Id id, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
repositoryId
- the Id
of a repository true
if the id
is a child of
repositoryId,
false
otherwiseNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildRepositoryIds(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the children of the given repository.repositoryId
- the Id
to queryNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. RepositoryList getChildRepositories(Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
repositoryId
- the Id
to queryNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfRepository(Id id, Id repositoryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a repository.id
- an Id
repositoryId
- the Id
of a repository true
if the id
is a descendant
of the repositoryId,
false
otherwiseNotFoundException
- repositoryId
not
foundNullArgumentException
- repositoryId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getRepositoryNodeIds(Id repositoryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
repositoryId
- 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
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. RepositoryNode getRepositoryNodes(Id repositoryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
repositoryId
- 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
- repositoryId
not
foundNullArgumentException
- repositoryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.