/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.contactsource;
import java.util.regex.*;
/**
* Declares the interface of a ContactSourceService which performs
* ContactQuerys in a separate Thread.
*
* @author Lyubomir Marinov
*/
public abstract class AsyncContactSourceService
implements ExtendedContactSourceService
{
/**
* Queries this ContactSourceService for SourceContacts
* which match a specific query String.
*
* @param query the String which this ContactSourceService
* is being queried for
* @return a ContactQuery which represents the query of this
* ContactSourceService implementation for the specified
* String and via which the matching SourceContacts (if
* any) will be returned
* @see ContactSourceService#queryContactSource(String)
*/
public ContactQuery queryContactSource(String query)
{
return queryContactSource(
Pattern.compile(query, Pattern.CASE_INSENSITIVE | Pattern.LITERAL));
}
/**
* Queries this ContactSourceService for SourceContacts
* which match a specific query String.
*
* @param query the String which this ContactSourceService
* is being queried for
* @param contactCount the maximum count of result contacts
* @return a ContactQuery which represents the query of this
* ContactSourceService implementation for the specified
* String and via which the matching SourceContacts (if
* any) will be returned
* @see ContactSourceService#queryContactSource(String)
*/
public ContactQuery queryContactSource(String query, int contactCount)
{
return queryContactSource(
Pattern.compile(query, Pattern.CASE_INSENSITIVE | Pattern.LITERAL));
}
/**
* Stops this ContactSourceService.
*/
public abstract void stop();
}