Interface VoterAllocationAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session manages voter allocations. All voters are assumed to have
a default allocation form such that this session only provides an update
mechanism. The data for update is provided via the
VoterAllocationForm .
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can manage voter allocation.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.getVoterAllocationFormForUpdate(Id raceId, Id resourceId) Gets the voter allocation form.voidupdateVoterAllocation(VoterAllocationForm voterAllocationForm) Updates an allocation for a voter.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getPollsId
Id getPollsId()Gets thePollsIdassociated with this session.- Returns:
- the
Polls Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPolls
Gets thePollsassociated with this session.- Returns:
- the polls
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageVoterAllocations
boolean canManageVoterAllocations()Tests if this user can manage voter allocation. A return of true does not guarantee successful authorization. A return of false indicates that it is known allocation methods will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer allocation operations to an unauthorized user.- Returns:
falseif voter allocation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getVoterAllocationFormForUpdate
VoterAllocationForm getVoterAllocationFormForUpdate(Id raceId, Id resourceId) throws NotFoundException, OperationFailedException Gets the voter allocation form. A new form should be requested for each update transaction.- Parameters:
raceId- theIdof theRaceresourceId- theIdof theVoter- Returns:
- the voter allocation form
- Throws:
NotFoundException-raceIdorresourceIdis not foundNullArgumentException-raceIdorresourceIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateVoterAllocation
void updateVoterAllocation(VoterAllocationForm voterAllocationForm) throws OperationFailedException, PermissionDeniedException Updates an allocation for a voter.- Parameters:
voterAllocationForm- the form containing the elements to be updated- Throws:
IllegalStateException-voterAllocationFormalready used in a create transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-voterAllocationFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-voterAllocationFormdid not originate fromgetVoterAllocationFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-