public interface BusinessHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Business
objects. Each node in the hierarchy is a unique
Business.
The hierarchy may be traversed recursively to establish
the tree structure through getParentBusinesses()
and
getChildBusinesses().
To relate these Ids
to
another OSID, getBusinessNodes()
can be used for retrievals
that can be used for bulk lookups in other OSIDs. Any Business
available in the Financials 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 getParentBusinesses()
or getChildBusiness()
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 |
canAccessBusinessHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getBusinessHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getBusinessHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getBusinessNodeIds(Id businessId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given business.
|
BusinessNode |
getBusinessNodes(Id businessId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given business.
|
BusinessList |
getChildBusinesses(Id businessId)
Gets the children of the given business.
|
IdList |
getChildBusinessIds(Id businessId)
Gets the child
Ids of the given business. |
BusinessList |
getParentBusinesses(Id businessId)
Gets the parents of the given business.
|
IdList |
getParentBusinessIds(Id businessId)
Gets the parent
Ids of the given business. |
BusinessList |
getRootBusinesses()
Gets the root businesses in the business hierarchy.
|
IdList |
getRootBusinessIds()
Gets the root business
Ids in this hierarchy. |
boolean |
hasChildBusinesses(Id businessId)
Tests if a business has any children.
|
boolean |
hasParentBusinesses(Id businessId)
Tests if the
Business has any parents. |
boolean |
isAncestorOfBusiness(Id id,
Id businessId)
Tests if an
Id is an ancestor of a business. |
boolean |
isChildOfBusiness(Id id,
Id businessId)
Tests if a business is a direct child of another.
|
boolean |
isDescendantOfBusiness(Id id,
Id businessId)
Tests if an
Id is a descendant of a business. |
boolean |
isParentOfBusiness(Id id,
Id businessId)
Tests if an
Id is a direct parent of business. |
void |
useComparativeBusinessView()
The returns from the business methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryBusinessView()
A complete view of the
Businesses returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBusinessHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getBusinessHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessBusinessHierarchy()
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 useComparativeBusinessView()
mandatory
- This method is must be implemented. void usePlenaryBusinessView()
Businesses
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 getRootBusinessIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BusinessList getRootBusinesses() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentBusinesses(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Business
has any parents.businessId
- a catalog Id
true
if the catalog has parents, f alse
otherwiseNotFoundException
- businessId
is not
foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfBusiness(Id id, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of business.id
- an Id
businessId
- the Id
of a catalog true
if this id
is a parent of
businessId,
f alse
otherwiseNotFoundException
- businessId
is not
foundNullArgumentException
- id
or
businessId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentBusinessIds(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given business.businessId
- a catalog Id
NotFoundException
- businessId
is not
foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BusinessList getParentBusinesses(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
businessId
- the Id
to queryNotFoundException
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfBusiness(Id id, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a business.id
- an Id
businessId
- the Id
of a catalog tru
e if this id
is an ancestor
of businessId,
false
otherwiseNotFoundException
- businessId
not foundNullArgumentException
- businessId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildBusinesses(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
businessId
- a business Id
true
if the businessId
has
children, false
otherwiseNotFoundException
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfBusiness(Id id, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
businessId
- the Id
of a catalog true
if the id
is a child of
businessId,
false
otherwiseNotFoundException
- businessId
not foundNullArgumentException
- id
or
businessId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildBusinessIds(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given business.businessId
- the Id
to queryNotFoundException
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BusinessList getChildBusinesses(Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
businessId
- the Id
to queryNotFoundException
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfBusiness(Id id, Id businessId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a business.id
- an Id
businessId
- the Id
of a catalog true
if the id
is a descendant
of the businessId,
false
otherwiseNotFoundException
- businessId
not foundNullArgumentException
- id
or
businessId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getBusinessNodeIds(Id businessId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
businessId
- 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
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BusinessNode getBusinessNodes(Id businessId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
businessId
- 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
- businessId
not foundNullArgumentException
- businessId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.