public class GoogleContactsServiceImpl extends java.lang.Object implements GoogleContactsService
MAX_RESULT
contacts from Google Contacts then
we filter it to get MAX_RESULT
that matched our query.
If MAX_RESULT
is not reach, we try with additional
contacts (if there are more than MAX_RESULT
contacts).Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
CONFIGURATION_PATH
Path where to store the account settings
|
static int |
MAX_NUMBER
Maximum number of contacts retrieved for a query.
|
static int |
MAX_RESULT
Maximum number of results for a query.
|
Constructor and Description |
---|
GoogleContactsServiceImpl()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addContactSource(GoogleContactsConnection cnx,
boolean googleTalk)
Add a contact source service with the specified
GoogleContactsConnection.
|
void |
addContactSource(java.lang.String login)
Add a contact source service with the specified
GoogleContactsConnection.
|
static byte[] |
downloadPhoto(com.google.gdata.data.ILink photoLink,
com.google.gdata.client.contacts.ContactsService service)
Retrieve photo of a contact.
|
java.util.List<GoogleContactsConnectionImpl> |
getAccounts()
Get list of stored connections.
|
GoogleContactsConnection |
getConnection(java.lang.String login)
Get a GoogleContactsConnection.
|
java.util.List<GoogleContactsEntry> |
getContacts()
Get the full contacts list.
|
void |
removeConfig(GoogleContactsConnection cnx)
Remove a connection.
|
void |
removeContactSource(GoogleContactsConnection cnx)
Add a contact source service with the specified.
|
void |
removeContactSource(java.lang.String login)
Remove a contact source service with the specified
GoogleContactsConnection.
|
void |
saveConfig(GoogleContactsConnection cnx)
Save configuration.
|
java.util.List<GoogleContactsEntry> |
searchContact(GoogleContactsConnection cnx,
GoogleQuery gQuery,
int count,
GoogleEntryCallback callback)
Perform a search for a contact using regular expression.
|
public static final int MAX_RESULT
public static final int MAX_NUMBER
static final java.lang.String CONFIGURATION_PATH
public java.util.List<GoogleContactsConnectionImpl> getAccounts()
public void removeConfig(GoogleContactsConnection cnx)
cnx
- connection to savepublic void saveConfig(GoogleContactsConnection cnx)
cnx
- connection to savepublic java.util.List<GoogleContactsEntry> searchContact(GoogleContactsConnection cnx, GoogleQuery gQuery, int count, GoogleEntryCallback callback)
searchContact
in interface GoogleContactsService
cnx
- GoogleContactsConnection to perform the querygQuery
- Google querycount
- maximum number of matched contactscallback
- object that will be notified for each new
GoogleContactsEntry foundpublic java.util.List<GoogleContactsEntry> getContacts()
getContacts
in interface GoogleContactsService
public GoogleContactsConnection getConnection(java.lang.String login)
getConnection
in interface GoogleContactsService
login
- login to connect to the servicepublic void addContactSource(GoogleContactsConnection cnx, boolean googleTalk)
addContactSource
in interface GoogleContactsService
cnx
- GoogleContactsConnection.googleTalk
- if the contact source has been created as GoogleTalk
account or via external Google Contactspublic void addContactSource(java.lang.String login)
addContactSource
in interface GoogleContactsService
login
- loginpublic void removeContactSource(GoogleContactsConnection cnx)
removeContactSource
in interface GoogleContactsService
cnx
- GoogleContactsConnection.public void removeContactSource(java.lang.String login)
removeContactSource
in interface GoogleContactsService
login
- loginpublic static byte[] downloadPhoto(com.google.gdata.data.ILink photoLink, com.google.gdata.client.contacts.ContactsService service)
photoLink
- photo linkservice
-
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.