public interface BallotLookupSession extends OsidSession
This session defines methods for retrieving ballots. A Ballot
is an arbitrary entity that may represent a person, place or thing
used to identify an object used in various services.
This lookup session defines several views:
Ballots
with the BallotAdminSession. The methods useFederatedPollsView() and
useIsolatedPollsView() behave as a radio group and one should be
selected before invoking any lookup methods.
Ballots may have an additional records indicated by their respective
record types. The record may not be accessed through a cast of the
Ballot.
| Modifier and Type | Method and Description |
|---|---|
boolean |
canLookupBallots()
Tests if this user can perform
Ballot lookups. |
Ballot |
getBallot(Id ballotId)
Gets the
Ballot specified by its Id. |
BallotList |
getBallots()
Gets all
Ballots. |
BallotList |
getBallotsByGenusType(Type ballotGenusType)
Gets a
BallotList corresponding to the given ballot
genus Type which does not include ballot of types
derived from the specified Type. |
BallotList |
getBallotsByIds(IdList ballotIds)
Gets a
BallotList corresponding to the given
IdList. |
BallotList |
getBallotsByParentGenusType(Type ballotGenusType)
Gets a
BallotList corresponding to the given ballot
genus Type and include any additional ballots with
genus types derived from the specified Type. |
BallotList |
getBallotsByProvider(Id resourceId)
Gets a
BallotList from the given provider. |
BallotList |
getBallotsByRecordType(Type ballotRecordType)
Gets a
BallotList containing the given ballot record
Type. |
BallotList |
getBallotsOnDate(DateTime from,
DateTime to)
Gets a
BallotList that are effective for the entire
given date range but not confined to the date range. |
Polls |
getPolls()
Gets the
Polls associated with this session. |
Id |
getPollsId()
Gets the
Polls Id associated with this
session. |
void |
useActiveBallotView()
Only active ballots are returned from methods in this session.
|
void |
useAnyStatusBallotView()
Borth active and inactive ballots are returned from methods in this
session.
|
void |
useComparativeBallotView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedPollsView()
Federates the view for methods in this session.
|
void |
useIsolatedPollsView()
Isolates the view for methods in this session.
|
void |
usePlenaryBallotView()
A complete view of the
Ballot returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getPollsId()
Polls Id associated with this
session. Polls Id associated with this sessionmandatory - This method must be implemented. Polls getPolls() throws OperationFailedException, PermissionDeniedException
Polls associated with this session. Polls associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canLookupBallots()
Ballot lookups. 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 lookup operations. false if lookup methods are not authorized,
true otherwisemandatory - This method must be implemented. void useComparativeBallotView()
mandatory - This method is must be implemented. void usePlenaryBallotView()
Ballot 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.mandatory - This method is must be implemented. void useFederatedPollsView()
mandatory - This method is must be implemented. void useIsolatedPollsView()
mandatory - This method is must be implemented. void useActiveBallotView()
mandatory - This method is must be implemented. void useAnyStatusBallotView()
mandatory - This method is must be implemented. Ballot getBallot(Id ballotId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ballot specified by its Id.
In plenary mode, the exact Id is found
or a NOT_FOUND results. Otherwise, the returned
Ballot may have a different Id than requested,
such as the case where a duplicate Id was assigned to a
Ballot and retained for compatibility.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.ballotId - the Id of the Ballot to
retrieve Ballot NotFoundException - no Ballot found with
the given Id NullArgumentException - ballotId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsByIds(IdList ballotIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
BallotList corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
ballots specified in the Id list, in the order of the
list, including duplicates, or an error results if an Id
in the supplied list is not found or inaccessible. Otherwise,
inaccessible Ballots may be omitted from the list and
may present the elements in any order including returning a unique
set.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.ballotIds - the list of Ids to retrieve Ballot listNotFoundException - an Id was not foundNullArgumentException - ballotIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsByGenusType(Type ballotGenusType) throws OperationFailedException, PermissionDeniedException
BallotList corresponding to the given ballot
genus Type which does not include ballot of types
derived from the specified Type.
In plenary mode, the returned list contains all known
ballots or an error results. Otherwise, the returned list may contain
only those ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.ballotGenusType - a ballot genus type Ballot listNullArgumentException - ballotGenusType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsByParentGenusType(Type ballotGenusType) throws OperationFailedException, PermissionDeniedException
BallotList corresponding to the given ballot
genus Type and include any additional ballots with
genus types derived from the specified Type.
In plenary mode, the returned list contains all known
ballots or an error results. Otherwise, the returned list may contain
only those ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.ballotGenusType - a ballot genus type Ballot listNullArgumentException - ballotGenusType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsByRecordType(Type ballotRecordType) throws OperationFailedException, PermissionDeniedException
BallotList containing the given ballot record
Type.
In plenary mode, the returned list contains all known ballots or an
error results. Otherwise, the returned list may contain only those
ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.ballotRecordType - a ballot record type Ballot listNullArgumentException - ballotRecordType
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsByProvider(Id resourceId) throws OperationFailedException, PermissionDeniedException
BallotList from the given provider.
In plenary mode, the returned list contains all known ballots or an
error results. Otherwise, the returned list may contain only those
ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.resourceId - a resource Id Ballot listNullArgumentException - resourceId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallotsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
BallotList that are effective for the entire
given date range but not confined to the date range.
In plenary mode, the returned list contains all known ballots or an
error results. Otherwise, the returned list may contain only those
ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned.from - s atsrting dateto - an ending date Ballot listInvalidArgumentException - from is
greater than to NullArgumentException - from or
to is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. BallotList getBallots() throws OperationFailedException, PermissionDeniedException
Ballots.
In plenary mode, the returned list contains all known ballots or an
error results. Otherwise, the returned list may contain only those
ballots that are accessible through this session.
In active mode, ballots are returned that are currently active. In any
status mode, active and inactive ballots are returned. Ballots OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.