Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.googlecontacts
Class GoogleContactsSourceService

java.lang.Object
  extended by net.java.sip.communicator.impl.googlecontacts.GoogleContactsSourceService
All Implemented Interfaces:
ContactSourceService, ExtendedContactSourceService

public class GoogleContactsSourceService
extends Object
implements ExtendedContactSourceService

Implements ContactSourceService for Google Contacts.

Author:
Sebastien Vincent

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.contactsource.ContactSourceService
CALL_HISTORY
 
Constructor Summary
GoogleContactsSourceService(GoogleContactsConnection cnx)
          Constructor.
GoogleContactsSourceService(String login, String password)
          Constructor.
 
Method Summary
 GoogleContactsConnectionImpl getConnection()
          Returns the Google Contacts connection.
 String getDisplayName()
          Returns a user-friendly string that identifies this contact source.
 String getIdentifier()
          Returns the identifier of this contact source.
 String getLogin()
          Returns login.
 String getPhoneNumberPrefix()
          Returns the phoneNumber prefix for all phone numbers.
 boolean isGoogleTalk()
          Returns whether or not the account has been created via GoogleTalk wizard or via external Google Contacts.
 ContactQuery queryContactSource(Pattern queryPattern)
          Queries this search source for the given searchPattern.
 ContactQuery queryContactSource(Pattern queryPattern, int count)
          Queries this search source for the given searchPattern.
 ContactQuery queryContactSource(String query)
          Queries this search source for the given queryString.
 ContactQuery queryContactSource(String query, int contactCount)
          Queries this search source for the given queryString.
 void setGoogleTalk(boolean googleTalk)
          Set whether or not the account has been created via GoogleTalk wizard or external Google contacts.
 void setPhoneNumberPrefix(String phoneNumberprefix)
          Sets the phone number prefix.
 void stop()
          Stops this ContactSourceService implementation and prepares it for garbage collection.
(package private)  void stopped(GoogleContactsQuery query)
          Notifies this GoogleContactsSourceService that a specific GoogleContactsQuery has stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GoogleContactsSourceService

public GoogleContactsSourceService(String login,
                                   String password)
Constructor.

Parameters:
login - login
password - password

GoogleContactsSourceService

public GoogleContactsSourceService(GoogleContactsConnection cnx)
Constructor.

Parameters:
cnx - connection
Method Detail

getLogin

public String getLogin()
Returns login.

Returns:
login

setGoogleTalk

public void setGoogleTalk(boolean googleTalk)
Set whether or not the account has been created via GoogleTalk wizard or external Google contacts.

Parameters:
googleTalk - value to set

isGoogleTalk

public boolean isGoogleTalk()
Returns whether or not the account has been created via GoogleTalk wizard or via external Google Contacts.

Returns:
true if account has been created via GoogleTalk wizard or via external Google Contacts.

queryContactSource

public ContactQuery queryContactSource(Pattern queryPattern)
Queries this search source for the given searchPattern.

Specified by:
queryContactSource in interface ExtendedContactSourceService
Parameters:
queryPattern - the pattern to search for
Returns:
the created query

queryContactSource

public ContactQuery queryContactSource(Pattern queryPattern,
                                       int count)
Queries this search source for the given searchPattern.

Parameters:
queryPattern - the pattern to search for
count - maximum number of contact returned
Returns:
the created query

getConnection

public GoogleContactsConnectionImpl getConnection()
Returns the Google Contacts connection.

Returns:
Google Contacts connection

getDisplayName

public String getDisplayName()
Returns a user-friendly string that identifies this contact source.

Specified by:
getDisplayName in interface ContactSourceService
Returns:
the display name of this contact source

getIdentifier

public String getIdentifier()
Returns the identifier of this contact source. Some of the common identifiers are defined here (For example the CALL_HISTORY identifier should be returned by all call history implementations of this interface)

Specified by:
getIdentifier in interface ContactSourceService
Returns:
the identifier of this contact source

queryContactSource

public ContactQuery queryContactSource(String query)
Queries this search source for the given queryString.

Specified by:
queryContactSource in interface ContactSourceService
Parameters:
query - the string to search for
Returns:
the created query

queryContactSource

public ContactQuery queryContactSource(String query,
                                       int contactCount)
Queries this search source for the given queryString.

Specified by:
queryContactSource in interface ContactSourceService
Parameters:
query - the string to search for
contactCount - the maximum count of result contacts
Returns:
the created query

stop

public void stop()
Stops this ContactSourceService implementation and prepares it for garbage collection.

See Also:
AsyncContactSourceService.stop()

stopped

void stopped(GoogleContactsQuery query)
Notifies this GoogleContactsSourceService that a specific GoogleContactsQuery has stopped.

Parameters:
query - the GoogleContactsQuery which has stopped

getPhoneNumberPrefix

public String getPhoneNumberPrefix()
Returns the phoneNumber prefix for all phone numbers.

Specified by:
getPhoneNumberPrefix in interface ExtendedContactSourceService
Returns:
the phoneNumber prefix for all phone numbers

setPhoneNumberPrefix

public void setPhoneNumberPrefix(String phoneNumberprefix)
Sets the phone number prefix.

Parameters:
phoneNumberprefix - the phone number prefix to set

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.