public interface WarehouseHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Warehouse
objects. Each node in the hierarchy is a unique
Warehouse.
The hierarchy may be traversed recursively to establish
the tree structure through getParentWarehouses()
and
getChildWarehouses().
To relate these Ids
to
another OSID, getWarehouseNodes()
can be used for
retrievals that can be used for bulk lookups in other OSIDs. Any
Warehouse
available in the Inventory 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 getParentWarehouses()
or getChildWarehouse()
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 |
canAccessWarehouseHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildWarehouseIds(Id warehouseId)
Gets the child
Ids of the given warehouse. |
WarehouseList |
getChildWarehouses(Id warehouseId)
Gets the children of the given warehouse.
|
IdList |
getParentWarehouseIds(Id warehouseId)
Gets the parent
Ids of the given warehouse. |
WarehouseList |
getParentWarehouses(Id warehouseId)
Gets the parents of the given warehouse.
|
IdList |
getRootWarehouseIds()
Gets the root warehouse
Ids in this hierarchy. |
WarehouseList |
getRootWarehouses()
Gets the root warehouses in the warehouse hierarchy.
|
Hierarchy |
getWarehouseHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getWarehouseHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getWarehouseNodeIds(Id warehouseId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given warehouse.
|
WarehouseNode |
getWarehouseNodes(Id warehouseId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given warehouse.
|
boolean |
hasChildWarehouses(Id warehouseId)
Tests if a warehouse has any children.
|
boolean |
hasParentWarehouses(Id warehouseId)
Tests if the
Warehouse has any parents. |
boolean |
isAncestorOfWarehouse(Id id,
Id warehouseId)
Tests if an
Id is an ancestor of a warehouse. |
boolean |
isChildOfWarehouse(Id id,
Id warehouseId)
Tests if a warehouse is a direct child of another.
|
boolean |
isDescendantOfWarehouse(Id id,
Id warehouseId)
Tests if an
Id is a descendant of a warehouse. |
boolean |
isParentOfWarehouse(Id id,
Id warehouseId)
Tests if an
Id is a direct parent of warehouse. |
void |
useComparativeWarehouseView()
The returns from the warehouse methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryWarehouseView()
A complete view of the
Warehouses returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getWarehouseHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getWarehouseHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessWarehouseHierarchy()
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 useComparativeWarehouseView()
mandatory
- This method is must be implemented. void usePlenaryWarehouseView()
Warehouses
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 getRootWarehouseIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WarehouseList getRootWarehouses() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentWarehouses(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Warehouse
has any parents.warehouseId
- a catalog Id
true
if the catalog has parents, f alse
otherwiseNotFoundException
- warehouseId
is not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfWarehouse(Id id, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of warehouse.id
- an Id
warehouseId
- the Id
of a catalog true
if this id
is a parent of
warehouseId,
f alse
otherwiseNotFoundException
- warehouseId
is not
foundNullArgumentException
- id
or
warehouseId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentWarehouseIds(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given warehouse.warehouseId
- a catalog Id
NotFoundException
- warehouseId
is not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WarehouseList getParentWarehouses(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- the Id
to queryNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfWarehouse(Id id, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a warehouse.id
- an Id
warehouseId
- the Id
of a catalog tru
e if this id
is an ancestor
of warehouseId,
false
otherwiseNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildWarehouses(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- a warehouse Id
true
if the warehouseId
has
children, false
otherwiseNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfWarehouse(Id id, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
warehouseId
- the Id
of a catalog true
if the id
is a child of
warehouseId,
false
otherwiseNotFoundException
- warehouseId
not
foundNullArgumentException
- id
or
warehouseId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildWarehouseIds(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given warehouse.warehouseId
- the Id
to queryNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WarehouseList getChildWarehouses(Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- the Id
to queryNotFoundException
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfWarehouse(Id id, Id warehouseId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a warehouse.id
- an Id
warehouseId
- the Id
of a catalog true
if the id
is a descendant
of the warehouseId,
false
otherwiseNotFoundException
- warehouseId
not
foundNullArgumentException
- id
or
warehouseId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getWarehouseNodeIds(Id warehouseId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- 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
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. WarehouseNode getWarehouseNodes(Id warehouseId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
warehouseId
- 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
- warehouseId
not
foundNullArgumentException
- warehouseId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.