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:
Candidates
with the CandidateAdminSession.
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.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupCandidates()
Tests if this user can perform
Candidate lookups. |
Candidate |
getCandidate(Id candidateId)
Gets the
Candidate specified by its Id. |
CandidateList |
getCandidates()
Gets all
Candidates. |
CandidateList |
getCandidatesByGenusType(Type candidateGenusType)
Gets a
CandidateList corresponding to the given
candidate genus Type which does not include candidates
of types derived from the specified Type. |
CandidateList |
getCandidatesByIds(IdList candidateIds)
Gets a
CandidateList corresponding to the given
IdList. |
CandidateList |
getCandidatesByParentGenusType(Type candidateGenusType)
Gets a
CandidateList corresponding to the given
candidate genus Type and include any additional
candidates with genus types derived from the specified Type. |
CandidateList |
getCandidatesByRecordType(Type candidateRecordType)
Gets a
CandidateList containing the given candidate
record Type. |
CandidateList |
getCandidatesForRace(Id raceId)
Gets a
CandidateList in the given race. |
CandidateList |
getCandidatesForRaceAndResource(Id raceId,
Id resourceId)
Gets a
CandidateList in the given race and resource. |
CandidateList |
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.
|
CandidateList |
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.
|
CandidateList |
getCandidatesForResource(Id resourceId)
Gets a
CandidateList associated with the given
resource. |
CandidateList |
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.
|
CandidateList |
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.
|
Polls |
getPolls()
Gets the
Polls associated with this session. |
Id |
getPollsId()
Gets the
Polls Id associated with this
session. |
void |
useAnyEffectiveCandidateView()
All candidates of any effective dates are returned by methods in this
session.
|
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.
|
void |
useEffectiveCandidateView()
Only candidates whose effective dates are current are returned by
methods in this session.
|
void |
useFederatedPollsView()
Federates the view for methods in this session.
|
void |
useIsolatedPollsView()
Isolates the view for methods in this session.
|
void |
usePlenaryCandidateView()
A complete view of the
Candidate returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getPollsId()
Polls
Id
associated with this
session. Polls Id
associated with this sessionmandatory
- This method must be implemented. Polls getPolls() throws OperationFailedException, PermissionDeniedException
Polls
associated with this session. Polls
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupCandidates()
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. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativeCandidateView()
mandatory
- This method is must be implemented. void usePlenaryCandidateView()
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.mandatory
- This method is must be implemented. void useFederatedPollsView()
mandatory
- This method is must be implemented. void useIsolatedPollsView()
mandatory
- This method is must be implemented. void useEffectiveCandidateView()
mandatory
- This method is must be implemented. void useAnyEffectiveCandidateView()
mandatory
- This method is must be implemented. Candidate getCandidate(Id candidateId) throws NotFoundException, OperationFailedException, PermissionDeniedException
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.candidateId
- the Id
of the Candidate
to retrieve Candidate
NotFoundException
- no Candidate
found
with the given Id
NullArgumentException
- candidateId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByIds(IdList candidateIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
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.candidateIds
- the list of Ids
to retrieve Candidate
listNotFoundException
- an Id
was not foundNullArgumentException
- candidateIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException
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.candidateGenusType
- a candidate genus type Candidate
listNullArgumentException
- candidateGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByParentGenusType(Type candidateGenusType) throws OperationFailedException, PermissionDeniedException
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.candidateGenusType
- a candidate genus type Candidate
listNullArgumentException
- candidateGenusType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesByRecordType(Type candidateRecordType) throws OperationFailedException, PermissionDeniedException
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.candidateRecordType
- a candidate record type Candidate
listNullArgumentException
- candidateRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
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.from
- start of date rangeto
- end of date range Candidate
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- from
or
to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForRace(Id raceId) throws OperationFailedException, PermissionDeniedException
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.raceId
- a race Id
Candidate
listNullArgumentException
- raceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForRaceOnDate(Id raceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
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.raceId
- a race Id
from
- start of date rangeto
- end of date range Candidate
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- raceId, from
or
to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForResource(Id resourceId) throws OperationFailedException, PermissionDeniedException
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.resourceId
- a resource Id
Candidate
listNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForResourceOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
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.resourceId
- a resource Id
from
- start of date rangeto
- end of date range Candidate
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- resourceId, from
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForRaceAndResource(Id raceId, Id resourceId) throws OperationFailedException, PermissionDeniedException
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.raceId
- a race Id
resourceId
- a resource Id
Candidate
listNullArgumentException
- raceId
or
resourceId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidatesForRaceAndResourceOnDate(Id raceId, Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
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.raceId
- a race Id
resourceId
- a resource Id
from
- start of date rangeto
- end of date range Candidate
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- raceId, resourceId,
from,
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. CandidateList getCandidates() throws OperationFailedException, PermissionDeniedException
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. Candidates
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.