com.genesyslab.ail
Interface ContactManager


public interface ContactManager

Manager of contacts. Entry point for contact management.

Note: If the DATABASE service is not available, that is, if UCS is not connected, you cannot get features associated with UCS, that is, this contact manager.


Method Summary
 java.lang.Integer countContacts(SearchContactTemplate searchTemplate)
          Returns the number of contacts matching the search request.
 Contact createContact()
          Creates a new Contact with no information.
 Contact createContact(java.util.Map values)
          Creates and saves a new Contact with information.
 Contact createContact(java.lang.String title, java.lang.String first_name, java.lang.String last_name, java.lang.String email_address, java.lang.String phone_number)
          Creates a new Contact with this information.
 SearchContactTemplate createSearchContactTemplate()
          Creates an empty SearchContactTemplate instance.
 java.util.Collection findOrCreateContact(java.util.Map searchCreateParams)
          Finds a collection of contact identifiers associated with these parameters or create a contact for these new parameters.
 java.util.Collection getAllContactAttributeMetaData()
          Returns the Collection of all attributes types of a contact.
 Contact getContact(java.lang.String id)
          Returns the Contact with this ID.
 Contact getContact(java.lang.String id, java.util.Collection aCAMDCol)
          Returns the Contact of this ID.
 ContactAttributeMetaData getContactAttributeMetaDataById(java.lang.String attributeName)
          Gets the predefined ContactAttributeMetaData instance for an existing attribute ID.
 ContactAttributeMetaData getContactAttributeMetaDataByName(java.lang.String attributeName)
          Gets the predefined ContactAttributeMetaData instance for an existing attribute.
 ContactAttributeMetaData getEmailAddressAttribute()
          Gets the predefined ContactAttributeMetaData instance for the EmailAddress attribute.
 ContactAttributeMetaData getFirstNameAttribute()
          Gets the predefined ContactAttributeMetaData instance for the FirstName attribute.
 ContactAttributeMetaData getLastNameAttribute()
          Gets the predefined ContactAttributeMetaData instance for the LastName attribute.
 ContactAttributeMetaData getPhoneNumberAttribute()
          Gets the predefined ContactAttributeMetaData instance for the PhoneNumber attribute.
 ContactAttributeMetaData getTitleAttribute()
          Gets the predefined ContactAttributeMetaData instance for the Title attribute.
 boolean isSearchPrimaryValueOnly()
          Indicates whether the connected UCS searches on primary values only.
 java.util.Collection searchContact(SearchContactTemplate aSearchTemplate)
          Returns all the contacts as a Collection of Contact.
 

Method Detail

createContact

Contact createContact(java.lang.String title,
                      java.lang.String first_name,
                      java.lang.String last_name,
                      java.lang.String email_address,
                      java.lang.String phone_number)
                      throws RequestFailedException
Creates a new Contact with this information.

Parameters:
title - a title like Dr., Mr., Mrs. Use getTitleAttribute() to get the list of configured titles.
first_name - the first name of the contact.
last_name - the last name of the contact.
email_address - the primary e-mail address of the contact.
phone_number - the primary phone number of the contact.
Returns:
the newly created Contact.
Throws:
InvalidParameterException - if the parameter is null or invalid.
DatabaseServiceException - if the database service is out of order.
RequestFailedException - if request cannot proceed.

createContact

Contact createContact()
                      throws RequestFailedException
Creates a new Contact with no information.

Returns:
the newly created Contact.
Throws:
RequestFailedException - if request cannot proceed.
Since:
G7.0

createContact

Contact createContact(java.util.Map values)
                      throws RequestFailedException
Creates and saves a new Contact with information.

Parameters:
values - Map of attribute names as ContactAttributeMetaData with list of ContactAttributeValue instances.
Returns:
the newly created Contact.
Throws:
InvalidParameterException - if the parameter is null or invalid.
DatabaseServiceException - if the database service is out of order.
RequestFailedException - if request cannot proceed.
Since:
G7.0

getContact

Contact getContact(java.lang.String id,
                   java.util.Collection aCAMDCol)
                   throws RequestFailedException
Returns the Contact of this ID. Returns null if no Contact associated with this ID could be found

Parameters:
id - the ID of the Contact to get.
aCAMDCol - collection of ContactAttributeMetaData to retrieve. If this parameter is null, returns the Contact with all the contact attributes.
Returns:
the Contact with this ID, or null.
Throws:
InvalidParameterException - if the parameter is null or invalid.
DatabaseServiceException - if the database service is out of order.
RequestFailedException - if the service cannot fulfill the request.

getContact

Contact getContact(java.lang.String id)
                   throws RequestFailedException
