Interface BallotAuthoringSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods for authoring ballots.
-
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, 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
-
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 is 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.
-