Blue Mind
Release 1.0

net.bluemind.core.api.services
Interface IAddressBook

All Known Implementing Classes:
BookClient

public interface IAddressBook

Contact and Folder APIs. Blue Mind provides client and server side implementations of this interface.


Method Summary
 ResultList<Contact> advancedSearchContact(AccessToken token, ContactQuery query)
          Solr based contact search
 Contact create(AccessToken token, Contact contact)
          Creates a new Contact.
 Folder createFolder(AccessToken token, Folder f)
          Creates a new contact Folder
 Contact createWithoutDuplicate(AccessToken token, Contact contact)
          Creates a Contact after checking if a similar one exists.
 Contact deleteContact(AccessToken token, java.lang.String id)
          Delete contact
 void deleteFolder(AccessToken token, int id)
           
 FolderChanges doFolderSync(AccessToken token, ClientFolderChanges clientChanges, java.util.Date lastSync, java.lang.Boolean addDefaults)
          This method is a one-shot transactional synchronization API for Folder objects.
 ContactChanges doSync(AccessToken token, ClientContactChanges clientChanges, SyncScope scope, java.util.Date pit)
          This method is a one-shot transactional synchronization API for Contact objects.
 java.lang.String exportAllVCards(AccessToken token, java.lang.String query)
          Returns a vcard for all the contacts matching a given solr query
 java.lang.String exportFolderVcards(AccessToken token, int folderId)
          Creates a vcard for all the Contact in a Folder with the provided id
 java.lang.String exportVCard(AccessToken token, int id)
          Returns a vcard for a given Contact id
 java.util.List<Folder> findFolders(AccessToken token)
           
 java.util.List<Folder> findFolders(AccessToken token, FolderQuery fq)
           
 ResultList<Folder> findFoldersFromPattern(AccessToken token, java.lang.String pattern)
           
 Contact getContactFromId(AccessToken token, java.lang.String id)
          Fetch a Contact from its unique id
 Folder getFolderFromId(AccessToken token, int id)
          Fetch a Folder with its unique id
 FolderChanges getFolderSync(AccessToken token, java.util.Date lastSync, java.lang.Boolean addDefaults)
          Deprecated. use doFolderSync(AccessToken, ClientFolderChanges, Date, Boolean) instead
 Contact getPublicCollectedFromEmail(AccessToken token, java.lang.String email)
          Returns a non-null Contact if a contact with the given email exists in the public_collected folder from the token's domain.
 java.util.List<Folder> getSubscribedFolders(AccessToken token, int userId)
           
 java.util.List<Contact> importAllVCards(AccessToken token, Folder f, java.lang.String vCard)
           
 Contact importVCard(AccessToken token, Folder f, java.lang.String vCard)
          Imports a vcard containing exactly one contact in the given folder.
 ResultList<Contact> searchContact(AccessToken token, ContactQuery cq, int limit)
          SQL based contact search, suitable ONLY for autocomplete as this method also returns groups & shared mailboxes as "fake" contacts.
 void setFolderSubscription(AccessToken token, int userId, java.util.List<java.lang.Integer> folders)
           
 void setFolderSync(AccessToken token, Folder f, boolean value)
          Marks a folder for synchronization for the token user.
 void subscribreMassUserFromAFolder(AccessToken token, int folderId, java.util.List<java.lang.Integer> users)
          Subscribes a bunch of users to a given folder id
 void unsetFolderSubscription(AccessToken token, int userId, java.util.List<java.lang.Integer> folders)
           
 void unsubscribreMassUserFromAFolder(AccessToken token, int folderId, java.util.List<java.lang.Integer> users)
          Un-subscribes a bunch of users from a given folder id
 Contact update(AccessToken token, Contact contact)
          Modifies an existing Contact.
 Folder updateFolder(AccessToken token, Folder f)
          Modifies an existing Folder (its name, etc)
 void waitForIndexing(AccessToken token)
          This is for unit testing only.
 

Method Detail

create

Contact create(AccessToken token,
               Contact contact)
               throws AuthFault,
                      ServerFault
Creates a new Contact. The returned contact returns a positive id from Entity.getId().

Parameters:
token -
contact -
Returns:
Throws:
AuthFault
ServerFault

createWithoutDuplicate

Contact createWithoutDuplicate(AccessToken token,
                               Contact contact)
                               throws AuthFault,
                                      ServerFault
Creates a Contact after checking if a similar one exists. Returns the existing contact if a similar one is found. Search for similar contact is performed in one Folder if a folderId is set on the contact. Similar contacts are detected using lastname, email and mobile phone number.

