Interface BallotSearchSession

All Superinterfaces:
AutoCloseable, BallotQuerySession, Closeable, OsidSession, OsidSession

public interface BallotSearchSession extends BallotQuerySession

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 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. The BallotSearchOrder is supplied to a BallotSearch to 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 query
      ballotSearch - the ballot search
      Returns:
      the returned search results
      Throws:
      NullArgumentException - ballotQuery or ballotSearch is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - ballotQuery or ballotSearch is not of this service
      Compliance:
      mandatory - This method must be implemented.
    • getBallotQueryFromInspector

      BallotQuery getBallotQueryFromInspector(BallotQueryInspector ballotQueryInspector)
      Gets a ballot query from an inspector. The inspector is available from a BallotSearchResults .
      Parameters:
      ballotQueryInspector - a ballot query inspector
      Returns:
      the ballot query
      Throws:
      NullArgumentException - ballotQueryInspector is null
      UnsupportedException - ballotQueryInspector is not of this service
      Compliance:
      mandatory - This method must be implemented.