public interface CookbookHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Cookbook
objects. Each node in the hierarchy is a unique
Cookbook.
The hierarchy may be traversed recursively to establish
the tree structure through getParentCookbooks()
and
getChildCookbooks().
To relate these Ids
to another
OSID, getCookbookNodes()
can be used for retrievals that
can be used for bulk lookups in other OSIDs. Any Cookbook
available in the Procedure 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 getParentCookbooks()
or getChildCookbooks()
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 |
canAccessCookbookHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildCookbookIds(Id cookbookId)
Gets the child
Ids of the given cookbook. |
CookbookList |
getChildCookbooks(Id cookbookId)
Gets the child cook books of the given
id. |
Hierarchy |
getCookbookHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getCookbookHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getCookbookNodeIds(Id cookbookId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given cookbook.
|
CookbookNode |
getCookbookNodes(Id cookbookId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given cookbook.
|
IdList |
getParentCookbookIds(Id cookbookId)
Gets the parent
Ids of the given cookbook. |
CookbookList |
getParentCookbooks(Id cookbookId)
Gets the parent cook books of the given
id. |
IdList |
getRootCookbookIds()
Gets the root cook book
Ids in this hierarchy. |
CookbookList |
getRootCookbooks()
Gets the root cook books in the cook book hierarchy.
|
boolean |
hasChildCookbooks(Id cookbookId)
Tests if a cook book has any children.
|
boolean |
hasParentCookbooks(Id cookbookId)
Tests if the
Cookbook has any parents. |
boolean |
isAncestorOfCookbook(Id id,
Id cookbookId)
Tests if an
Id is an ancestor of a cookbook. |
boolean |
isChildOfCookbook(Id id,
Id cookbookId)
Tests if a cook book is a direct child of another.
|
boolean |
isDescendantOfCookbook(Id id,
Id cookbookId)
Tests if an
Id is a descendant of a cookbook. |
boolean |
isParentOfCookbook(Id id,
Id cookbookId)
Tests if an
Id is a direct parent of cookbook. |
void |
useComparativeCookbookView()
The returns from the cook book methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryCookbookView()
A complete view of the
Cookbook returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCookbookHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getCookbookHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessCookbookHierarchy()
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 useComparativeCookbookView()
mandatory
- This method is must be implemented. void usePlenaryCookbookView()
Cookbook
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 getRootCookbookIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CookbookList getRootCookbooks() 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 hasParentCookbooks(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Cookbook
has any parents.cookbookId
- a cook book Id
true
if the cook book has parents, f
alse
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfCookbook(Id id, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of cookbook.id
- an Id
cookbookId
- the Id
of a cookbook true
if this id
is a parent of
cookbookId,
f alse
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- id
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentCookbookIds(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given cookbook.cookbookId
- a cook book Id
Ids
of the cookbookNotFoundException
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CookbookList getParentCookbooks(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
cookbookId
- the Id
of the Cookbook
to query id
NotFoundException
- an Cookbook
identified by Id is
not foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfCookbook(Id id, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a cookbook.id
- an Id
cookbookId
- the Id
of a cookbook tru
e if this id
is an ancestor
of cookbookId,
false
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- id
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildCookbooks(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
cookbookId
- a cook book Id
true
if the cookbookId
has
children, false
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfCookbook(Id id, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
cookbookId
- the Id
of a cookbook true
if the id
is a child of
cookbookId,
false
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- id
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildCookbookIds(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given cookbook.cookbookId
- the Id
to queryNotFoundException
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CookbookList getChildCookbooks(Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
cookbookId
- the Id
of the Cookbook
to query id
NotFoundException
- an Cookbook
identified by Id is
not foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfCookbook(Id id, Id cookbookId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a cookbook.id
- an Id
cookbookId
- the Id
of a cookbook true
if the id
is a descendant
of the cookbookId,
false
otherwiseNotFoundException
- cookbookId
is not
foundNullArgumentException
- id
or
cookbookId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getCookbookNodeIds(Id cookbookId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
cookbookId
- 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
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CookbookNode getCookbookNodes(Id cookbookId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
cookbookId
- 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
- cookbookId
is not
foundNullArgumentException
- cookbookId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.