Interface Contact
-
- All Superinterfaces:
BaseContact
public interface Contact extends BaseContact
Represents an immutable contact object which exposes all possible contact details. The contact object can also be used to subscribe for presence updates.
Contacts can be retrieved by using
ContactServicemethodsContactService.getContacts(DataRetrievalWatcher, ContactSourceType)orContactService.searchContacts(DataRetrievalWatcher, String, ContactSearchScopeType, ContactSearchLocationType, int, int). Both methods take a DataRetrievalWatcher argument which allows the application to be notified about the status of the operation and changes to the list of contacts retrieved.This object cannot be used to edit the contact record. In order to update a contact record the following steps are required:
- Call
ContactService.createEditableContactFromContact(Contact)to get an editable contact object. - Make updates to the fields of the
EditableContactobject that was returned. - Call
ContactService.updateContact(EditableContact, UpdateContactCompletionHandler)to save the changes.
- See Also:
EditableContact
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddContactListener(ContactListener contactListener)Adds the contact listener to get updates for this contact.voidaddPresenceListener(PresenceSubscriptionListener presenceSubscriptionListener)Adds the presence listener to get presence updates for this contact.CapabilitygetAddToGroupCapability()Capability indicating whether this contact can be added to a group.ContactStringFieldgetASCIIAlias()The non-localized alias.ContactStringFieldgetASCIIDisplayName()The non-localized display name.ContactStringFieldgetASCIIFirstName()The non-localized first name.ContactStringFieldgetASCIILastName()The non-localized last name.ContactStringFieldgetCity()The city.ContactStringFieldgetCompany()The company.java.util.Set<ContactSourceType>getContactSources()Returns list of contact sourcesContactStringFieldgetCountry()The country.ContactMultiValueField<ContactStringField>getCustom1()The list of custom1 values.ContactMultiValueField<ContactStringField>getCustom2()The list of custom2 values.ContactMultiValueField<ContactStringField>getCustom3()The list of custom3 values.CapabilitygetDeleteContactCapability()Capability indicating whether this contact can be deleted.ContactStringFieldgetDepartment()The department.ContactEmailAddressFieldListgetEmailAddresses()The list of email addresses.java.util.Map<java.lang.String,ContactField>getExtraFields()Contact extra fieldsContactIMAddressFieldListgetIMAddresses()The list of IM addresses.ContactStringFieldgetIMAttributeValue()Deprecated.Always returns empty string.ContactStringFieldgetLanguage()The language is per contact record.ContactStringFieldgetLocation()The location.ContactStringFieldgetManager()The name of a person who is a supervisor.ContactStringFieldgetNativeAlias()The native alias.ContactStringFieldgetNativeDisplayName()The native display name.ContactStringFieldgetNativeFirstName()The native first name.ContactStringFieldgetNativeLastName()The native last name.ContactStringFieldgetNotes()The notes field.ContactPhoneFieldListgetPhoneNumbers()The list of phone numbers.byte[]getPictureData()The contact picture bytes.ContactStringFieldgetPostalCode()The postal code.PresencegetPresence()The presence state of this contact.ContactDoubleFieldgetRank()The rank field defining the contact sorting order.ContactStringFieldgetState()The state.ContactStringFieldgetStreetAddress()The street address.ContactStringFieldgetTitle()The title or company role.java.lang.StringgetUniqueAddressForMatching()The matching/merging address.CapabilitygetUpdateContactCapability()Capability indicating whether this contact can be updated.booleanhasPicture()Indicating whether contact has a picture.ContactBoolFieldisBuddy()The buddy flag.ContactBoolFieldisFavorite()The favorite flag.ContactBoolFieldisVIP()The VIP flag.voidremoveContactListener(ContactListener contactListener)Removes the contact listener to stop getting updates for this contact.voidremovePictureFromCache()Removes contact's picture from cache.voidremovePresenceListener(PresenceSubscriptionListener presenceSubscriptionListener)Removes the presence listener to stop getting presence updates for this contact.voidretrievePicture(ContactCompletionHandler handler)Retrieves the picture for contact.voidstartPresence(AccessControlBehavior accessControlBehavior, PresenceCompletionHandler completionHandler)Begin monitoring presence for this contact.voidstopPresence(PresenceCompletionHandler completionHandler)Stop monitoring presence for this contact.-
Methods inherited from interface com.avaya.clientservices.contact.BaseContact
canAddEmailAddress, canAddEmailAddress, canAddIMAddress, canAddPhoneNumber, isExtendedContactDetailsAvailable, isVideoCapable
-
-
-
-
Method Detail
-
addContactListener
void addContactListener(ContactListener contactListener)
Adds the contact listener to get updates for this contact.- Parameters:
contactListener- The listener to register with this object.
-
removeContactListener
void removeContactListener(ContactListener contactListener)
Removes the contact listener to stop getting updates for this contact.- Parameters:
contactListener- The listener to unregister from this object.
-
getPresence
Presence getPresence()
The presence state of this contact.Note that for the presence to start being updated,
startPresence(AccessControlBehavior, PresenceCompletionHandler)must be invoked. If presence will no longer be needed, usestopPresence(PresenceCompletionHandler)in order to stop the presence subscription.- Returns:
Presenceof this contact.
-
addPresenceListener
void addPresenceListener(PresenceSubscriptionListener presenceSubscriptionListener)
Adds the presence listener to get presence updates for this contact.- Parameters:
presenceSubscriptionListener- The listener to register with this object.
-
removePresenceListener
void removePresenceListener(PresenceSubscriptionListener presenceSubscriptionListener)
Removes the presence listener to stop getting presence updates for this contact.- Parameters:
presenceSubscriptionListener- The listener to unregister from this object.
-
startPresence
void startPresence(AccessControlBehavior accessControlBehavior, PresenceCompletionHandler completionHandler)
Begin monitoring presence for this contact. Once the operation is completed,getPresence()will return the actual presence information for the contact. See also methodstopPresence(PresenceCompletionHandler).- Parameters:
accessControlBehavior- Type of the ACL - confirm policy handling.completionHandler- Completion handler for this operation.
-
stopPresence
void stopPresence(PresenceCompletionHandler completionHandler)
Stop monitoring presence for this contact. Once the operation is completed,getPresence()will not be able to provide the actual user's presence information.- Parameters:
completionHandler- Completion handler for this operation.
-
retrievePicture
void retrievePicture(ContactCompletionHandler handler)
Retrieves the picture for contact. Check if the picture is available using thehasPicture()method.- Parameters:
handler- Completion handler for this operation.- See Also:
removePictureFromCache()
-
removePictureFromCache
void removePictureFromCache()
Removes contact's picture from cache. This method helps to manage the application memory. When the contact picture is not needed, it can be removed and downloaded again in the future.
-
getASCIILastName
ContactStringField getASCIILastName()
Description copied from interface:BaseContactThe non-localized last name.- Specified by:
getASCIILastNamein interfaceBaseContact- Returns:
- Contact string field containing non-localized last name.
-
getASCIIFirstName
ContactStringField getASCIIFirstName()
Description copied from interface:BaseContactThe non-localized first name.- Specified by:
getASCIIFirstNamein interfaceBaseContact- Returns:
- Contact string field containing non-localized first name.
-
getASCIIDisplayName
ContactStringField getASCIIDisplayName()
Description copied from interface:BaseContactThe non-localized display name.- Specified by:
getASCIIDisplayNamein interfaceBaseContact- Returns:
- Contact string field containing non-localized display name.
-
getASCIIAlias
ContactStringField getASCIIAlias()
Description copied from interface:BaseContactThe non-localized alias.- Specified by:
getASCIIAliasin interfaceBaseContact- Returns:
- Contact string field containing a non-localized alias.
-
getNativeLastName
ContactStringField getNativeLastName()
Description copied from interface:BaseContactThe native last name.- Specified by:
getNativeLastNamein interfaceBaseContact- Returns:
- Contact string field containing the native last name.
-
getNativeFirstName
ContactStringField getNativeFirstName()
Description copied from interface:BaseContactThe native first name.- Specified by:
getNativeFirstNamein interfaceBaseContact- Returns:
- Contact string field containing the native first name.
-
getNativeDisplayName
ContactStringField getNativeDisplayName()
Description copied from interface:BaseContactThe native display name.- Specified by:
getNativeDisplayNamein interfaceBaseContact- Returns:
- Contact string field containing the native display name.
-
getNativeAlias
ContactStringField getNativeAlias()
Description copied from interface:BaseContactThe native alias.- Specified by:
getNativeAliasin interfaceBaseContact- Returns:
- Contact string field containing the native alias.
-
getLocation
ContactStringField getLocation()
Description copied from interface:BaseContactThe location.- Specified by:
getLocationin interfaceBaseContact- Returns:
- Contact string field containing the location.
-
getStreetAddress
ContactStringField getStreetAddress()
Description copied from interface:BaseContactThe street address.- Specified by:
getStreetAddressin interfaceBaseContact- Returns:
- Contact string field containing the street address.
-
getCity
ContactStringField getCity()
Description copied from interface:BaseContactThe city.- Specified by:
getCityin interfaceBaseContact- Returns:
- Contact string field containing the city.
-
getState
ContactStringField getState()
Description copied from interface:BaseContactThe state.- Specified by:
getStatein interfaceBaseContact- Returns:
- Contact string field containing the state.
-
getCountry
ContactStringField getCountry()
Description copied from interface:BaseContactThe country.- Specified by:
getCountryin interfaceBaseContact- Returns:
- Contact string field containing the country.
-
getPostalCode
ContactStringField getPostalCode()
Description copied from interface:BaseContactThe postal code.- Specified by:
getPostalCodein interfaceBaseContact- Returns:
- Contact string field containing the postal code.
-
getCompany
ContactStringField getCompany()
Description copied from interface:BaseContactThe company.- Specified by:
getCompanyin interfaceBaseContact- Returns:
- Contact string field containing the company.
-
getDepartment
ContactStringField getDepartment()
Description copied from interface:BaseContactThe department.- Specified by:
getDepartmentin interfaceBaseContact- Returns:
- Contact string field containing the department.
-
getManager
ContactStringField getManager()
Description copied from interface:BaseContactThe name of a person who is a supervisor.- Specified by:
getManagerin interfaceBaseContact- Returns:
- Contact string field containing the name of a person who is a supervisor.
-
getTitle
ContactStringField getTitle()
Description copied from interface:BaseContactThe title or company role.- Specified by:
getTitlein interfaceBaseContact- Returns:
- Contact string field containing the title or company role.
-
getLanguage
ContactStringField getLanguage()
Description copied from interface:BaseContactThe language is per contact record.- Specified by:
getLanguagein interfaceBaseContact- Returns:
- Contact string field containing the language is per contact record.
-
getUniqueAddressForMatching
java.lang.String getUniqueAddressForMatching()
Description copied from interface:BaseContactThe matching/merging address. This parameter can be used as a record's unique id.- Specified by:
getUniqueAddressForMatchingin interfaceBaseContact- Returns:
- Contact string field containing the matching/merging address.
-
getEmailAddresses
ContactEmailAddressFieldList getEmailAddresses()
Description copied from interface:BaseContactThe list of email addresses.- Specified by:
getEmailAddressesin interfaceBaseContact- Returns:
- Contact multi value field containing list of email addresses.
-
getPhoneNumbers
ContactPhoneFieldList getPhoneNumbers()
Description copied from interface:BaseContactThe list of phone numbers.- Specified by:
getPhoneNumbersin interfaceBaseContact- Returns:
- Contact multi value field containing list of phone numbers.
-
getIMAddresses
ContactIMAddressFieldList getIMAddresses()
Description copied from interface:BaseContactThe list of IM addresses.- Specified by:
getIMAddressesin interfaceBaseContact- Returns:
- Contact multi value field containing list of IM addresses.
-
isBuddy
ContactBoolField isBuddy()
Description copied from interface:BaseContactThe buddy flag. Used for presence feature purpose.- Specified by:
isBuddyin interfaceBaseContact- Returns:
- Contact bool field containing the buddy flag.
-
isVIP
ContactBoolField isVIP()
Description copied from interface:BaseContactThe VIP flag.- Specified by:
isVIPin interfaceBaseContact- Returns:
- Contact bool field containing the VIP flag.
-
isFavorite
ContactBoolField isFavorite()
Description copied from interface:BaseContactThe favorite flag.- Specified by:
isFavoritein interfaceBaseContact- Returns:
- Contact bool field containing the favorite flag.
-
getPictureData
byte[] getPictureData()
The contact picture bytes. Picture data can be in jpeg or png format.- Returns:
- byte array containing the contact picture bytes.
-
hasPicture
boolean hasPicture()
Indicating whether contact has a picture.- Returns:
- true if contact has a picture.
-
getIMAttributeValue
ContactStringField getIMAttributeValue()
Deprecated.Always returns empty string.This method is deprecated and always returns empty string.- Returns:
- empty string.
-
getNotes
ContactStringField getNotes()
Description copied from interface:BaseContactThe notes field.- Specified by:
getNotesin interfaceBaseContact- Returns:
- Contact string field containing the notes field.
-
getRank
ContactDoubleField getRank()
Description copied from interface:BaseContactThe rank field defining the contact sorting order. 0.0 value means "No rank". Higher values are sorted toward top of the list.- Specified by:
getRankin interfaceBaseContact- Returns:
- Non-negative double value.
-
getCustom1
ContactMultiValueField<ContactStringField> getCustom1()
Description copied from interface:BaseContactThe list of custom1 values.- Specified by:
getCustom1in interfaceBaseContact- Returns:
- list of custom1 values.
-
getCustom2
ContactMultiValueField<ContactStringField> getCustom2()
Description copied from interface:BaseContactThe list of custom2 values.- Specified by:
getCustom2in interfaceBaseContact- Returns:
- list of custom2 values.
-
getCustom3
ContactMultiValueField<ContactStringField> getCustom3()
Description copied from interface:BaseContactThe list of custom3 values.- Specified by:
getCustom3in interfaceBaseContact- Returns:
- list of custom3 values.
-
getExtraFields
java.util.Map<java.lang.String,ContactField> getExtraFields()
Description copied from interface:BaseContactContact extra fields- Specified by:
getExtraFieldsin interfaceBaseContact- Returns:
- Map object containing contact extra fields as ContactField with String key.
Key values are in
ExtraFieldKeysclass.
-
getContactSources
java.util.Set<ContactSourceType> getContactSources()
Returns list of contact sources- Returns:
- list of contact sources
-
getUpdateContactCapability
Capability getUpdateContactCapability()
Capability indicating whether this contact can be updated. See alsoContactService.updateContact(EditableContact, UpdateContactCompletionHandler)- Returns:
Capabilityobject describing whether or not this particular contact can be changed.
-
getDeleteContactCapability
Capability getDeleteContactCapability()
Capability indicating whether this contact can be deleted. SeeContactService.deleteContact(Contact, ContactCompletionHandler).- Returns:
Capabilityobject describing whether or not this particular contact can be deleted.
-
getAddToGroupCapability
Capability getAddToGroupCapability()
Capability indicating whether this contact can be added to a group.- Returns:
Capabilityobject describing whether or not this particular contact can be added to a group.
-
-