Interface CandidateLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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
Candidateswith theCandidateAdminSession. - 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 Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can performCandidatelookups.getCandidate(Id candidateId) Gets theCandidatespecified by itsId.Gets allCandidates.getCandidatesByGenusType(Type candidateGenusType) Gets aCandidateListcorresponding to the given candidate genusTypewhich does not include candidates of types derived from the specifiedType.getCandidatesByIds(IdList candidateIds) Gets aCandidateListcorresponding to the givenIdList.getCandidatesByParentGenusType(Type candidateGenusType) Gets aCandidateListcorresponding to the given candidate genusTypeand include any additional candidates with genus types derived from the specifiedType.getCandidatesByRecordType(Type candidateRecordType) Gets aCandidateListcontaining the given candidate recordType.getCandidatesForRace(Id raceId) Gets aCandidateListin the given race.getCandidatesForRaceAndResource(Id raceId, Id resourceId) Gets aCandidateListin the given race and resource.getCandidatesForRaceAndResourceOnDate(Id raceId, Id resourceId, DateTime from, DateTime to) 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.getCandidatesForRaceOnDate(Id raceId, DateTime from, DateTime to) Gets a list of candidates for the given race effective during the entire given date range inclusive but not confined to the date range.getCandidatesForResource(Id resourceId) Gets aCandidateListassociated with the given resource.getCandidatesForResourceOnDate(Id resourceId, DateTime from, DateTime to) Gets a list of candidates for the given resource effective during the entire given date range inclusive but not confined to the date range.getCandidatesOnDate(DateTime from, DateTime to) Gets a list of candidates effective during the entire given date range inclusive but not confined to the date range.getPolls()Gets thePollsassociated with this session.Gets thePollsIdassociated with this session.voidAll candidates of any effective dates are returned by methods in this session.voidThe returns from the lookup methods may omit or translate elements based on this session, such as authorization, and not result in an error.voidOnly candidates whose effective dates are current are returned by methods in this session.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of theCandidatereturns is desired.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
-
getPollsId
Id getPollsId()Gets thePollsIdassociated with this session.- Returns:
- the
Polls Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getPolls
Gets thePollsassociated with this session.- Returns:
- the
Pollsassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupCandidates
boolean canLookupCandidates()Tests if this user can performCandidatelookups. 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer lookup operations.- Returns:
falseif lookup methods are not authorized,trueotherwise- 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 theCandidatereturns 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
Candidate getCandidate(Id candidateId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theCandidatespecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedCandidatemay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aCandidateand 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- theIdof theCandidateto retrieve- Returns:
- the returned
Candidate - Throws:
NotFoundException- noCandidatefound with the givenIdNullArgumentException-candidateIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesByIds
CandidateList getCandidatesByIds(IdList candidateIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aCandidateListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the candidates specified in theIdlist, in the order of the list, including duplicates, or an error results if anIdin the supplied list is not found or inaccessible. Otherwise, inaccessibleCandidatesmay 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 ofIdsto retrieve- Returns:
- the returned
Candidatelist - Throws:
NotFoundException- anIdwas not foundNullArgumentException-candidateIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesByGenusType
CandidateList getCandidatesByGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException Gets aCandidateListcorresponding to the given candidate genusTypewhich does not include candidates of types derived from the specifiedType. 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
Candidatelist - Throws:
NullArgumentException-candidateGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesByParentGenusType
CandidateList getCandidatesByParentGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException Gets aCandidateListcorresponding to the given candidate genusTypeand include any additional candidates with genus types derived from the specifiedType. 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
Candidatelist - Throws:
NullArgumentException-candidateGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesByRecordType
CandidateList getCandidatesByRecordType(Type candidateRecordType) throws OperationFailedException, PermissionDeniedException Gets aCandidateListcontaining the given candidate recordType. 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
Candidatelist - Throws:
NullArgumentException-candidateRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesOnDate
CandidateList getCandidatesOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException 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 rangeto- end of date range- Returns:
- the returned
Candidatelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesForRace
CandidateList getCandidatesForRace(Id raceId) throws OperationFailedException, PermissionDeniedException Gets aCandidateListin 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 raceId- Returns:
- the returned
Candidatelist - Throws:
NullArgumentException-raceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 raceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
Candidatelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-raceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesForResource
CandidateList getCandidatesForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aCandidateListassociated 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 resourceId- Returns:
- the returned
Candidatelist - Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 resourceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
Candidatelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-resourceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidatesForRaceAndResource
CandidateList getCandidatesForRaceAndResource(Id raceId, Id resourceId) throws OperationFailedException, PermissionDeniedException Gets aCandidateListin 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 raceIdresourceId- a resourceId- Returns:
- the returned
Candidatelist - Throws:
NullArgumentException-raceIdorresourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- 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 raceIdresourceId- a resourceIdfrom- start of date rangeto- end of date range- Returns:
- the returned
Candidatelist - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-raceId, resourceId, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCandidates
Gets allCandidates. 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 requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-