public interface CandidatePollsAssignmentSession extends OsidSession
This session provides methods to re-assign Candidates
to
Polls.
A Candidate
may map to multiple
Polls
objects and removing the last reference to a
Candidate
is the equivalent of deleting it. Each Polls
may have its own authorizations governing who is allowed to
operate on it.
Moving or adding a reference of a Candidate
to another
Polls
is not a copy operation (eg: does not change its
Id
).
Modifier and Type | Method and Description |
---|---|
void |
assignCandidateToPolls(Id candidateId,
Id pollsId)
Adds an existing
Candidate to a Polls. |
boolean |
canAssignCandidates()
Tests if this user can alter candidate/polls mappings.
|
boolean |
canAssignCandidatesToPolls(Id pollsId)
Tests if this user can alter candidate/polls mappings.
|
IdList |
getAssignablePollsIds(Id pollsId)
Gets a list of polls including and under the given polls node in which
any candidate can be assigned.
|
IdList |
getAssignablePollsIdsForCandidate(Id pollsId,
Id candidateId)
Gets a list of polls including and under the given polls node in which
a specific candidate can be assigned.
|
void |
unassignCandidateFromPolls(Id candidateId,
Id pollsId)
Removes a
Candidate from a Polls. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canAssignCandidates()
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users. false
if mapping is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canAssignCandidatesToPolls(Id pollsId)
PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer assignment operations to
unauthorized users.pollsId
- the Id
of the Polls
false
if mapping is not authorized, true
otherwiseNullArgumentException
- pollsId
is
null
mandatory
- This method must be implemented. IdList getAssignablePollsIds(Id pollsId) throws OperationFailedException
pollsId
- the Id
of the Polls
Ids
NullArgumentException
- pollsId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. IdList getAssignablePollsIdsForCandidate(Id pollsId, Id candidateId) throws OperationFailedException
pollsId
- the Id
of the Polls
candidateId
- the Id
of the Candidate
Ids
NullArgumentException
- pollsId
or
candidateId
is null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void assignCandidateToPolls(Id candidateId, Id pollsId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Candidate
to a Polls.
candidateId
- the Id
of the Candidate
pollsId
- the Id
of the Polls
AlreadyExistsException
- candidateId
is
already assigned to pollsId
NotFoundException
- candidateId
or
pollsId
not foundNullArgumentException
- candidateId
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void unassignCandidateFromPolls(Id candidateId, Id pollsId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Candidate
from a Polls.
candidateId
- the Id
of the Candidate
pollsId
- the Id
of the Polls
NotFoundException
- candidateId
or
pollsId
not found or candidateId
not assigned to pollsId
NullArgumentException
- candidateId
or
pollsId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.