Interface BallotConstrainerRuleApplicationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BallotConstrainerRuleApplicationSession extends 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 Details

    • getPollsId

      Id getPollsId()
      Gets the Polls Id associated with this session.
      Returns:
      the Polls Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPolls

      Gets the Polls associated with this session.
      Returns:
      the polls
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer lookup operations to unauthorized users.
      Returns:
      false if mapping is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • assignBallotConstrainerToBallot

      void assignBallotConstrainerToBallot(Id ballotConstrainerId, Id ballotId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an existing BallotConstrainer to a Ballot .
      Parameters:
      ballotConstrainerId - the Id of the BallotConstrainer
      ballotId - the Id of the Ballot
      Throws:
      AlreadyExistsException - ballotConstrainerId is already applied to ballotId
      NotFoundException - ballotConstrainerId or ballotId not found
      NullArgumentException - ballotConstrainerId or ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • unassignBallotConstrainerFromBallot

      void unassignBallotConstrainerFromBallot(Id ballotConstrainerId, Id ballotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Removes a BallotConstrainer from a Ballot .
      Parameters:
      ballotConstrainerId - the Id of the BallotConstrainer
      ballotId - the Id of the Ballot
      Throws:
      NotFoundException - ballotConstrainerId or ballotId not found or ballotConstrainerId not applied to ballotId
      NullArgumentException - ballotConstrainerId or ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canSequenceBallotConstrainers

      boolean canSequenceBallotConstrainers()
      Tests if this user can order BallotConstrainers . A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.
      Returns:
      false if BallotConstrainer ordering is not authorized, true otherwise
      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 - the Id of a BallotConstrainer
      ballotId - the Id of a Ballot
      referenceId - the reference ballot constrainer Id
      Throws:
      NotFoundException - ballotConstrainerId, ballotId , or referenceId not found or, ballotConstrainerId or referenceId not related to ballotId
      NullArgumentException - ballotConstrainerId, ballotId , or referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - the Id of a BallotConstrainer
      ballotId - the Id of a Ballot
      referenceId - the reference ballot constrainer Id
      Throws:
      NotFoundException - ballotConstrainerId, ballotId , or referenceId not found or, ballotConstrainerId or referenceId not related to ballotId
      NullArgumentException - ballotConstrainerId, ballotId , or referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - the Ids for a set of BallotConstrainer
      ballotId - the Id of a Ballot
      Throws:
      NotFoundException - ballotId not found or, a ballotConstrainerId not related to ballotId
      NullArgumentException - ballotConstrainerIds or ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.