Interface CandidateSearchSession

All Superinterfaces:
AutoCloseable, CandidateQuerySession, Closeable, OsidSession, OsidSession

public interface CandidateSearchSession extends CandidateQuerySession

This session provides methods for searching among Candidate objects. The search query is constructed using the CandidateQuery .

getCandidatesByQuery() is the basic search method and returns a list of Candidates . A more advanced search may be performed with getCandidatesBySearch() .It accepts an CandidateSearch in addition to the query for the purpose of specifying additional options affecting the entire search, such as ordering. getCandidatesBySearch() returns an CandidateSearchResults that can be used to access the resulting CandidateList or be used to perform a search within the result set through CandidateList .

This session defines views that offer differing behaviors for searching.

  • federated polls view: searches include candidates in polls of which this polls is a ancestor in the polls hierarchy
  • isolated polls view: searches are restricted to candidates in this polls

Candidates may have a candidiate query record indicated by their respective record types. The candidiate query record is accessed via the CandidateQuery .

  • Method Details

    • getCandidateSearch

      CandidateSearch getCandidateSearch()
      Gets a candidate search.
      Returns:
      the candidate search
      Compliance:
      mandatory - This method must be implemented.
    • getCandidateSearchOrder

      CandidateSearchOrder getCandidateSearchOrder()
      Gets a candidate search order. The CandidateSearchOrder is supplied to a CandidateSearch to specify the ordering of results.
      Returns:
      the candidate search order
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesBySearch

      CandidateSearchResults getCandidatesBySearch(CandidateQuery candidateQuery, CandidateSearch candidateSearch) throws OperationFailedException, PermissionDeniedException
      Gets the search results matching the given search query using the given search.
      Parameters:
      candidateQuery - the candidate query
      candidateSearch - the candidate search
      Returns:
      the returned search results
      Throws:
      NullArgumentException - candidateQuery or candidateSearch is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - candidateQuery or candidateSearch is not of this service
      Compliance:
      mandatory - This method must be implemented.
    • getCandidateQueryFromInspector

      CandidateQuery getCandidateQueryFromInspector(CandidateQueryInspector candidateQueryInspector)
      Gets a candidate query from an inspector. The inspector is available from a CandidateSearchResults .
      Parameters:
      candidateQueryInspector - a candidate query inspector
      Returns:
      the candidate query
      Throws:
      NullArgumentException - candidateQueryInspector is null
      UnsupportedException - candidateQueryInspector is not of this service
      Compliance:
      mandatory - This method must be implemented.