public interface StoreHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Store
objects. Each node in the hierarchy is a unique Store.
The hierarchy may be traversed recursively to establish the tree
structure through getParentStores()
and
getChildStores().
To relate these Ids
to another
OSID, getStoreNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Store
available in the Order 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 getParentStores()
or getChildStores()
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 |
canAccessStoreHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildStoreIds(Id storeId)
Gets the child
Ids of the given store. |
StoreList |
getChildStores(Id storeId)
Gets the child stores of the given
id. |
IdList |
getParentStoreIds(Id storeId)
Gets the parent
Ids of the given store. |
StoreList |
getParentStores(Id storeId)
Gets the parent stores of the given
id. |
IdList |
getRootStoreIds()
Gets the root store
Ids in this hierarchy. |
StoreList |
getRootStores()
Gets the root stores in the store hierarchy.
|
Hierarchy |
getStoreHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getStoreHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getStoreNodeIds(Id storeId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given store.
|
StoreNode |
getStoreNodes(Id storeId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given store.
|
boolean |
hasChildStores(Id storeId)
Tests if a store has any children.
|
boolean |
hasParentStores(Id storeId)
Tests if the
Store has any parents. |
boolean |
isAncestorOfStore(Id id,
Id storeId)
Tests if an
Id is an ancestor of a store. |
boolean |
isChildOfStore(Id id,
Id storeId)
Tests if a store is a direct child of another.
|
boolean |
isDescendantOfStore(Id id,
Id storeId)
Tests if an
Id is a descendant of a store. |
boolean |
isParentOfStore(Id id,
Id storeId)
Tests if an
Id is a direct parent of store. |
void |
useComparativeStoreView()
The returns from the store methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryStoreView()
A complete view of the
Store returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getStoreHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getStoreHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessStoreHierarchy()
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 useComparativeStoreView()
mandatory
- This method is must be implemented. void usePlenaryStoreView()
Store
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 getRootStoreIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StoreList getRootStores() throws OperationFailedException, PermissionDeniedException
Ids
are known to the
hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root node or child of another node.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentStores(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Store
has any parents.storeId
- a store Id
true
if the store has parents, f alse
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfStore(Id id, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of store.id
- an Id
storeId
- the Id
of a store true
if this id
is a parent of
storeId,
f alse
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- id
or
storeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentStoreIds(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given store.storeId
- a store Id
Ids
of the storeNotFoundException
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StoreList getParentStores(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
storeId
- the Id
of the Store
to
query id
NotFoundException
- a Store
identified
by Id is
not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfStore(Id id, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a store.id
- an Id
storeId
- the Id
of a store tru
e if this id
is an ancestor
of storeId,
false
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- id
or
storeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildStores(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
storeId
- a store Id
true
if the storeId
has
children, false
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfStore(Id id, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
storeId
- the Id
of a store true
if the id
is a child of
storeId,
false
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- id
or
storeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildStoreIds(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given store.storeId
- the Id
to queryNotFoundException
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StoreList getChildStores(Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
storeId
- the Id
of the Store
to
query id
NotFoundException
- a Store
identified
by Id is
not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfStore(Id id, Id storeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a store.id
- an Id
storeId
- the Id
of a store true
if the id
is a descendant
of the storeId,
false
otherwiseNotFoundException
- storeId
is not foundNullArgumentException
- id
or
storeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getStoreNodeIds(Id storeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
storeId
- 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
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. StoreNode getStoreNodes(Id storeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
storeId
- 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
- storeId
is not foundNullArgumentException
- storeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.