Interface BallotAuthoringSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods for authoring ballots.
Like all OsidSessions, BallotAuthoringSessions are
dedicated to single processing threads and a single authenticated user.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a race to this ballot.booleanTests if this user can perform author ballots.Gets theBallotassociated with this session.Gets theBallotIdassociated with this session.getRaces()Gets the races on this ballot.voidMoves an existing race to follow another race in this ballot.voidorderRaces(Id[] raceIds) Sequences existing races on this ballot.voidremoveRace(Id raceId) Removes aRacefrom this ballot.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatTypes, getLocales, isAuthenticated, startTransaction, supportsTransactions
-
Method Details
-
getBallotId
Id getBallotId()Gets theBallotIdassociated with this session.- Returns:
- the
Ballot Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getBallot
Gets theBallotassociated with this session.- Returns:
- the
Ballotassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canAuthorBallots
boolean canAuthorBallots()Tests if this user can perform author ballots. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.- Returns:
falseif lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRaces
Gets the races on this ballot.- Returns:
- the races
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addRace
void addRace(Id raceId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a race to this ballot.- Parameters:
raceId- theIdof theRace- Throws:
AlreadyExistsException-raceIdalready in ballotNotFoundException-raceIdnot foundNullArgumentException-raceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
removeRace
void removeRace(Id raceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aRacefrom this ballot.- Parameters:
raceId- theIdof theRace- Throws:
NotFoundException-raceIdnot in ballotNullArgumentException-raceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
moveRace
void moveRace(Id raceId, Id precedingRaceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Moves an existing race to follow another race in this ballot.- Parameters:
raceId- theIdof aRaceprecedingRaceId- theIdof a precedingRacein the sequence- Throws:
NotFoundException-raceIdorprecedingRaceIdis not foundNullArgumentException-raceIdorprecedingRaceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-
orderRaces
void orderRaces(Id[] raceIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Sequences existing races on this ballot.- Parameters:
raceIds- theIdof theRaces- Throws:
NotFoundException- araceIdwas not foundNullArgumentException-raceIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure occurred- Compliance:
mandatory- This method must be implemented.
-