Interface AddressLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface AddressLookupSession extends OsidSession

This session provides methods for retrieving Addresses . The Address represents a collection of contacts.

This session defines views that offer differing behaviors when retrieving multiple objects.

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete view or is an error condition
  • isolated address book view: All address methods in this session operate, retrieve and pertain to addresses defined explicitly in the current address book. Using an isolated view is useful for managing addresses with the AddressAdminSession .
  • federated address book view: All address lookup methods in this session operate, retrieve and pertain to all addresses defined in this address book and any other address books implicitly available in this address book through address book inheritence.
  • Method Details

    • getAddressBookId

      Id getAddressBookId()
      Gets the AddressBook Id associated with this session.
      Returns:
      the AddressBook Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getAddressBook

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

      boolean canLookupAddresses()
      Tests if this user can perform Address 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 not offer lookup operations to unauthorized users.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeAddressView

      void useComparativeAddressView()
      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.
    • usePlenaryAddressView

      void usePlenaryAddressView()
      A complete view of the Address 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.
    • useFederatedAddressBookView

      void useFederatedAddressBookView()
      Federates the view for methods in this session. A federated view will include addresses in address books which are children of this address book in the address book hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedAddressBookView

      void useIsolatedAddressBookView()
      Isolates the view for methods in this session. An isolated view restricts retrievals to this address book only.
      Compliance:
      mandatory - This method is must be implemented.
    • getAddress

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

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

      AddressList getAddressesByGenusType(Type addressGenusType) throws OperationFailedException, PermissionDeniedException
      Gets an AddressList corresponding to the given address genus Type which does not include addresses of genus types derived from the specified Type .In plenary mode, the returned list contains all known addresses or an error results. Otherwise, the returned list may contain only those addresses that are accessible through this session.
      Parameters:
      addressGenusType - an address genus type
      Returns:
      the returned Address list
      Throws:
      NullArgumentException - addressGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getAddressesByParentGenusType

      AddressList getAddressesByParentGenusType(Type addressGenusType) throws OperationFailedException, PermissionDeniedException
      Gets an AddressList corresponding to the given address genus Type and include any additional addresses with genus types derived from the specified Type .In plenary mode, the returned list contains all known addresses or an error results. Otherwise, the returned list may contain only those addresses that are accessible through this session.
      Parameters:
      addressGenusType - an address genus type
      Returns:
      the returned Address list
      Throws:
      NullArgumentException - addressGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getAddressesByRecordType

      AddressList getAddressesByRecordType(Type addressRecordType) throws OperationFailedException, PermissionDeniedException
      Gets an AddressList containing the given address record Type . In plenary mode, the returned list contains all known addresses or an error results. Otherwise, the returned list may contain only those addresses that are accessible through this session.
      Parameters:
      addressRecordType - an address record type
      Returns:
      the returned Address list
      Throws:
      NullArgumentException - addressRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getAddressesByResource

      AddressList getAddressesByResource(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets an AddressList for the given resource. In plenary mode, the returned list contains all known addresses or an error results. Otherwise, the returned list may contain only those addresses that are accessible through this session.
      Parameters:
      resourceId - a resource Id
      Returns:
      the returned Address list
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getAddresses

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