Parameters:
token -
contact -
Returns:
Throws:
AuthFault
ServerFault

update

Contact update(AccessToken token,
               Contact contact)
               throws AuthFault,
                      ServerFault
Modifies an existing Contact. Entity.getId() on the given contact must return a positive integer for the update to succeed.

Parameters:
token -
contact -
Returns:
Throws:
AuthFault
ServerFault

deleteContact

Contact deleteContact(AccessToken token,
                      java.lang.String id)
                      throws AuthFault,
                             ServerFault
Delete contact

Parameters:
token -
id - contact ID
Returns:
Throws:
AuthFault
ServerFault

searchContact

ResultList<Contact> searchContact(AccessToken token,
                                  ContactQuery cq,
                                  int limit)
                                  throws AuthFault,
                                         ServerFault
SQL based contact search, suitable ONLY for autocomplete as this method also returns groups & shared mailboxes as "fake" contacts. The id in the returned contacts are entity ids, not real contact ids.

Parameters:
token -
cq -
limit -
Returns:
Throws:
AuthFault
ServerFault

advancedSearchContact

ResultList<Contact> advancedSearchContact(AccessToken token,
                                          ContactQuery query)
                                          throws AuthFault,
                                                 ServerFault
Solr based contact search

Parameters:
token -
query -
Returns:
The list of Contact matching the query.
Throws:
AuthFault
ServerFault

getContactFromId

Contact getContactFromId(AccessToken token,
                         java.lang.String id)
                         throws AuthFault,
                                ServerFault
Fetch a Contact from its unique id

Parameters:
token -
id -
Returns:
Throws:
AuthFault
ServerFault

getFolderSync

FolderChanges getFolderSync(AccessToken token,
                            java.util.Date lastSync,
                            java.lang.Boolean addDefaults)
                            throws AuthFault,
                                   ServerFault
Deprecated. use doFolderSync(AccessToken, ClientFolderChanges, Date, Boolean) instead

Parameters:
token -
lastSync -
addDefaults -
Returns:
Throws:
AuthFault
ServerFault

getFolderFromId

Folder getFolderFromId(AccessToken token,
                       int id)
                       throws AuthFault,
                              ServerFault
Fetch a Folder with its unique id

Parameters:
token -
id -
Returns:
Throws:
AuthFault
ServerFault

createFolder

Folder createFolder(AccessToken token,
                    Folder f)
                    throws AuthFault,
                           ServerFault
Creates a new contact Folder

Parameters:
token -
f - the folder to create
Returns:
Throws:
AuthFault
ServerFault

updateFolder

Folder updateFolder(AccessToken token,
                    Folder f)
                    throws AuthFault,
                           ServerFault
Modifies an existing Folder (its name, etc)

Parameters:
token -
f -
Returns:
Throws:
AuthFault
ServerFault

deleteFolder

void deleteFolder(AccessToken token,
                  int id)
                  throws AuthFault,
                         ServerFault
Throws:
AuthFault
ServerFault

setFolderSync

void setFolderSync(AccessToken token,
                   Folder f,
                   boolean value)
                   throws AuthFault,
                          ServerFault
Marks a folder for synchronization for the token user. Look at setFolderSubscription(AccessToken, int, List) for multiple subscriptions.

Parameters:
token -
f -
value -
Throws:
AuthFault
ServerFault

exportVCard

java.lang.String exportVCard(AccessToken token,
                             int id)
                             throws ServerFault,
                                    AuthFault
Returns a vcard for a given Contact id

Parameters:
token -
id -
Returns:
Throws:
ServerFault
AuthFault

exportAllVCards

java.lang.String exportAllVCards(AccessToken token,
                                 java.lang.String query)
                                 throws ServerFault,
                                        AuthFault
Returns a vcard for all the contacts matching a given solr query

Parameters:
token -
query - the solr query
Returns:
Throws:
ServerFault
AuthFault

exportFolderVcards

java.lang.String exportFolderVcards(AccessToken token,
                                    int folderId)
                                    throws ServerFault,
                                           AuthFault
Creates a vcard for all the Contact in a Folder with the provided id

Parameters:
token -
folderId -
Returns:
Throws:
ServerFault
AuthFault

importVCard

Contact importVCard(AccessToken token,
                    Folder f,
                    java.lang.String vCard)
                    throws ServerFault,
                           AuthFault
Imports a vcard containing exactly one contact in the given folder.

Parameters:
token -
f -
vCard -
Returns:
Throws:
ServerFault
AuthFault

importAllVCards

