public class GoogleContactsConnectionImpl extends java.lang.Object implements GoogleContactsConnection
Modifier and Type | Class and Description |
---|---|
static class |
GoogleContactsConnectionImpl.FailedContactQueryException
Exception for signaling failed contact query.
|
GoogleContactsConnection.ConnectionStatus
Constructor and Description |
---|
GoogleContactsConnectionImpl(java.lang.String login)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
GoogleContactsConnection.ConnectionStatus |
connect()
Initialize connection.
|
com.google.gdata.client.contacts.ContactsService |
getGoogleService()
Returns the Google service.
|
java.lang.String |
getLogin()
Get login.
|
java.lang.String |
getPrefix()
Returns the google contacts phone number prefix.
|
boolean |
isEnabled()
Returns if the connection is enabled.
|
com.google.gdata.data.contacts.ContactFeed |
query(com.google.gdata.client.contacts.ContactQuery query)
Query for contacts using provided ContactQuery.
|
void |
setEnabled(boolean enabled)
Set the connection to be enabled or not.
|
void |
setLogin(java.lang.String login)
Set login.
|
void |
setPrefix(java.lang.String prefix)
Sets the google contacts prefix.
|
public GoogleContactsConnectionImpl(java.lang.String login)
login
- the login to connect to the servicepublic com.google.gdata.client.contacts.ContactsService getGoogleService()
public java.lang.String getLogin()
getLogin
in interface GoogleContactsConnection
public void setLogin(java.lang.String login)
setLogin
in interface GoogleContactsConnection
login
- login to connect to the servicepublic GoogleContactsConnection.ConnectionStatus connect()
connect
in interface GoogleContactsConnection
public com.google.gdata.data.contacts.ContactFeed query(com.google.gdata.client.contacts.ContactQuery query) throws java.io.IOException, com.google.gdata.util.ServiceException, GoogleContactsConnectionImpl.FailedContactQueryException, OAuth2TokenStore.FailedTokenRefreshException
query
- the contact queryjava.io.IOException
com.google.gdata.util.ServiceException
GoogleContactsConnectionImpl.FailedContactQueryException
- Throws in case of failed query.OAuth2TokenStore.FailedTokenRefreshException
- Throws in case refreshing OAuth2
token fails.public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- value to setpublic void setPrefix(java.lang.String prefix)
prefix
- the phone number prefix to setpublic java.lang.String getPrefix()
getPrefix
in interface GoogleContactsConnection
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.