public class UserSearchQuery extends AsyncContactQuery<ContactSourceService> implements UserSearchSupportedProviderListener
query
QUERY_CANCELED, QUERY_COMPLETED, QUERY_ERROR, QUERY_IN_PROGRESS
Constructor and Description |
---|
UserSearchQuery(java.lang.String queryString,
UserSearchContactSource contactSource)
Creates an instance of ChatRoomQuery by specifying
the parent contact source, the query string to match and the maximum
result contacts to return.
|
Modifier and Type | Method and Description |
---|---|
void |
addContactQueryListener(ContactQueryListener l)
Adds a ContactQueryListener to the list of listeners interested
in notifications about this ContactQuery changing its status,
the receipt of new SourceContacts via this
ContactQuery, etc.
|
void |
cancel()
Cancels this ContactQuery.
|
int |
getQueryResultCount()
Gets the number of SourceContacts which match this
ContactQuery.
|
java.util.List<SourceContact> |
getQueryResults()
Gets the List of SourceContacts which match this
ContactQuery.
|
void |
providerAdded(ProtocolProviderService provider)
Handles provider addition.
|
void |
providerRemoved(ProtocolProviderService provider)
Handles provider removal.
|
void |
removeContactQueryListener(ContactQueryListener l)
Removes a ContactQueryListener from the list of listeners
interested in notifications about this ContactQuery changing its
status, the receipt of new SourceContacts via this
ContactQuery, etc.
|
protected void |
run()
Performs this ContactQuery in a background Thread.
|
void |
setStatus(int status)
If query has status changed to cancel, let's clear listeners.
|
addQueryResult, addQueryResult, addQueryResults, getPhoneNumberQuery, getQueryString, phoneNumberMatches, removeQueryResult, start, stopped
fireContactChanged, fireContactReceived, fireContactReceived, fireContactRemoved, fireQueryStatusChanged, getContactSource, getStatus
public UserSearchQuery(java.lang.String queryString, UserSearchContactSource contactSource)
queryString
- the query string to matchcontactSource
- the parent contact sourceprotected void run()
AsyncContactQuery
run
in class AsyncContactQuery<ContactSourceService>
public void providerAdded(ProtocolProviderService provider)
providerAdded
in interface UserSearchSupportedProviderListener
provider
- the provider that was added.public void providerRemoved(ProtocolProviderService provider)
providerRemoved
in interface UserSearchSupportedProviderListener
provider
- the provider that was removed.public void cancel()
cancel
in interface ContactQuery
cancel
in class AbstractContactQuery<ContactSourceService>
ContactQuery.cancel()
public void setStatus(int status)
setStatus
in class AbstractContactQuery<ContactSourceService>
status
- ContactQuery.QUERY_CANCELED
,
ContactQuery.QUERY_COMPLETED
public void addContactQueryListener(ContactQueryListener l)
AbstractContactQuery
addContactQueryListener
in interface ContactQuery
addContactQueryListener
in class AbstractContactQuery<ContactSourceService>
l
- the ContactQueryListener to be added to the list of
listeners interested in the notifications raised by this
ContactQueryContactQuery.addContactQueryListener(ContactQueryListener)
public void removeContactQueryListener(ContactQueryListener l)
AbstractContactQuery
removeContactQueryListener
in interface ContactQuery
removeContactQueryListener
in class AbstractContactQuery<ContactSourceService>
l
- the ContactQueryListener to be removed from the list of
listeners interested in notifications raised by this ContactQueryContactQuery.removeContactQueryListener(ContactQueryListener)
public java.util.List<SourceContact> getQueryResults()
AsyncContactQuery
getQueryResults
in interface ContactQuery
getQueryResults
in class AsyncContactQuery<ContactSourceService>
ContactQuery.getQueryResults()
public int getQueryResultCount()
AsyncContactQuery
getQueryResultCount
in class AsyncContactQuery<ContactSourceService>
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.