Returns the Contact with this ID. Returns null if no Contact with this ID could be found.
Note: The returned Contact is empty.

Parameters:
id - the ID of the Contact to get.
Returns:
the Contact with this ID, or null.
Throws:
InvalidParameterException - if the parameter is null or invalid.
DatabaseServiceException - if the database service is out of order.
RequestFailedException - if the service cannot fulfill the request.

countContacts

java.lang.Integer countContacts(SearchContactTemplate searchTemplate)
                                throws RequestFailedException
Returns the number of contacts matching the search request.

Parameters:
searchTemplate - as a SearchContactTemplate instance.
Throws:
InvalidParameterException - if one parameter is invalid.
DatabaseServiceException - if the database service cannot fulfill the request.
RequestFailedException - if the service cannot fulfill the request.
Since:
7.6.4

searchContact

java.util.Collection searchContact(SearchContactTemplate aSearchTemplate)
                                   throws RequestFailedException
Returns all the contacts as a Collection of Contact. The contacts are sorted, and you may ask for a slice within this list. You may also ask for the contacts whose name contains a certain String.

BE CAREFUL: According to the search contact template, retrieved contacts may be partial sets (attributes) of real contacts in Contact Server. You must consider that this returned list of contacts is in read-only mode, if you want to handle contact (add, remove attributes), you must use getContact method that can give you a full contact (with all attributes).

Parameters:
aSearchTemplate - as a SearchContactTemplate instance.
Returns:
a Collection of sorted Contact instances.
Throws:
InvalidParameterException - if one of the parameters is invalid.
DatabaseServiceException - if the database service cannot fulfill the request.
RequestFailedException - if the service cannot fulfill the request.
Since:
G7.0

getAllContactAttributeMetaData

java.util.Collection getAllContactAttributeMetaData()
Returns the Collection of all attributes types of a contact.

Returns:
a List of ContactAttributeMetaData instances.
Since:
G7.0

createSearchContactTemplate

SearchContactTemplate createSearchContactTemplate()
Creates an empty SearchContactTemplate instance.

Returns:
an empty SearchContactTemplate instance.

getFirstNameAttribute

ContactAttributeMetaData getFirstNameAttribute()
Gets the predefined ContactAttributeMetaData instance for the FirstName attribute.

Returns:
ContactAttributeMetaData instance for FirstName.

getTitleAttribute

ContactAttributeMetaData getTitleAttribute()
Gets the predefined ContactAttributeMetaData instance for the Title attribute.

Returns:
ContactAttributeMetaData instance for Title.

getLastNameAttribute

ContactAttributeMetaData getLastNameAttribute()
Gets the predefined ContactAttributeMetaData instance for the LastName attribute.

Returns:
ContactAttributeMetaData instance for LastName.

getEmailAddressAttribute

ContactAttributeMetaData getEmailAddressAttribute()
Gets the predefined ContactAttributeMetaData instance for the EmailAddress attribute.

Returns:
ContactAttributeMetaData instance for EmailAddress.

getPhoneNumberAttribute

ContactAttributeMetaData getPhoneNumberAttribute()
Gets the predefined ContactAttributeMetaData instance for the PhoneNumber attribute.

Returns:
ContactAttributeMetaData instance for PhoneNumber.

getContactAttributeMetaDataByName

ContactAttributeMetaData getContactAttributeMetaDataByName(java.lang.String attributeName)
Gets the predefined ContactAttributeMetaData instance for an existing attribute.

Parameters:
attributeName - the name of the attribute
Returns:
ContactAttributeMetaData instance for this attributeName.

getContactAttributeMetaDataById

ContactAttributeMetaData getContactAttributeMetaDataById(java.lang.String attributeName)
Gets the predefined ContactAttributeMetaData instance for an existing attribute ID.

Parameters:
attributeName - the name of the attribute.
Returns:
ContactAttributeMetaData instance for this ID.

findOrCreateContact

java.util.Collection findOrCreateContact(java.util.Map searchCreateParams)
                                         throws RequestFailedException
Finds a collection of contact identifiers associated with these parameters or create a contact for these new parameters. You could also set parameter: 'MediaType' key with 'voice' or 'email'... value in order to use Contact Server Custom Lookup algorithm.

Parameters:
searchCreateParams - a Map of string attribute name and string value for searching and/or creating the Contact instance.
Returns:
a collection of contact ID as String instance or empty collection.
Throws:
InvalidParameterException - if the parameter is null or invalid.
DatabaseServiceException - if the database service is out of order.
RequestFailedException - if the service cannot fulfill the request.

isSearchPrimaryValueOnly

boolean isSearchPrimaryValueOnly()
Indicates whether the connected UCS searches on primary values only.

Returns:
true if UCS searches for primary values only.