public class ServerChatRoomQuery extends AsyncContactQuery<ContactSourceService> implements ChatRoomProviderWrapperListener
query
QUERY_CANCELED, QUERY_COMPLETED, QUERY_ERROR, QUERY_IN_PROGRESS
Constructor and Description |
---|
ServerChatRoomQuery(java.lang.String queryString,
ServerChatRoomContactSourceService contactSource,
ChatRoomProviderWrapper provider)
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.
|
void |
chatRoomProviderWrapperAdded(ChatRoomProviderWrapper provider)
When a provider wrapper is added this method is called to inform
listeners.
|
void |
chatRoomProviderWrapperRemoved(ChatRoomProviderWrapper provider)
When a provider wrapper is removed this method is called to inform
listeners.
|
int |
indexOf(BaseChatRoomSourceContact contact)
Returns the index of the contact in the contact results list.
|
boolean |
isMatching(java.lang.String chatRoomID,
ProtocolProviderService pps)
Checks if the contact should be added to results or not.
|
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, getQueryResultCount, getQueryResults, getQueryString, phoneNumberMatches, removeQueryResult, start, stopped
fireContactChanged, fireContactReceived, fireContactReceived, fireContactRemoved, fireQueryStatusChanged, getContactSource, getStatus
public ServerChatRoomQuery(java.lang.String queryString, ServerChatRoomContactSourceService contactSource, ChatRoomProviderWrapper provider)
contactSource
- the parent contact sourcequeryString
- the query string to matchprovider
- the provider associated with the queryprotected void run()
AsyncContactQuery
run
in class AsyncContactQuery<ContactSourceService>
public void chatRoomProviderWrapperAdded(ChatRoomProviderWrapper provider)
ChatRoomProviderWrapperListener
chatRoomProviderWrapperAdded
in interface ChatRoomProviderWrapperListener
provider
- which was added.public void chatRoomProviderWrapperRemoved(ChatRoomProviderWrapper provider)
ChatRoomProviderWrapperListener
chatRoomProviderWrapperRemoved
in interface ChatRoomProviderWrapperListener
provider
- which 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 boolean isMatching(java.lang.String chatRoomID, ProtocolProviderService pps)
chatRoomID
- the chat room id associated with the contact.pps
- the provider of the chat room contact.public int indexOf(BaseChatRoomSourceContact contact)
contact
- the contact.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.