Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.contactsource
Interface ContactQuery

All Known Implementing Classes:
AbstractContactQuery, AsyncContactQuery, GoogleContactsQuery, LdapContactQuery, MacOSXAddrBookContactQuery, MsOutlookAddrBookContactQuery

public interface ContactQuery

The ContactQuery corresponds to a particular query made through the ContactSourceService. Each query once started could be canceled. One could also register a listener in order to be notified for changes in query status and query contact results.

Author:
Yana Stamcheva

Field Summary
static int QUERY_CANCELED
          Indicates that this query has been canceled.
static int QUERY_COMPLETED
          Indicates that this query has been completed.
static int QUERY_ERROR
          Indicates that this query has been stopped because of an error.
static int QUERY_IN_PROGRESS
          Indicates that this query is in progress.
 
Method Summary
 void addContactQueryListener(ContactQueryListener l)
          Adds the given ContactQueryListener to the list of registered listeners.
 void cancel()
          Cancels this query.
 ContactSourceService getContactSource()
          Returns the ContactSourceService, where this query was first initiated.
 List<SourceContact> getQueryResults()
          Returns the list of SourceContacts returned by this query.
 String getQueryString()
          Returns the query string, this query was created for.
 int getStatus()
          Returns the status of this query.
 void removeContactQueryListener(ContactQueryListener l)
          Removes the given ContactQueryListener to the list of registered listeners.
 

Field Detail

QUERY_COMPLETED

static final int QUERY_COMPLETED
Indicates that this query has been completed.

See Also:
Constant Field Values

QUERY_CANCELED

static final int QUERY_CANCELED
Indicates that this query has been canceled.

See Also:
Constant Field Values

QUERY_ERROR

static final int QUERY_ERROR
Indicates that this query has been stopped because of an error.

See Also:
Constant Field Values

QUERY_IN_PROGRESS

static final int QUERY_IN_PROGRESS
Indicates that this query is in progress.

See Also:
Constant Field Values
Method Detail

getContactSource

ContactSourceService getContactSource()
Returns the ContactSourceService, where this query was first initiated.

Returns:
the ContactSourceService, where this query was first initiated

getQueryString

String getQueryString()
Returns the query string, this query was created for.

Returns:
the query string, this query was created for

getQueryResults

List<SourceContact> getQueryResults()
Returns the list of SourceContacts returned by this query.

Returns:
the list of SourceContacts returned by this query

cancel

void cancel()
Cancels this query.


getStatus

int getStatus()
Returns the status of this query. One of the static constants QUERY_XXXX defined in this class.

Returns:
the status of this query

addContactQueryListener

void addContactQueryListener(ContactQueryListener l)
Adds the given ContactQueryListener to the list of registered listeners. The ContactQueryListener would be notified each time a new ContactQuery result has been received or if the query has been completed or has been canceled by user or for any other reason.

Parameters:
l - the ContactQueryListener to add

removeContactQueryListener

void removeContactQueryListener(ContactQueryListener l)
Removes the given ContactQueryListener to the list of registered listeners. The ContactQueryListener would be notified each time a new ContactQuery result has been received or if the query has been completed or has been canceled by user or for any other reason.

Parameters:
l - the ContactQueryListener to remove

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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