Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.ldap
Class LdapContactSourceService

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

public class LdapContactSourceService
extends Object
implements ExtendedContactSourceService

Implements ContactSourceService for LDAP.

In contrast to other contact source implementations like AddressBook and Outlook the LDAP contact source implementation is explicitly moved to the "impl.ldap" package in order to allow us to create LDAP contact sources for ldap directories through the LdapService.

Author:
Sebastien Vincent

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.contactsource.ContactSourceService
CALL_HISTORY
 
Constructor Summary
LdapContactSourceService(LdapDirectory ldapDirectory)
          Constructor.
 
Method Summary
 String getDisplayName()
          Returns a user-friendly string that identifies this contact source.
 String getIdentifier()
          Returns the identifier of this contact source.
 LdapDirectory getLdapDirectory()
          Get LDAP directory.
 String getPhoneNumberPrefix()
          Returns the phoneNumber prefix for all phone numbers.
 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 stop()
          Stops this ContactSourceService implementation and prepares it for garbage collection.
(package private)  void stopped(LdapContactQuery query)
          Notifies this LdapContactSourceService that a specific LdapContactQuery has stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapContactSourceService

public LdapContactSourceService(LdapDirectory ldapDirectory)
Constructor.

Parameters:
ldapDirectory - LDAP directory
Method Detail

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

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()

getLdapDirectory

public LdapDirectory getLdapDirectory()
Get LDAP directory.

Returns:
LDAP directory

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

stopped

void stopped(LdapContactQuery query)
Notifies this LdapContactSourceService that a specific LdapContactQuery has stopped.

Parameters:
query - the LdapContactQuery which has stopped

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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