Interface CandidateQuery

All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, OsidRelationshipQuery, OsidTemporalQuery, Suppliable

public interface CandidateQuery extends OsidRelationshipQuery

This is the query for searching candidates. Each method specifies an AND term while multiple invocations of the same method produce a nested OR .

  • Method Details

    • matchRaceId

      void matchRaceId(Id raceId, boolean match)
      Sets the race Id for this query.
      Parameters:
      raceId - a race Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - raceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearRaceIdTerms

      void clearRaceIdTerms()
      Clears the race Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsRaceQuery

      boolean supportsRaceQuery()
      Tests if a RaceQuery is available for querying candidates.
      Returns:
      true if a race query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRaceQuery

      RaceQuery getRaceQuery()
      Gets the query for a race. Multiple retrievals produce a nested OR term.
      Returns:
      the race query
      Throws:
      UnimplementedException - supportsRaceQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsRaceQuery()} is {@code true} .
    • clearRaceTerms

      void clearRaceTerms()
      Clears the race terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchResourceId

      void matchResourceId(Id resourceId, boolean match)
      Sets the resource Id for this query.
      Parameters:
      resourceId - a resource Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearResourceIdTerms

      void clearResourceIdTerms()
      Clears the resource Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsResourceQuery

      boolean supportsResourceQuery()
      Tests if a ResourceQuery is available for querying candidates.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getResourceQuery

      ResourceQuery getResourceQuery()
      Gets the query for a resource. Multiple retrievals produce a nested OR term.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsResourceQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsResourceQuery()} is {@code true} .
    • clearResourceTerms

      void clearResourceTerms()
      Clears the resource terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchVoteId

      void matchVoteId(Id voteId, boolean match)
      Sets the vote Id for this query.
      Parameters:
      voteId - the vote Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - voteId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearVoteIdTerms

      void clearVoteIdTerms()
      Clears the vote Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsVoteQuery

      boolean supportsVoteQuery()
      Tests if a VoteQuery is available.
      Returns:
      true if a vote query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getVoteQuery

      VoteQuery getVoteQuery()
      Gets the query for a vote. Multiple retrievals produce a nested OR term.
      Returns:
      the vote query
      Throws:
      UnimplementedException - supportsVoteQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsVoteQuery()} is {@code true} .
    • matchAnyVote

      void matchAnyVote(boolean match)
      Matches candidates with any vote.
      Parameters:
      match - true to match any vote, false to match candidates with no votes
      Compliance:
      mandatory - This method must be implemented.
    • clearVoteTerms

      void clearVoteTerms()
      Clears the vote terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchPollsId

      void matchPollsId(Id pollsId, boolean match)
      Sets the polls Id for this query.
      Parameters:
      pollsId - the polls Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - pollsId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearPollsIdTerms

      void clearPollsIdTerms()
      Clears the polls Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsPollsQuery

      boolean supportsPollsQuery()
      Tests if a PollsQuery is available.
      Returns:
      true if a polls query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getPollsQuery

      PollsQuery getPollsQuery()
      Gets the query for a polls. Multiple retrievals produce a nested OR term.
      Returns:
      the polls query
      Throws:
      UnimplementedException - supportsPollsQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsPollsQuery()} is {@code true} .
    • clearPollsTerms

      void clearPollsTerms()
      Clears the polls terms.
      Compliance:
      mandatory - This method must be implemented.
    • getCandidateQueryRecord

      CandidateQueryRecord getCandidateQueryRecord(Type candidateRecordType) throws OperationFailedException
      Gets the candidate query record corresponding to the given Candidate record Type . Multiple retrievals produce a nested OR term.
      Parameters:
      candidateRecordType - a candidate record type
      Returns:
      the candidate query record
      Throws:
      NullArgumentException - candidateRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(candidateRecordType) is false
      Compliance:
      mandatory - This method must be implemented.