Interface BallotConstrainerAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface BallotConstrainerAdminSession extends OsidSession

This session creates and removes ballot constrainers. The data for create and update is provided via the BallotConstrainerForm .

  • 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.
    • canCreateBallotConstrainer

      boolean canCreateBallotConstrainer()
      Tests if this user can create ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a BallotConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.
      Returns:
      false if BallotConstrainer creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateBallotConstrainerWithRecordTypes

      boolean canCreateBallotConstrainerWithRecordTypes(Type[] ballotConstrainerRecordTypes)
      Tests if this user can create a single BallotConstrainer using the desired record types. While VotingRulesManager.getBallotConstrainerRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific BallotConstrainer . Providing an empty array tests if a BallotConstrainer can be created with no records.
      Parameters:
      ballotConstrainerRecordTypes - array of ballot constrainer record types
      Returns:
      true if BallotConstrainer creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - ballotConstrainerRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getBallotConstrainerFormForCreate

      BallotConstrainerForm getBallotConstrainerFormForCreate(Type[] ballotConstrainerRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the ballot constrainer form for creating new ballot constrainers. A new form should be requested for each create transaction.
      Parameters:
      ballotConstrainerRecordTypes - array of ballot constrainer record types
      Returns:
      the ballot constrainer form
      Throws:
      NullArgumentException - ballotConstrainerRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createBallotConstrainer

      BallotConstrainer createBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException
      Creates a new BallotConstrainer .
      Parameters:
      ballotConstrainerForm - the form for this BallotConstrainer
      Returns:
      the new BallotConstrainer
      Throws:
      IllegalStateException - ballotConstrainerForm already used for a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - ballotConstrainerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - ballotConstrainerForm did not originate from getBallotConstrainerFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateBallotConstrainers

      boolean canUpdateBallotConstrainers()
      Tests if this user can update ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a BallotConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.
      Returns:
      false if BallotConstrainer modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getBallotConstrainerFormForUpdate

      BallotConstrainerForm getBallotConstrainerFormForUpdate(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the ballot constrainer form for updating an existing ballot constrainer. A new ballot constrainer form should be requested for each update transaction.
      Parameters:
      ballotConstrainerId - the Id of the BallotConstrainer
      Returns:
      the ballot constrainer form
      Throws:
      NotFoundException - ballotConstrainerId is not found
      NullArgumentException - ballotConstrainerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateBallotConstrainer

      void updateBallotConstrainer(BallotConstrainerForm ballotConstrainerForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing ballot constrainer.
      Parameters:
      ballotConstrainerForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - ballotConstrainerForm already used for an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - ballotConstrainerForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - ballotConstrainerForm did not originate from getBallotConstrainerFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteBallotConstrainers

      boolean canDeleteBallotConstrainers()
      Tests if this user can delete ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a BallotConstrainer will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.
      Returns:
      false if BallotConstrainer deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteBallotConstrainer

      void deleteBallotConstrainer(Id ballotConstrainerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a BallotConstrainer .
      Parameters:
      ballotConstrainerId - the Id of the BallotConstrainer to remove
      Throws:
      NotFoundException - ballotConstrainerId not found
      NullArgumentException - ballotConstrainerId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageBallotConstrainerAliases

      boolean canManageBallotConstrainerAliases()
      Tests if this user can manage Id aliases for ballot constrainers. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.
      Returns:
      false if BallotConstrainer aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasBallotConstrainer

      void aliasBallotConstrainer(Id ballotConstrainerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a BallotConstrainer for the purpose of creating compatibility. The primary Id of the BallotConstrainer is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another ballot constrainer. it is reassigned to the given ballot constrainer Id .
      Parameters:
      ballotConstrainerId - the Id of a BallotConstrainer
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - ballotConstrainerId not found
      NullArgumentException - ballotConstrainerId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.