Interface CandidateLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CandidateLookupSession extends OsidSession

This session defines methods for retrieving candidates. A Candidate 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:

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete result set or is an error condition
  • isolated polls view: All candidate methods in this session operate, retrieve and pertain to candidates defined explicitly in the current polls. Using an isolated view is useful for managing Candidates with the CandidateAdminSession .
  • federated polls view: All candidate methods in this session operate, retrieve and pertain to all candidates defined in this polls and any other candidates implicitly available in this polls through polls inheritence.
  • effective candidate view: All candidate lookup methods return candidates where the current date falls in between the effective dates inclusive.
  • any effective candidate view: Candidates of any effective date are returned from methods.

The methods useFederatedPollsView() and useIsolatedPollsView() behave as a radio group and one should be selected before invoking any lookup methods.

Candidates may have an additional records indicated by their respective record types. The record may not be accessed through a cast of the Candidate .

  • Method Details

    • getPollsId

      Id getPollsId()
      Gets the Polls Id associated with this session.
      Returns:
      the Polls Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getPolls

      Gets the Polls associated with this session.
      Returns:
      the Polls associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canLookupCandidates

      boolean canLookupCandidates()
      Tests if this user can perform Candidate 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.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeCandidateView

      void useComparativeCandidateView()
      The returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.
      Compliance:
      mandatory - This method is must be implemented.
    • usePlenaryCandidateView

      void usePlenaryCandidateView()
      A complete view of the Candidate 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.
      Compliance:
      mandatory - This method is must be implemented.
    • useFederatedPollsView

      void useFederatedPollsView()
      Federates the view for methods in this session. A federated view will include candidates in polls which are children of this polls in the polls hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedPollsView

      void useIsolatedPollsView()
      Isolates the view for methods in this session. An isolated view restricts lookups to this polls only.
      Compliance:
      mandatory - This method is must be implemented.
    • useEffectiveCandidateView

      void useEffectiveCandidateView()
      Only candidates whose effective dates are current are returned by methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • useAnyEffectiveCandidateView

      void useAnyEffectiveCandidateView()
      All candidates of any effective dates are returned by methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • getCandidate

      Gets the Candidate specified by its Id . In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned Candidate may have a different Id than requested, such as the case where a duplicate Id was assigned to a Candidate and retained for compatibility. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      candidateId - the Id of the Candidate to retrieve
      Returns:
      the returned Candidate
      Throws:
      NotFoundException - no Candidate found with the given Id
      NullArgumentException - candidateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesByIds

      Gets a CandidateList corresponding to the given IdList . In plenary mode, the returned list contains all of the candidates 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 Candidates may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      candidateIds - the list of Ids to retrieve
      Returns:
      the returned Candidate list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - candidateIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesByGenusType

      CandidateList getCandidatesByGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a CandidateList corresponding to the given candidate genus Type which does not include candidates of types derived from the specified Type . In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      candidateGenusType - a candidate genus type
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - candidateGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesByParentGenusType

      CandidateList getCandidatesByParentGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a CandidateList corresponding to the given candidate genus Type and include any additional candidates with genus types derived from the specified Type . In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      candidateGenusType - a candidate genus type
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - candidateGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesByRecordType

      CandidateList getCandidatesByRecordType(Type candidateRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a CandidateList containing the given candidate record Type . In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      candidateRecordType - a candidate record type
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - candidateRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesOnDate

      Gets a list of candidates effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      from - start of date range
      to - end of date range
      Returns:
      the returned Candidate list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForRace

      Gets a CandidateList in the given race. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      raceId - a race Id
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - raceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForRaceOnDate

      CandidateList getCandidatesForRaceOnDate(Id raceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of candidates for the given race effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      raceId - a race Id
      from - start of date range
      to - end of date range
      Returns:
      the returned Candidate list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - raceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForResource

      CandidateList getCandidatesForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a CandidateList associated with the given resource. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      resourceId - a resource Id
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForResourceOnDate

      CandidateList getCandidatesForResourceOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of candidates for the given resource effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      resourceId - a resource Id
      from - start of date range
      to - end of date range
      Returns:
      the returned Candidate list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - resourceId, from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForRaceAndResource

      CandidateList getCandidatesForRaceAndResource(Id raceId, Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a CandidateList in the given race and resource. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      raceId - a race Id
      resourceId - a resource Id
      Returns:
      the returned Candidate list
      Throws:
      NullArgumentException - raceId or resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidatesForRaceAndResourceOnDate

      CandidateList getCandidatesForRaceAndResourceOnDate(Id raceId, Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of candidates for the given race and resource effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those availabilities that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Parameters:
      raceId - a race Id
      resourceId - a resource Id
      from - start of date range
      to - end of date range
      Returns:
      the returned Candidate list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - raceId, resourceId, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCandidates

      Gets all Candidates . In plenary mode, the returned list contains all known candidates or an error results. Otherwise, the returned list may contain only those candidates that are accessible through this session. In effective mode, candidates are returned that are currently effective. In any effective mode, effective candidates and those currently expired are returned.
      Returns:
      a list of Candidates
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.