Interface ContactLookupSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods for retrieving contacts.
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 address book view: All contact methods in this session
operate, retrieve and pertain to contacts defined explicitly in the
current address book. Using an isolated view is useful for managing
contacts with the
ContactAdminSession. - federated address book view: All contact lookup methods in this session operate, retrieve and pertain to all contacts defined in this address book and any other address books implicitly available in this address book through address book inheritence.
- effective contact view: All contact lookup methods return contacts where the current dates falls in between the effective dates inclusive.
- any effective contact view: Contacts of any effective date are returned.
The methods useFederatedAddressBookView() and
useIsolatedAddressBookView() behave as a radio group and one should be
selected before invoking any lookup methods.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can lookup contacts.Gets theAddressBookassociated with this session.Gets theAddressBookIdassociated with this session.getContact(Id contactId) Gets theContactspecified by itsId.Gets all contacts.getContactsByGenusType(Type contactGenusType) Gets aContactListcorresponding to the given contact genusTypewhich does not include contacts of genus types derived from the specifiedType.getContactsByGenusTypeForAddress(Id addressId, Type contactGenusType) Gets a list of all contacts of the given genus type corresponding to an addressId.getContactsByGenusTypeForAddressOnDate(Id addressId, Type contactGenusType, DateTime from, DateTime to) Gets a list of all contacts of the given genus type corresponding to an addressIdand effective during the entire given date range inclusive but not confined to the date range.getContactsByGenusTypeForReference(Id referenceId, Type contactGenusType) Gets a list of contacts of the given genus type corresponding to a referenceId.getContactsByGenusTypeForReferenceAndAddress(Id referenceId, Id addressId, Type contactGenusType) Gets a list of all contacts with the given genus type corresponding to a reference and addressId.getContactsByGenusTypeForReferenceAndAddressOnDate(Id referenceId, Id addressId, Type contactGenusType, DateTime from, DateTime to) Gets a list of all contacts with the given genus type corresponding to a reference and addressIdand during the entire given date range inclusive but not confined to the date range.getContactsByGenusTypeForReferenceOnDate(Id referenceId, Type contactGenusType, DateTime from, DateTime to) Gets a list of all contacts of the given genus type corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range.getContactsByGenusTypeOnDate(Type contactGenusType, DateTime from, DateTime to) Gets a list of contacts of a genus type and with an effective during the entire given date range inclusive but not confined to the date range.getContactsByIds(IdList contactIds) Gets aContactListcorresponding to the givenIdList.getContactsByParentGenusType(Type contactGenusType) Gets aContactListcorresponding to the given contact genusTypeand include any additional contacts with genus types derived from the specifiedType.getContactsByRecordType(Type contactRecordType) Gets aContactListcontaining the given contact recordType.getContactsForAddress(Id addressId) Gets a list of all contacts corresponding to an addressId.getContactsForAddressOnDate(Id addressId, DateTime from, DateTime to) Gets a list of all contacts corresponding to an addressIdand effective during the entire given date range inclusive but not confined to the date range.getContactsForReference(Id referenceId) Gets a list of contacts corresponding to a referenceId.getContactsForReferenceAndAddress(Id referenceId, Id addressId) Gets a list of all contacts corresponding to a reference and addressId.getContactsForReferenceAndAddressOnDate(Id referenceId, Id addressId, DateTime from, DateTime to) Gets a list of all contacts corresponding to a reference and addressIdand effectiveduring the entire given date range inclusive but not confined to the date range.getContactsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) Gets a list of all contacts corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range.getContactsOnDate(DateTime from, DateTime to) Gets a list of contacts with an effective during the entire given date range inclusive but not confined to the date range.voidAll contacts of any effective dates are returned by all 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 contacts 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 theContactreturns 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
-
getAddressBookId
Id getAddressBookId()Gets theAddressBookIdassociated with this session.- Returns:
- the
AddressBook Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getAddressBook
Gets theAddressBookassociated with this session.- Returns:
- the address book
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canLookupContacts
boolean canLookupContacts()Tests if this user can lookup contacts. 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 contact lookup methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
useComparativeContactView
void useComparativeContactView()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.
-
usePlenaryContactView
void usePlenaryContactView()A complete view of theContactreturns 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 contacts 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.
-
useEffectiveContactView
void useEffectiveContactView()Only contacts whose effective dates are current are returned by methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
useAnyEffectiveContactView
void useAnyEffectiveContactView()All contacts of any effective dates are returned by all methods in this session.- Compliance:
mandatory- This method is must be implemented.
-
getContact
Contact getContact(Id contactId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets theContactspecified by itsId. In plenary mode, the exactIdis found or aNOT_FOUNDresults. Otherwise, the returnedContactmay have a differentIdthan requested, such as the case where a duplicateIdwas assigned to aContactand retained for compatibility. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactId- theIdof theContactto retrieve- Returns:
- the returned
Contact - Throws:
NotFoundException- noContactfound with the givenIdNullArgumentException-contactIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByIds
ContactList getContactsByIds(IdList contactIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets aContactListcorresponding to the givenIdList. In plenary mode, the returned list contains all of the contacts 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 contacts may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactIds- the list ofIdsto retrieve- Returns:
- the returned
Contact list - Throws:
NotFoundException- anId wasnot foundNullArgumentException-contactIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusType
ContactList getContactsByGenusType(Type contactGenusType) throws OperationFailedException, PermissionDeniedException Gets aContactListcorresponding to the given contact genusTypewhich does not include contacts of genus types derived from the specifiedType. In plenary mode, the returned list contains all of the contacts specified in theIdlist, 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 contacts may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactGenusType- a contact genus type- Returns:
- the returned
Contactlist - Throws:
NullArgumentException-contactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByParentGenusType
ContactList getContactsByParentGenusType(Type contactGenusType) throws OperationFailedException, PermissionDeniedException Gets aContactListcorresponding to the given contact genusTypeand include any additional contacts with genus types derived from the specifiedType. In plenary mode, the returned list contains all of the contacts specified in theIdlist, 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 contacts may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactGenusType- a contact genus type- Returns:
- the returned
Contactlist - Throws:
NullArgumentException-contactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByRecordType
ContactList getContactsByRecordType(Type contactRecordType) throws OperationFailedException, PermissionDeniedException Gets aContactListcontaining the given contact recordType. In plenary mode, the returned list contains all of the contacts specified in theIdlist, 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 contacts may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactRecordType- a contact record type- Returns:
- the returned
Contactlist - Throws:
NullArgumentException-contactRecordTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsOnDate
ContactList getContactsOnDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of contacts with an effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
from- the starting dateto- the ending date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeOnDate
ContactList getContactsByGenusTypeOnDate(Type contactGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of contacts of a genus type and with an effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
contactGenusType- a contact genus typefrom- the starting dateto- the ending date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-contactGenusType, from, ortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForReference
ContactList getContactsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException Gets a list of contacts corresponding to a referenceId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the reference- Returns:
- the returned
ContactList - Throws:
NullArgumentException-referenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForReferenceOnDate
ContactList getContactsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- a referenceIdfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForReference
ContactList getContactsByGenusTypeForReference(Id referenceId, Type contactGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of contacts of the given genus type corresponding to a referenceId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the referencecontactGenusType- the genus type of the contact- Returns:
- the returned
ContactList - Throws:
NullArgumentException-referenceIdorcontactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForReferenceOnDate
ContactList getContactsByGenusTypeForReferenceOnDate(Id referenceId, Type contactGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts of the given genus type corresponding to a referenceIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- a referenceIdcontactGenusType- the genus type of the contactfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, contactGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForAddress
ContactList getContactsForAddress(Id addressId) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts corresponding to an addressId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
addressId- theIdof the address- Returns:
- the returned
ContactList - Throws:
NullArgumentException-addressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForAddressOnDate
ContactList getContactsForAddressOnDate(Id addressId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts corresponding to an addressIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
addressId- an addressIdfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-addressId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForAddress
ContactList getContactsByGenusTypeForAddress(Id addressId, Type contactGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts of the given genus type corresponding to an addressId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
addressId- theIdof the addresscontactGenusType- the genus type of the contact- Returns:
- the returned
ContactList - Throws:
NullArgumentException-addressIdorcontactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForAddressOnDate
ContactList getContactsByGenusTypeForAddressOnDate(Id addressId, Type contactGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts of the given genus type corresponding to an addressIdand effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
addressId- an addressIdcontactGenusType- the genus type of the contactfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-addressId, contactGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForReferenceAndAddress
ContactList getContactsForReferenceAndAddress(Id referenceId, Id addressId) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts corresponding to a reference and addressId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the referenceaddressId- theIdof the address- Returns:
- the returned
ContactList - Throws:
NullArgumentException-referenceIdoraddressIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsForReferenceAndAddressOnDate
ContactList getContactsForReferenceAndAddressOnDate(Id referenceId, Id addressId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts corresponding to a reference and addressIdand effectiveduring the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the referenceaddressId- an addressIdfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, addressI, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForReferenceAndAddress
ContactList getContactsByGenusTypeForReferenceAndAddress(Id referenceId, Id addressId, Type contactGenusType) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts with the given genus type corresponding to a reference and addressId. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the referenceaddressId- theIdof the addresscontactGenusType- the genus type of the contact- Returns:
- the returned
ContactList - Throws:
NullArgumentException-referenceId, addressIdorcontactGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContactsByGenusTypeForReferenceAndAddressOnDate
ContactList getContactsByGenusTypeForReferenceAndAddressOnDate(Id referenceId, Id addressId, Type contactGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Gets a list of all contacts with the given genus type corresponding to a reference and addressIdand during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Parameters:
referenceId- theIdof the referenceaddressId- an addressIdcontactGenusType- the genus type of the contactfrom- from dateto- to date- Returns:
- the returned
ContactList - Throws:
InvalidArgumentException-tois less thanfromNullArgumentException-referenceId, addressId, contactGenusType, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getContacts
Gets all contacts. In plenary mode, the returned list contains all known contacts or an error results. Otherwise, the returned list may contain only those contacts that are accessible through this session. In effective mode, contacts are returned that are currently effective. In any effective mode, effective contacts and those currently expired are returned.- Returns:
- a list of contacts
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-