Interface PersonLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface PersonLookupSession extends 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 Details

    • getRealmId

      Id getRealmId()
      Gets the Realm Id associated with this session.
      Returns:
      the Realm Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getRealm

      Gets the Realm associated with this session.
      Returns:
      the realm
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a PERMISSION_DENIED . This is intended as a hint to an application that may opt not to offer these operations.
      Returns:
      false if realm reading methods are not authorized, true otherwise
      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 the Person 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.
    • 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

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

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

      PersonList getPersonsByGenusType(Type personGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a PersonList corresponding to the given person genus Type which does not include persons of types derived from the specified Type . 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 - personGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getPersonsByParentGenusType

      PersonList getPersonsByParentGenusType(Type personGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a PersonList corresponding to the given person genus Type and include any additional persons with genus types derived from the specified Type . 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 - personGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getPersonsByRecordType

      PersonList getPersonsByRecordType(Type personRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a PersonList containing the given person record Type . 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 - personRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.