Interface VoteLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session provides methods for looking up votes.
This session defines views that offer differing behaviors when retrieving multiple objects.
- comparative view: elements may be silently omitted or re-ordered
- plenary view: provides a complete set or is an error votes
- isolated polls view: All vote methods in this session operate,
retrieve and pertain to votes defined explicitly in the current polls.
Using an isolated view is useful for managing votes with the
VoteAdminSession. - federated polls view: All vote methods in this session operate, retrieve and pertain to all votes defined in these polls and any other catalogs implicitly available in this polls through polls inheritence.
- effective vote view: All vote lookup methods return votes where the current date falls in between the effective dates inclusive.
- any effective vote view: Votes of any effective date are returned from methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can access votes.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.Gets aVotespecified by itsId.getVotes()Gets all votes.getVotesByGenusType(Type voteGenusType) Gets the votes for the given vote genus type.getVotesByIds(IdList voteIds) Gets aVoteListcorresponding to the givenIdList.getVotesByParentGenusType(Type voteGenusType) Gets the votes for the given vote genus type and include any votes with a genus type derived from the specified genus type.getVotesByRecordType(Type voteRecordType) Gets the votes for the given vote record type.getVotesForBallot(Id ballotId) Gets the votes cast in the given ballot.getVotesForBallotOnDate(Id ballotId, DateTime from, DateTime to) Gets a list of votes in a ballot effective during the entire given date range inclusive but not confined to the date range.getVotesForCandidate(Id candidateId) Gets theVotesfor a candidate.getVotesForCandidateOnDate(Id candidateId, DateTime from, DateTime to) Gets a list of votes for a candidate effective during the entire given date range inclusive but not confined to the date range.getVotesForRace(Id raceId) Gets the votes cast in the given race.getVotesForRaceOnDate(Id raceId, DateTime from, DateTime to) Gets a list of votes in a race effective during the entire given date range inclusive but not confined to the date range.getVotesForVoter(Id resourceId) Gets the votes cast by the given voter.getVotesForVoterAndBallot(Id resourceId, Id ballotId) Gets the votes cast by the given voter and ballot.getVotesForVoterAndBallotOnDate(Id resourceId, Id ballotId, DateTime from, DateTime to) Gets a list of votes for a voter and ballot effective during the entire given date range inclusive but not confined to the date range.getVotesForVoterAndCandidate(Id resourceId, Id candidateId) Gets the votes cast by the given voter and candidate.getVotesForVoterAndCandidateOnDate(Id resourceId, Id candidateId, DateTime from, DateTime to) Gets a list of votes for a voter and candidate effective during the entire given date range inclusive but not confined to the date range.getVotesForVoterAndRace(Id resourceId, Id raceId) Gets the votes cast by the given voter and race.getVotesForVoterAndRaceOnDate(Id resourceId, Id raceId, DateTime from, DateTime to) Gets a list of votes for a voter and race effective during the entire given date range inclusive but not confined to the date range.getVotesForVoterOnDate(Id resourceId, DateTime from, DateTime to) Gets a list of votes for a voter effective during the entire given date range inclusive but not confined to the date range.getVotesOnDate(DateTime from, DateTime to) Gets a list of votes effective during the entire given date range inclusive but not confined to the date range.voidAll votes of any effective dates are returned by methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidOnly votes whose effective dates are current are returned by methods in this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of the vote returns is desired.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
Pollsassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupVotes
boolean canLookupVotes()Tests if this user can access votes. 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 vote operations.- Returns:
falseif voting methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeVoteView
void useComparativeVoteView()The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.- Compliance:
mandatory- This method is must be implemented.
-
usePlenaryVoteView
void usePlenaryVoteView()A complete view of the vote returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.- Compliance:
mandatory- This method is must be implemented.
-
useFederatedPollsView
void useFederatedPollsView()Federates the view for methods in this session. A federated view will include 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 votes to these polls only.- Compliance:
mandatory- This method is must be implemented.
-
useEffectiveVoteView
void useEffectiveVoteView()Only votes whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveVoteView
void useAnyEffectiveVoteView()All votes of any effective dates are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getVote
Vote getVote(Id voteId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aVotespecified by itsId.- Parameters:
voteId-Idof theVote- Returns:
- the vote
- Throws:
NotFoundException-voteIdnot foundNullArgumentException-voteIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method is must be implemented.
-
getVotesByIds
VoteList getVotesByIds(IdList voteIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aVoteListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the votes specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleVotesmay be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
voteIds- the list ofIdsto retrieve- Returns:
- the returned
Votelist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-voteIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesByGenusType
VoteList getVotesByGenusType(Type voteGenusType) throws OperationFailedException, PermissionDeniedException Gets the votes for the given vote genus type. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
voteGenusType- a vote genus type- Returns:
- the votes
- Throws:
NullArgumentException-voteGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesByParentGenusType
VoteList getVotesByParentGenusType(Type voteGenusType) throws OperationFailedException, PermissionDeniedException Gets the votes for the given vote genus type and include any votes with a genus type derived from the specified genus type. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
voteGenusType- a vote genus type- Returns:
- the votes
- Throws:
NullArgumentException-voteGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesByRecordType
VoteList getVotesByRecordType(Type voteRecordType) throws OperationFailedException, PermissionDeniedException Gets the votes for the given vote record type. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
voteRecordType- a vote record type- Returns:
- the votes
- Throws:
NullArgumentException-voteRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesOnDate
VoteList getVotesOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
from- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoter
Gets the votes cast by the given voter. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoter- Returns:
- the votes
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterOnDate
VoteList getVotesForVoterOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes for a voter effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoterfrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForCandidate
VoteList getVotesForCandidate(Id candidateId) throws OperationFailedException, PermissionDeniedException Gets theVotesfor a candidate. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
candidateId-Idof aCandidate- Returns:
- the votes
- Throws:
NullArgumentException-candidateIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForCandidateOnDate
VoteList getVotesForCandidateOnDate(Id candidateId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes for a candidate effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
candidateId-Idof aCandidatefrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-candidateId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndCandidate
VoteList getVotesForVoterAndCandidate(Id resourceId, Id candidateId) throws OperationFailedException, PermissionDeniedException Gets the votes cast by the given voter and candidate. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVotercandidateId-Idof aCandidate- Returns:
- the votes
- Throws:
NullArgumentException-resourceIdorcandidateIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndCandidateOnDate
VoteList getVotesForVoterAndCandidateOnDate(Id resourceId, Id candidateId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes for a voter and candidate effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVotercandidateId-Idof aCandidatefrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, candidateId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForRace
Gets the votes cast in the given race. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
raceId-Idof aRace- Returns:
- the votes
- Throws:
NullArgumentException-ballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForRaceOnDate
VoteList getVotesForRaceOnDate(Id raceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes in a race effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
raceId-Idof aRacefrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-raceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndRace
VoteList getVotesForVoterAndRace(Id resourceId, Id raceId) throws OperationFailedException, PermissionDeniedException Gets the votes cast by the given voter and race. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoterraceId-Idof aRace- Returns:
- the votes
- Throws:
NullArgumentException-resourceIdorraceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndRaceOnDate
VoteList getVotesForVoterAndRaceOnDate(Id resourceId, Id raceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes for a voter and race effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoterraceId-Idof aRacefrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, raceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForBallot
Gets the votes cast in the given ballot. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
ballotId-Idof aBallot- Returns:
- the votes
- Throws:
NullArgumentException-ballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForBallotOnDate
VoteList getVotesForBallotOnDate(Id ballotId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes in a ballot effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
ballotId-Idof aBallotfrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-ballotId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndBallot
VoteList getVotesForVoterAndBallot(Id resourceId, Id ballotId) throws OperationFailedException, PermissionDeniedException Gets the votes cast by the given voter and ballot. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoterballotId-Idof aBallot- Returns:
- the votes
- Throws:
NullArgumentException-resourceIdorballotIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotesForVoterAndBallotOnDate
VoteList getVotesForVoterAndBallotOnDate(Id resourceId, Id ballotId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of votes for a voter and ballot effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known votes or an error results. Otherwise, the returned list may contain only those votes that are accessible through this session. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Parameters:
resourceId-Idof aVoterballotId-Idof aBallotfrom- start of date rangeto- end of date range- Returns:
- the returned
Votelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, ballotId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getVotes
Gets all votes. In plenary mode, the returned list contains all of the votes mapped to the candidateIdor an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessible votes may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, votes are returned that are currently effective. In any effective mode, effective votes and those currently expired are returned.- Returns:
- the votes
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-