public interface DistributorHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Distributor
objects. Each node in the hierarchy is a unique
Distributor.
The hierarchy may be traversed recursively to
establish the tree structure through getParentDistributors()
and getChildDistributors().
To relate these
Ids
to another OSID, getDistributorNodes()
can be
used for retrievals that can be used for bulk lookups in other OSIDs. Any
Distributor
available in the Provisioning OSID is known to
this hierarchy but does not appear in the hierarchy traversal until added
as a root distributor or a child of another distributor.
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 getParentDistributors()
or getChildDistributors()
in lieu of a PERMISSION_DENIED
error that may
disrupt the traversal through authorized provisionways.
This session defines views that offer differing behaviors when retrieving multiple objects.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccessDistributorHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildDistributorIds(Id distributorId)
Gets the child
Ids of the given distributor. |
DistributorList |
getChildDistributors(Id distributorId)
Gets the children of the given distributor.
|
Hierarchy |
getDistributorHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getDistributorHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getDistributorNodeIds(Id distributorId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given distributor.
|
DistributorNode |
getDistributorNodes(Id distributorId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given distributor.
|
IdList |
getParentDistributorIds(Id distributorId)
Gets the parent
Ids of the given distributor. |
DistributorList |
getParentDistributors(Id distributorId)
Gets the parents of the given distributor.
|
IdList |
getRootDistributorIds()
Gets the root distributor
Ids in this hierarchy. |
DistributorList |
getRootDistributors()
Gets the root distributor in the distributor hierarchy.
|
boolean |
hasChildDistributors(Id distributorId)
Tests if a distributor has any children.
|
boolean |
hasParentDistributors(Id distributorId)
Tests if the
Distributor has any parents. |
boolean |
isAncestorOfDistributor(Id id,
Id distributorId)
Tests if an
Id is an ancestor of a distributor. |
boolean |
isChildOfDistributor(Id id,
Id distributorId)
Tests if a distributor is a direct child of another.
|
boolean |
isDescendantOfDistributor(Id id,
Id distributorId)
Tests if an
Id is a descendant of a distributor. |
boolean |
isParentOfDistributor(Id id,
Id distributorId)
Tests if an
Id is a direct parent of distributor. |
void |
useComparativeDistributorView()
The returns from the distributor methods may omit or translate
elements based on this session, such as authorization, and not result
in an error.
|
void |
usePlenaryDistributorView()
A complete view of the
Distributors returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDistributorHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getDistributorHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessDistributorHierarchy()
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 useComparativeDistributorView()
mandatory
- This method is must be implemented. void usePlenaryDistributorView()
Distributors
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 getRootDistributorIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DistributorList getRootDistributors() throws OperationFailedException, PermissionDeniedException
Ids
are known to the hierarchy, an orphan does not appear in the hierarchy
unless explicitly added as a root distributor or child of another
distributor.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentDistributors(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Distributor
has any parents.distributorId
- a distributor Id
true
if the distributor has parents, f
alse
otherwiseNotFoundException
- distributorId
is not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfDistributor(Id id, Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of distributor.id
- an Id
distributorId
- the Id
of a distributor true
if this id
is a parent of
distributorId,
f alse
otherwiseNotFoundException
- distributorId
is not
foundNullArgumentException
- id
or
distributorId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentDistributorIds(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given distributor.distributorId
- a distributor Id
Ids
of the distributorNotFoundException
- distributorId
is not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DistributorList getParentDistributors(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId
- the Id
to queryNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfDistributor(Id id, Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a distributor.id
- an Id
distributorId
- the Id
of a distributor tru
e if this id
is an ancestor
of distributorId,
false
otherwiseNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildDistributors(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId
- a distributor Id
true
if the distributorId
has
children, false
otherwiseNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfDistributor(Id id, Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
distributorId
- the Id
of a distributor true
if the id
is a child of
distributorId,
false
otherwiseNotFoundException
- distributorId
not
foundNullArgumentException
- id
or
distributorId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildDistributorIds(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given distributor.distributorId
- the Id
to queryNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DistributorList getChildDistributors(Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId
- the Id
to queryNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfDistributor(Id id, Id distributorId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a distributor.id
- an Id
distributorId
- the Id
of a distributor true
if the id
is a descendant
of the distributorId,
false
otherwiseNotFoundException
- distributorId
not
foundNullArgumentException
- id
or
distributorId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getDistributorNodeIds(Id distributorId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the distributor.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the distributor.includeSiblings
- true
to include the siblings of
the given distributor, false
to omit the
siblingsNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. DistributorNode getDistributorNodes(Id distributorId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
distributorId
- 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 distributor, false
to omit the
siblingsNotFoundException
- distributorId
not
foundNullArgumentException
- distributorId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.