public interface PollsHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Polls
objects. Each node in the hierarchy is a unique Polls.
The hierarchy may be traversed recursively to establish the tree
structure through getParentPolls()
and
getChildPolls().
To relate these Ids
to another
OSID, getPollsNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Polls
available in the Candidate 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 getParentPolls()
or getChildPolls()
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 |
canAccessPollsHierarchy()
Tests if this user can perform hierarchy queries.
|
PollsList |
getChildPolls(Id pollsId)
Gets the children of the given polls.
|
IdList |
getChildPollsIds(Id pollsId)
Gets the child
Ids of the given polls . |
PollsList |
getParentPolls(Id pollsId)
Gets the parents of the given polls.
|
IdList |
getParentPollsIds(Id pollsId)
Gets the parent
Ids of the given polls. |
Hierarchy |
getPollsHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getPollsHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getPollsNodeIds(Id pollsId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given polls.
|
PollsNode |
getPollsNodes(Id pollsId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given polls.
|
PollsList |
getRootPolls()
Gets the root polls in the polls hierarchy.
|
IdList |
getRootPollsIds()
Gets the root polls
Ids in this hierarchy. |
boolean |
hasChildPolls(Id pollsId)
Tests if a polls has any children.
|
boolean |
hasParentPolls(Id pollsId)
Tests if the
Polls has any parents. |
boolean |
isAncestorOfPolls(Id id,
Id pollsId)
Tests if an
Id is an ancestor of a polls. |
boolean |
isChildOfPolls(Id id,
Id pollsId)
Tests if a polls is a direct child of another.
|
boolean |
isDescendantOfPolls(Id id,
Id pollsId)
Tests if an
Id is a descendant of a polls. |
boolean |
isParentOfPolls(Id id,
Id pollsId)
Tests if an
Id is a direct parent of a polls. |
void |
useComparativePollsView()
The returns from the polls methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryPollsView()
A complete view of the
Polls returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getPollsHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getPollsHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessPollsHierarchy()
PERMISSION_DENIED.
This is intended as a hint to an
an application that may not offer traversal functions to unauthorized
users. false
if hierarchy traversal methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useComparativePollsView()
mandatory
- This method is must be implemented. void usePlenaryPollsView()
Polls
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 getRootPollsIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PollsList getRootPolls() 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 hasParentPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Polls
has any parents.pollsId
- the Id
of a polls true
if the polls has parents, false
otherwiseNotFoundException
- pollsId
is not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfPolls(Id id, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of a polls.id
- an Id
pollsId
- the Id
of a polls true
if this id
is a parent of
pollsId,
false
otherwiseNotFoundException
- pollsId
is not foundNullArgumentException
- id
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentPollsIds(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given polls.pollsId
- the Id
of a polls Ids
of the pollsNotFoundException
- pollsId
is not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PollsList getParentPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- the Id
to queryNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfPolls(Id id, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a polls.id
- an Id
pollsId
- the Id
of a polls true
if this id
is an ancestor
of pollsId,
false
otherwiseNotFoundException
- pollsId
is not foundNullArgumentException
- id
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- the Id
of a polls true
if the pollsId
has
children, false
otherwiseNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfPolls(Id id, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
pollsId
- the Id
of a polls true
if the id
is a child of
pollsId,
false
otherwiseNotFoundException
- pollsId
is not foundNullArgumentException
- id
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildPollsIds(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given polls .pollsId
- the Id
to queryNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PollsList getChildPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- the Id
to queryNotFoundException
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfPolls(Id id, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a polls.id
- an Id
pollsId
- the Id
of a polls true
if the id
is a descendant
of the pollsId,
false
otherwiseNotFoundException
- pollsId
is not foundNullArgumentException
- id
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getPollsNodeIds(Id pollsId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- 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
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PollsNode getPollsNodes(Id pollsId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
pollsId
- 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
- pollsId
not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.