public interface FoundryHierarchySession extends 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.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccessFoundryHierarchy()
Tests if this user can perform hierarchy queries.
|
FoundryList |
getChildFoundries(Id foundryId)
Gets the children of the given foundry.
|
IdList |
getChildFoundryIds(Id foundryId)
Gets the child
Ids of the given foundry. |
Hierarchy |
getFoundryHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getFoundryHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getFoundryNodeIds(Id foundryId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given foundry.
|
FoundryNode |
getFoundryNodes(Id foundryId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given foundry.
|
FoundryList |
getParentFoundries(Id foundryId)
Gets the parents of the given foundry.
|
IdList |
getParentFoundryIds(Id foundryId)
Gets the parent
Ids of the given foundry. |
FoundryList |
getRootFoundries()
Gets the root foundry in the foundry hierarchy.
|
IdList |
getRootFoundryIds()
Gets the root foundry
Ids in this hierarchy. |
boolean |
hasChildFoundries(Id foundryId)
Tests if a foundry has any children.
|
boolean |
hasParentFoundries(Id foundryId)
Tests if the
Foundry has any parents. |
boolean |
isAncestorOfFoundry(Id id,
Id foundryId)
Tests if an
Id is an ancestor of a foundry. |
boolean |
isChildOfFoundry(Id id,
Id foundryId)
Tests if a foundry is a direct child of another.
|
boolean |
isDescendantOfFoundry(Id id,
Id foundryId)
Tests if an
Id is a descendant of a foundry. |
boolean |
isParentOfFoundry(Id id,
Id foundryId)
Tests if an
Id is a direct parent of foundry. |
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.
|
void |
usePlenaryFoundryView()
A complete view of the
Foundries returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getFoundryHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getFoundryHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessFoundryHierarchy()
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 useComparativeFoundryView()
mandatory
- This method is must be implemented. void usePlenaryFoundryView()
Foundries
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 getRootFoundryIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FoundryList getRootFoundries() throws OperationFailedException, PermissionDeniedException
Ids
are known
to the hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root foundry or child of another foundry.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Foundry
has any parents.foundryId
- a foundry Id
true
if the foundry has parents, f alse
otherwiseNotFoundException
- foundryId
is not
foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of foundry.id
- an Id
foundryId
- the Id
of a foundry true
if this id
is a parent of
foundryId,
f alse
otherwiseNotFoundException
- foundryId
is not
foundNullArgumentException
- id
or
foundryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentFoundryIds(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given foundry.foundryId
- a foundry Id
Ids
of the foundryNotFoundException
- foundryId
is not
foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FoundryList getParentFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- the Id
to queryNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a foundry.id
- an Id
foundryId
- the Id
of a foundry tru
e if this id
is an ancestor
of foundryId,
false
otherwiseNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- a foundry Id
true
if the foundryId
has
children, false
otherwiseNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
foundryId
- the Id
of a foundry true
if the id
is a child of
foundryId,
false
otherwiseNotFoundException
- foundryId
not foundNullArgumentException
- id
or
foundryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildFoundryIds(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given foundry.foundryId
- the Id
to queryNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FoundryList getChildFoundries(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- the Id
to queryNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfFoundry(Id id, Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a foundry.id
- an Id
foundryId
- the Id
of a foundry true
if the id
is a descendant
of the foundryId,
false
otherwiseNotFoundException
- foundryId
not foundNullArgumentException
- id
or
foundryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getFoundryNodeIds(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- the Id
to 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
- true
to include the siblings of
the given foundry, false
to omit the siblingsNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. FoundryNode getFoundryNodes(Id foundryId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- the Id
to 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
- true
to include the siblings of
the given foundry, false
to omit the siblingsNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.