Interface VoteNotificationSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface VoteNotificationSession extends OsidSession

This session defines methods to receive asynchronous notifications on adds/changes to votes. This session is intended for consumers needing to synchronize their state with this service without the use of polling. Notifications are cancelled when this session is closed.

The views defined in this session correspond to the views in the VoteLookupSession .

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

      boolean canRegisterForVoteNotifications()
      Tests if this user can register for Vote notifications. 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer notification operations.
      Returns:
      false if notification methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useFederatedPollsView

      void useFederatedPollsView()
      Federates the view for methods in this session. A federated view will include notifications for votes in polls which are children of this polls in the polls hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedPollsView

      void useIsolatedPollsView()
      Isolates the view for methods in this session. An isolated view restricts notifications for votes in this polls only.
      Compliance:
      mandatory - This method is must be implemented.
    • reliableVoteNotifications

      void reliableVoteNotifications()
      Reliable notifications are desired. In reliable mode, notifications are to be acknowledged using acknowledgeVoteNotification() .
      Compliance:
      mandatory - This method is must be implemented.
    • unreliableVoteNotifications

      void unreliableVoteNotifications()
      Unreliable notifications are desired. In unreliable mode, notifications do not need to be acknowledged.
      Compliance:
      mandatory - This method is must be implemented.
    • acknowledgeVoteNotification

      void acknowledgeVoteNotification(Id notificationId) throws OperationFailedException, PermissionDeniedException
      Acknowledge a vote notification.
      Parameters:
      notificationId - the Id of the notification
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewVotes

      void registerForNewVotes() throws OperationFailedException, PermissionDeniedException
      Register for notifications of new votes. VoteReceiver.newVotes() is invoked when a new vote is created.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewVotesForBallot

      void registerForNewVotesForBallot(Id ballotId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new votes for the given ballot. VoteReceiver.newVotes() is invoked when a new vote is created.
      Parameters:
      ballotId - the Id of the Ballot to monitor
      Throws:
      NullArgumentException - ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewVotesForRace

      void registerForNewVotesForRace(Id raceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new votes for the given race. VoteReceiver.newVotes() is invoked when a new vote is created.
      Parameters:
      raceId - the Id of the Race to monitor
      Throws:
      NullArgumentException - raceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewVotesForCandidate

      void registerForNewVotesForCandidate(Id candidateId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new votes for the given candidate. VoteReceiver.newVotes() is invoked when a new vote is created.
      Parameters:
      candidateId - the Id of the Candidate to monitor
      Throws:
      NullArgumentException - candidateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForNewVotesForVoter

      void registerForNewVotesForVoter(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of new votes for the given voter. VoteReceiver.newVotes() is invoked when a new vote is created.
      Parameters:
      resourceId - the Id of the voter to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVotes

      void registerForChangedVotes() throws OperationFailedException, PermissionDeniedException
      Registers for notification of updated votes. VoteReceiver.ChangedVotes() is invoked when a vote is changed.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVotesForBallot

      void registerForChangedVotesForBallot(Id ballotId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated votes for the given ballot. VoteReceiver.changedVotes() is invoked when a vote is changed.
      Parameters:
      ballotId - the Id of the Ballot to monitor
      Throws:
      NullArgumentException - ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVotesForRace

      void registerForChangedVotesForRace(Id raceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated votes for the given race. VoteReceiver.changedVotes() is invoked when a vote is changed.
      Parameters:
      raceId - the Id of the Race to monitor
      Throws:
      NullArgumentException - raceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVotesForCandidate

      void registerForChangedVotesForCandidate(Id candidateId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated votes for the given candidate. VoteReceiver.changedVotes() is invoked when a vote is changed.
      Parameters:
      candidateId - the Id of the Candidate to monitor
      Throws:
      NullArgumentException - candidateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVotesForVoter

      void registerForChangedVotesForVoter(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated votes for the given voter. VoteReceiver.changedVotes() is invoked when a vote is changed.
      Parameters:
      resourceId - the Id of the voter to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForChangedVote

      void registerForChangedVote(Id voteId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of updated votes for the given vote. VoteReceiver.changedVotes() is invoked when a vote is changed.
      Parameters:
      voteId - the Id of the Vote to monitor
      Throws:
      NullArgumentException - voteId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVotes

      void registerForDeletedVotes() throws OperationFailedException, PermissionDeniedException
      Registers for notification of deleted votes. VoteReceiver.deletedVotes() is invoked when a vote is deleted.
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVotesForBallot

      void registerForDeletedVotesForBallot(Id ballotId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted votes for the given ballot. VoteReceiver.deletedVotes() is invoked when a vote is deleted.
      Parameters:
      ballotId - the Id of the Ballot to monitor
      Throws:
      NullArgumentException - ballotId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVotesForRace

      void registerForDeletedVotesForRace(Id raceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted votes for the given race. VoteReceiver.deletedVotes() is invoked when a vote is deleted.
      Parameters:
      raceId - the Id of the Race to monitor
      Throws:
      NullArgumentException - raceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVotesForCandidate

      void registerForDeletedVotesForCandidate(Id candidateId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted votes for the given candidate. VoteReceiver.deletedVotes() is invoked when a vote is deleted.
      Parameters:
      candidateId - the Id of the Candidate to monitor
      Throws:
      NullArgumentException - candidateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVotesForVoter

      void registerForDeletedVotesForVoter(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Register for notifications of deleted votes for the given voter. VoteReceiver.deletedVotes() is invoked when a vote is deleted.
      Parameters:
      resourceId - the Id of the voter to monitor
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • registerForDeletedVote

      void registerForDeletedVote(Id voteId) throws OperationFailedException, PermissionDeniedException
      Registers for notification of a deleted vote. VoteReceiver.changedVotes() is invoked when the specified vote is deleted.
      Parameters:
      voteId - the Id of the Vote to monitor
      Throws:
      NullArgumentException - voteId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.