Interface VoterAllocationAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface VoterAllocationAdminSession extends 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 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.
    • 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer allocation operations to an unauthorized user.
      Returns:
      false if voter allocation is not authorized, true otherwise
      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 - the Id of the Race
      resourceId - the Id of the Voter
      Returns:
      the voter allocation form
      Throws:
      NotFoundException - raceId or resourceId is not found
      NullArgumentException - raceId or resourceId is null
      OperationFailedException - 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 - voterAllocationForm already used in a create transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - voterAllocationForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - voterAllocationForm did not originate from getVoterAllocationFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.