public class ChatRoomQuery extends AsyncContactQuery<ContactSourceService> implements LocalUserChatRoomPresenceListener, ChatRoomListChangeListener, ChatRoomProviderWrapperListener
query
QUERY_CANCELED, QUERY_COMPLETED, QUERY_ERROR, QUERY_IN_PROGRESS
Constructor and Description |
---|
ChatRoomQuery(java.lang.String queryString,
ChatRoomContactSourceService 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 |
addQueryToProviderPresenceListeners(ProtocolProviderService pps)
Adds the query as presence listener to protocol provider service.
|
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.
|
void |
contentChanged(ChatRoomListChangeEvent evt)
Indicates that a change has occurred in the chat room data list.
|
int |
indexOf(ChatRoomSourceContact contact)
Returns the index of the contact in the contact results list.
|
void |
localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
Handles chat room presence status updates.
|
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.
|
void |
removeQueryFromProviderPresenceListeners(ProtocolProviderService pps)
Removes the query from protocol provider service presence listeners.
|
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 ChatRoomQuery(java.lang.String queryString, ChatRoomContactSourceService contactSource)
queryString
- the query string to matchcontactSource
- the parent contact sourcepublic void addQueryToProviderPresenceListeners(ProtocolProviderService pps)
pps
- the protocol provider service.public void removeQueryFromProviderPresenceListeners(ProtocolProviderService pps)
pps
- the protocol provider service.protected void run()
AsyncContactQuery
run
in class AsyncContactQuery<ContactSourceService>
public void localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
localUserPresenceChanged
in interface LocalUserChatRoomPresenceListener
evt
- the LocalUserChatRoomPresenceChangeEvent instance
containing the chat room and the type, and reason of the changepublic void contentChanged(ChatRoomListChangeEvent evt)
contentChanged
in interface ChatRoomListChangeListener
evt
- the event that describes the change.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 int indexOf(ChatRoomSourceContact contact)
contact
- the contact.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)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.