public interface CandidatePollsSession extends OsidSession
This session provides methods to retrieve Candidate
to
Polls
mappings. A Candidate
may appear in
multiple Polls.
Each Polls
may have its own
authorizations governing who is allowed to look at it.
This lookup session defines several views:
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupCandidatePollsMappings()
Tests if this user can perform lookups of candidate/polls mappings.
|
IdList |
getCandidateIdsByPolls(Id pollsId)
Gets the list of
Candidate Ids
associated with a Polls. |
IdList |
getCandidateIdsByPolls(IdList pollsIds)
Gets the list of
Candidate Ids corresponding to a list
of Polls objects. |
CandidateList |
getCandidatesByPolls(Id pollsId)
Gets the list of
Candidates associated with a
Polls. |
CandidateList |
getCandidatesByPolls(IdList pollsIds)
Gets the list of
Candidates corresponding to a list of
Polls. |
PollsList |
getPollsByCandidate(Id candidateId)
Gets the list of
Polls objects mapped to a
Candidate. |
IdList |
getPollsIdsByCandidate(Id candidateId)
Gets the list of
Polls Ids mapped to a
Candidate. |
void |
useComparativePollsView()
The returns from the lookup 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
Candidate and Polls
returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
void useComparativePollsView()
mandatory
- This method is must be implemented. void usePlenaryPollsView()
Candidate
and 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. boolean canLookupCandidatePollsMappings()
PERMISSION_DENIED.
This is intended as
a hint to an application that may opt not to offer lookup operations
to unauthorized users. false
if looking up mappings is not authorized,
true
otherwisemandatory
- This method must be implemented. IdList getCandidateIdsByPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Candidate
Ids
associated with a Polls.
pollsId
- Id
of a Polls
Ids
NotFoundException
- pollsId
is not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByPolls(Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Candidates
associated with a
Polls.
pollsId
- Id
of a Polls
NotFoundException
- pollsId
is not foundNullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. IdList getCandidateIdsByPolls(IdList pollsIds) throws OperationFailedException, PermissionDeniedException
Candidate Ids
corresponding to a list
of Polls
objects.pollsIds
- list of polls Ids
Ids
NullArgumentException
- pollsIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByPolls(IdList pollsIds) throws OperationFailedException, PermissionDeniedException
Candidates
corresponding to a list of
Polls.
pollsIds
- list of polls Ids
NullArgumentException
- pollsIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. IdList getPollsIdsByCandidate(Id candidateId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Polls
Ids
mapped to a
Candidate.
candidateId
- Id
of a Candidate
Ids
NotFoundException
- candidateId
is not
foundNullArgumentException
- candidateId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PollsList getPollsByCandidate(Id candidateId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Polls
objects mapped to a
Candidate.
candidateId
- Id
of a Candidate
NotFoundException
- candidateId
is not
foundNullArgumentException
- candidateId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.