Interface PersonLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving persons.
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 realm view: All person methods in this session operate,
retrieve and pertain to persons defined explicitly in the current
realm. Using an isolated view is useful for managing persons with the
PersonAdminSession. - federated realm view: All person lookup methods in this session operate, retrieve and pertain to all persons defined in this realm and any other realms implicitly available in this realm through realm inheritence.
The methods useFederatedRealmView() and
useIsolatedRealmView() behave as a radio group and one should be selected
before invoking any lookup methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can examine this realm.Gets thePersonspecified by itsId.Gets all persons.getPersonsByGenusType(Type personGenusType) Gets aPersonListcorresponding to the given person genusTypewhich does not include persons of types derived from the specifiedType.getPersonsByIds(IdList personIds) Gets aPersonListcorresponding to the givenIdList.getPersonsByParentGenusType(Type personGenusType) Gets aPersonListcorresponding to the given person genusTypeand include any additional persons with genus types derived from the specifiedType.getPersonsByRecordType(Type personRecordType) Gets aPersonListcontaining the given person recordType.getRealm()Gets theRealmassociated with this session.Gets theRealmIdassociated with 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.voidFederates the view for methods in this session.voidIsolates the view for methods in this session.voidA complete view of thePersonreturns 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
-
getRealmId
Id getRealmId()Gets theRealmIdassociated with this session.- Returns:
- the
Realm Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getRealm
Gets theRealmassociated with this session.- Returns:
- the realm
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupPersons
boolean canLookupPersons()Tests if this user can examine this realm. 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 these operations.- Returns:
falseif realm reading methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativePersonView
void useComparativePersonView()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.
-
usePlenaryPersonView
void usePlenaryPersonView()A complete view of thePersonreturns 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.
-
useFederatedRealmView
void useFederatedRealmView()Federates the view for methods in this session. A federated view will include persons in realms which are children of this realm in the realm hierarchy.- Compliance:
mandatory- This method is must be implemented.
-
useIsolatedRealmView
void useIsolatedRealmView()Isolates the view for methods in this session. An isolated view restricts retrievals to this realm only.- Compliance:
mandatory- This method is must be implemented.
-
getPerson
Person getPerson(Id personId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets thePersonspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedPersonmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aPersonand retained for compatibility.- Parameters:
personId- theIdof thePersonto retrieve- Returns:
- the returned
Person - Throws:
NotFoundException- noPersonfound with the givenIdNullArgumentException-personIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersonsByIds
PersonList getPersonsByIds(IdList personIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aPersonListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the persons 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, inaccessible persons may be omitted from the list and may present the elements in any order including returning a unique set.- Parameters:
personIds- the list ofIdsto retrieve- Returns:
- the returned
Person list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-personIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersonsByGenusType
PersonList getPersonsByGenusType(Type personGenusType) throws OperationFailedException, PermissionDeniedException Gets aPersonListcorresponding to the given person genusTypewhich does not include persons of types derived from the specifiedType. In plenary mode, the returned list contains all known persons or an error results. Otherwise, the returned list may contain only those persons that are accessible through this session.- Parameters:
personGenusType- a persons genus type- Returns:
- the returned
Person list - Throws:
NullArgumentException-personGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersonsByParentGenusType
PersonList getPersonsByParentGenusType(Type personGenusType) throws OperationFailedException, PermissionDeniedException Gets aPersonListcorresponding to the given person genusTypeand include any additional persons with genus types derived from the specifiedType. In plenary mode, the returned list contains all known persons or an error results. Otherwise, the returned list may contain only those persons that are accessible through this session.- Parameters:
personGenusType- a person genus type- Returns:
- the returned
Person list - Throws:
NullArgumentException-personGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersonsByRecordType
PersonList getPersonsByRecordType(Type personRecordType) throws OperationFailedException, PermissionDeniedException Gets aPersonListcontaining the given person recordType. In plenary mode, the returned list contains all known persons or an error results. Otherwise, the returned list may contain only those persons that are accessible through this session.- Parameters:
personRecordType- a person record type- Returns:
- the returned
PersonList - Throws:
NullArgumentException-personRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getPersons
Gets all persons. In plenary mode, the returned list contains all known persons or an error results. Otherwise, the returned list may contain only those persons that are accessible through this session.- Returns:
- a list of persons
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-