public interface BankHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Bank
objects. Each node in the hierarchy is a unique Bank.
The hierarchy may be traversed recursively to establish the tree
structure through getParentBanks()
and
getChildBanks().
To relate these Ids
to another
OSID, getBankNodes()
can be used for retrievals that can be
used for bulk lookups in other OSIDs. Any Bank
available in
the Assessment 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 getParentBanks()
or getChildBanks()
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 |
canAccessBankHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getBankHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getBankHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getBankNodeIds(Id bankId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given bank.
|
BankNode |
getBankNodes(Id bankId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given bank.
|
IdList |
getChildBankIds(Id bankId)
Gets the child
Ids of the given bank. |
BankList |
getChildBanks(Id bankId)
Gets the children of the given bank.
|
IdList |
getParentBankIds(Id bankId)
Gets the parent
Ids of the given bank. |
BankList |
getParentBanks(Id bankId)
Gets the parents of the given bank.
|
IdList |
getRootBankIds()
Gets the root bank
Ids in this hierarchy. |
BankList |
getRootBanks()
Gets the root banks in this bank hierarchy.
|
boolean |
hasChildBanks(Id bankId)
Tests if a bank has any children.
|
boolean |
hasParentBanks(Id bankId)
Tests if the
Bank has any parents. |
boolean |
isAncestorOfBank(Id id,
Id bankId)
Tests if an
Id is an ancestor of a bank. |
boolean |
isChildOfBank(Id id,
Id bankId)
Tests if a bank is a direct child of another.
|
boolean |
isDescendantOfBank(Id id,
Id bankId)
Tests if an
Id is a descendant of a bank. |
boolean |
isParentOfBank(Id id,
Id bankId)
Tests if an
Id is a direct parent of a bank. |
void |
useComparativeBankView()
The returns from the bank methods may omit or translate elements based
on this session, such as assessment, and not result in an error.
|
void |
usePlenaryBankView()
A complete view of the
Hierarchy returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBankHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getBankHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- assessment failuremandatory
- This method must be implemented. boolean canAccessBankHierarchy()
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 useComparativeBankView()
mandatory
- This method is must be implemented. void usePlenaryBankView()
Hierarchy
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 getRootBankIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. BankList getRootBanks() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method is must be implemented. boolean hasParentBanks(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Bank
has any parents.bankId
- a bank Id
true
if the bank has parents, false
otherwiseNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. boolean isParentOfBank(Id id, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of a bank.id
- an Id
bankId
- the Id
of a bank true
if this id
is a parent of
bankId,
false
otherwiseNotFoundException
- bankId
is not foundNullArgumentException
- id
or
bankId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentBankIds(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given bank.bankId
- a bank Id
Ids
of the bankNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. BankList getParentBanks(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- a bank Id
NotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failure
occurredmandatory
- This method must be implemented. boolean isAncestorOfBank(Id id, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a bank.id
- an Id
bankId
- the Id
of a bank true
if this id
is an ancestor
of bankId,
false
otherwiseNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildBanks(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- a bankId
true
if the bankId
has children,
false
otherwiseNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfBank(Id id, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
bankId
- the Id
of a bank true
if the id
is a child of
bankId,
false
otherwiseNotFoundException
- bankId
not foundNullArgumentException
- bankId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildBankIds(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given bank.bankId
- the Id
to queryNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BankList getChildBanks(Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- the Id
to queryNotFoundException
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfBank(Id id, Id bankId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a bank.id
- an Id
bankId
- the Id
of a bank true
if the id
is a descendant
of the bankId,
false
otherwiseNotFoundException
- bankId
not foundNullArgumentException
- bankId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getBankNodeIds(Id bankId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- 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
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BankNode getBankNodes(Id bankId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
bankId
- 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
- bankId
is not foundNullArgumentException
- bankId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.