java.util.List<Contact> importAllVCards(AccessToken token,
                                        Folder f,
                                        java.lang.String vCard)
                                        throws ServerFault,
                                               AuthFault
Throws:
ServerFault
AuthFault

findFolders

java.util.List<Folder> findFolders(AccessToken token)
                                   throws ServerFault,
                                          AuthFault
Parameters:
token -
Returns:
Throws:
ServerFault
AuthFault

doSync

ContactChanges doSync(AccessToken token,
                      ClientContactChanges clientChanges,
                      SyncScope scope,
                      java.util.Date pit)
                      throws AuthFault,
                             ServerFault
This method is a one-shot transactional synchronization API for Contact objects. The caller submits all the changes (clientChanges ) that happened on his side since the pit point in time. The method checks what happened on the server side since the point in time. Using the changes wanted by the caller and what happened on the server sides, client changes are applied. When conflicts are detected, this method will resolve them. A list of changes ContactChanges that the caller MUST apply is returned, marking a new point in time for the next doSync call.

Parameters:
token -
clientChanges - The changes that happened on the caller side.
pit - The point in time for changes.
Returns:
The conflict-resolved list of changes that the caller must apply.
Throws:
AuthFault
ServerFault

doFolderSync

FolderChanges doFolderSync(AccessToken token,
                           ClientFolderChanges clientChanges,
                           java.util.Date lastSync,
                           java.lang.Boolean addDefaults)
                           throws AuthFault,
                                  ServerFault
This method is a one-shot transactional synchronization API for Folder objects. The caller submits all the changes (clientChanges ) that happened on his side since the lastSync point in time. The method checks what happened on the server side since the point in time. Using the changes wanted by the caller and what happened on the server sides, client changes are applied. When conflicts are detected, this method will resolve them. A list of changes ContactChanges that the caller MUST apply is returned, marking a new point in time for the next doSync call.

Parameters:
token -
clientChanges - The changes that happened on the caller side.
lastSync - The point in time for changes.
addDefaults -
Returns:
Throws:
AuthFault
ServerFault

waitForIndexing

void waitForIndexing(AccessToken token)
                     throws AuthFault,
                            ServerFault
This is for unit testing only. Real code MUST not depend on solr indexing completion.

Parameters:
token -
Throws:
AuthFault
ServerFault

findFolders

java.util.List<Folder> findFolders(AccessToken token,
                                   FolderQuery fq)
                                   throws AuthFault,
                                          ServerFault
Throws:
AuthFault
ServerFault

findFoldersFromPattern

ResultList<Folder> findFoldersFromPattern(AccessToken token,
                                          java.lang.String pattern)
                                          throws AuthFault,
                                                 ServerFault
Throws:
AuthFault
ServerFault

setFolderSubscription

void setFolderSubscription(AccessToken token,
                           int userId,
                           java.util.List<java.lang.Integer> folders)
                           throws AuthFault,
                                  ServerFault
Throws:
AuthFault
ServerFault

getSubscribedFolders

java.util.List<Folder> getSubscribedFolders(AccessToken token,
                                            int userId)
                                            throws AuthFault,
                                                   ServerFault
Throws:
AuthFault
ServerFault

unsetFolderSubscription

void unsetFolderSubscription(AccessToken token,
                             int userId,
                             java.util.List<java.lang.Integer> folders)
                             throws AuthFault,
                                    ServerFault
Throws:
AuthFault
ServerFault

subscribreMassUserFromAFolder

void subscribreMassUserFromAFolder(AccessToken token,
                                   int folderId,
                                   java.util.List<java.lang.Integer> users)
                                   throws AuthFault,
                                          ServerFault
Subscribes a bunch of users to a given folder id

Parameters:
token -
folderId -
users -
Throws:
AuthFault
ServerFault

unsubscribreMassUserFromAFolder

void unsubscribreMassUserFromAFolder(AccessToken token,
                                     int folderId,
                                     java.util.List<java.lang.Integer> users)
                                     throws AuthFault,
                                            ServerFault
Un-subscribes a bunch of users from a given folder id

Parameters:
token -
folderId -
users -
Throws:
AuthFault
ServerFault

getPublicCollectedFromEmail

Contact getPublicCollectedFromEmail(AccessToken token,
                                    java.lang.String email)
                                    throws AuthFault,
                                           ServerFault
Returns a non-null Contact if a contact with the given email exists in the public_collected folder from the token's domain.

Parameters:
token -
email -
Returns:
Throws:
AuthFault
ServerFault

Blue Mind
Release 1.0