Interface BallotSearchSession
- All Superinterfaces:
AutoCloseable, BallotQuerySession, Closeable, OsidSession, OsidSession
This session provides methods for searching among Ballot
objects. The search query is constructed using the BallotQuery .
getBallotsByQuery() is the basic search method and returns a list
of Ballots . A more advanced search may be performed with
getBallotsBySearch() .It accepts an BallotSearch in addition to
the query for the purpose of specifying additional options affecting the
entire search, such as ordering. getBallotsBySearch() returns an
BallotSearchResults that can be used to access the resulting
BallotList or be used to perform a search within the result set
through BallotList .
This session defines views that offer differing behaviors for searching.
- federated polls view: searches include ballots in polls of which this polls is a ancestor in the polls hierarchy
- isolated polls view: searches are restricted to ballots in this polls
Ballots may have a ballot query record indicated by their respective
record types. The ballot query record is accessed via the
BallotQuery .
-
Method Summary
Modifier and TypeMethodDescriptiongetBallotQueryFromInspector(BallotQueryInspector ballotQueryInspector) Gets a ballot query from an inspector.getBallotsBySearch(BallotQuery ballotQuery, BallotSearch ballotSearch) Gets the search results matching the given search query using the given search.Gets a ballot search.Gets a ballot search order.Methods inherited from interface BallotQuerySession
canSearchBallots, getBallotQuery, getBallotsByQuery, getPolls, getPollsId, useFederatedPollsView, useIsolatedPollsViewModifier and TypeMethodDescriptionbooleanTests if this user can performBallotsearches.Gets a ballot query.getBallotsByQuery(BallotQuery ballotQuery) Gets a list ofBallotsmatching the given query.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.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
-
getBallotSearch
BallotSearch getBallotSearch()Gets a ballot search.- Returns:
- the ballot search
- Compliance:
mandatory- This method must be implemented.
-
getBallotSearchOrder
BallotSearchOrder getBallotSearchOrder()Gets a ballot search order. TheBallotSearchOrderis supplied to aBallotSearchto specify the ordering of results.- Returns:
- the ballot search order
- Compliance:
mandatory- This method must be implemented.
-
getBallotsBySearch
BallotSearchResults getBallotsBySearch(BallotQuery ballotQuery, BallotSearch ballotSearch) throws OperationFailedException, PermissionDeniedException Gets the search results matching the given search query using the given search.- Parameters:
ballotQuery- the ballot queryballotSearch- the ballot search- Returns:
- the returned search results
- Throws:
NullArgumentException-ballotQueryorballotSearchisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-ballotQueryorballotSearchis not of this service- Compliance:
mandatory- This method must be implemented.
-
getBallotQueryFromInspector
Gets a ballot query from an inspector. The inspector is available from aBallotSearchResults.- Parameters:
ballotQueryInspector- a ballot query inspector- Returns:
- the ballot query
- Throws:
NullArgumentException-ballotQueryInspectorisnullUnsupportedException-ballotQueryInspectoris not of this service- Compliance:
mandatory- This method must be implemented.
-