Interface VoteNotificationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionvoidacknowledgeVoteNotification(Id notificationId) Acknowledge a vote notification.booleanTests if this user can register forVotenotifications.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.voidregisterForChangedVote(Id voteId) Register for notifications of updated votes for the given vote.voidRegisters for notification of updated votes.voidregisterForChangedVotesForBallot(Id ballotId) Register for notifications of updated votes for the given ballot.voidregisterForChangedVotesForCandidate(Id candidateId) Register for notifications of updated votes for the given candidate.voidregisterForChangedVotesForRace(Id raceId) Register for notifications of updated votes for the given race.voidregisterForChangedVotesForVoter(Id resourceId) Register for notifications of updated votes for the given voter.voidregisterForDeletedVote(Id voteId) Registers for notification of a deleted vote.voidRegisters for notification of deleted votes.voidregisterForDeletedVotesForBallot(Id ballotId) Register for notifications of deleted votes for the given ballot.voidregisterForDeletedVotesForCandidate(Id candidateId) Register for notifications of deleted votes for the given candidate.voidregisterForDeletedVotesForRace(Id raceId) Register for notifications of deleted votes for the given race.voidregisterForDeletedVotesForVoter(Id resourceId) Register for notifications of deleted votes for the given voter.voidRegister for notifications of new votes.voidregisterForNewVotesForBallot(Id ballotId) Register for notifications of new votes for the given ballot.voidregisterForNewVotesForCandidate(Id candidateId) Register for notifications of new votes for the given candidate.voidregisterForNewVotesForRace(Id raceId) Register for notifications of new votes for the given race.voidregisterForNewVotesForVoter(Id resourceId) Register for notifications of new votes for the given voter.voidReliable notifications are desired.voidUnreliable notifications are desired.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.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.
-
canRegisterForVoteNotifications
boolean canRegisterForVoteNotifications()Tests if this user can register forVotenotifications. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer notification operations.- Returns:
falseif notification methods are not authorized,trueotherwise- 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 usingacknowledgeVoteNotification().- 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- theIdof the notification- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForNewVotes
Register for notifications of new votes.VoteReceiver.newVotes()is invoked when a new vote is created.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theBallotto monitor- Throws:
NullArgumentException-ballotId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theRaceto monitor- Throws:
NullArgumentException-raceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theCandidateto monitor- Throws:
NullArgumentException-candidateId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof the voter to monitor- Throws:
NullArgumentException-resourceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedVotes
Registers for notification of updated votes.VoteReceiver.ChangedVotes()is invoked when a vote is changed.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theBallotto monitor- Throws:
NullArgumentException-ballotId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theRaceto monitor- Throws:
NullArgumentException-raceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theCandidateto monitor- Throws:
NullArgumentException-candidateId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof the voter to monitor- Throws:
NullArgumentException-resourceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForChangedVote
Register for notifications of updated votes for the given vote.VoteReceiver.changedVotes()is invoked when a vote is changed.- Parameters:
voteId- theIdof theVoteto monitor- Throws:
NullArgumentException-voteId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedVotes
Registers for notification of deleted votes.VoteReceiver.deletedVotes()is invoked when a vote is deleted.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theBallotto monitor- Throws:
NullArgumentException-ballotId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theRaceto monitor- Throws:
NullArgumentException-raceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof theCandidateto monitor- Throws:
NullArgumentException-candidateId is nullOperationFailedException- unable to complete requestPermissionDeniedException- 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- theIdof the voter to monitor- Throws:
NullArgumentException-resourceId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
registerForDeletedVote
Registers for notification of a deleted vote.VoteReceiver.changedVotes()is invoked when the specified vote is deleted.- Parameters:
voteId- theIdof theVoteto monitor- Throws:
NullArgumentException-voteId is nullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-