Interface BallotConstrainerRuleApplicationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods to apply BallotConstrainers to
Ballots . A Ballot with multiple
BallotConstrainers means any positive rule evaluation across the
constrainers result in an accessible Ballot .
-
Method Summary
Modifier and TypeMethodDescriptionvoidassignBallotConstrainerToBallot(Id ballotConstrainerId, Id ballotId) Adds an existingBallotConstrainerto aBallot.booleanTests if this user can alter ballot constrainer/ballot mappings.booleanTests if this user can orderBallotConstrainers.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.voidmoveBallotConstrainerAhead(Id ballotConstrainerId, Id ballotId, Id referenceId) Reorders ballot constrainer for a ballot by moving the specified ballot constrainer in front of a reference ballot constrainer.voidmoveBallotConstrainerBehind(Id ballotConstrainerId, Id ballotId, Id referenceId) Reorders ballot constrainer for a ballot by moving the specified ballot constrainer behind a reference ballot constrainer.voidorderBallotConstrainers(Id[] ballotConstrainerIds, Id ballotId) Reorders a set of ballot constrainers for a ballotvoidunassignBallotConstrainerFromBallot(Id ballotConstrainerId, Id ballotId) Removes aBallotConstrainerfrom aBallot.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.
-
canAssignBallotConstrainers
boolean canAssignBallotConstrainers()Tests if this user can alter ballot constrainer/ballot mappings. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping 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 mapping is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
assignBallotConstrainerToBallot
void assignBallotConstrainerToBallot(Id ballotConstrainerId, Id ballotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds an existingBallotConstrainerto aBallot.- Parameters:
ballotConstrainerId- theIdof theBallotConstrainerballotId- theIdof theBallot- Throws:
AlreadyExistsException-ballotConstrainerIdis already applied toballotIdNotFoundException-ballotConstrainerIdorballotIdnot foundNullArgumentException-ballotConstrainerIdorballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
unassignBallotConstrainerFromBallot
void unassignBallotConstrainerFromBallot(Id ballotConstrainerId, Id ballotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes aBallotConstrainerfrom aBallot.- Parameters:
ballotConstrainerId- theIdof theBallotConstrainerballotId- theIdof theBallot- Throws:
NotFoundException-ballotConstrainerIdorballotIdnot found orballotConstrainerIdnot applied toballotIdNullArgumentException-ballotConstrainerIdorballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canSequenceBallotConstrainers
boolean canSequenceBallotConstrainers()Tests if this user can orderBallotConstrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.- Returns:
falseifBallotConstrainerordering is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
moveBallotConstrainerAhead
void moveBallotConstrainerAhead(Id ballotConstrainerId, Id ballotId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders ballot constrainer for a ballot by moving the specified ballot constrainer in front of a reference ballot constrainer.- Parameters:
ballotConstrainerId- theIdof aBallotConstrainerballotId- theIdof aBallotreferenceId- the reference ballot constrainerId- Throws:
NotFoundException-ballotConstrainerId, ballotId, orreferenceIdnot found or,ballotConstrainerIdorreferenceIdnot related toballotIdNullArgumentException-ballotConstrainerId, ballotId, orreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
moveBallotConstrainerBehind
void moveBallotConstrainerBehind(Id ballotConstrainerId, Id ballotId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders ballot constrainer for a ballot by moving the specified ballot constrainer behind a reference ballot constrainer.- Parameters:
ballotConstrainerId- theIdof aBallotConstrainerballotId- theIdof aBallotreferenceId- the reference ballot constrainerId- Throws:
NotFoundException-ballotConstrainerId, ballotId, orreferenceIdnot found or,ballotConstrainerIdorreferenceIdnot related toballotIdNullArgumentException-ballotConstrainerId, ballotId, orreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
orderBallotConstrainers
void orderBallotConstrainers(Id[] ballotConstrainerIds, Id ballotId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders a set of ballot constrainers for a ballot- Parameters:
ballotConstrainerIds- theIdsfor a set ofBallotConstrainerballotId- theIdof aBallot- Throws:
NotFoundException-ballotIdnot found or, aballotConstrainerIdnot related toballotIdNullArgumentException-ballotConstrainerIdsorballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-