public class MessageSourceService extends MetaContactListAdapter implements ContactSourceService, ContactPresenceStatusListener, ContactCapabilitiesListener, ProviderPresenceStatusListener, SubscriptionListener, LocalUserChatRoomPresenceListener, MessageListener, ChatRoomMessageListener, AdHocChatRoomMessageListener
CONTACT_LIST_TYPE, DEFAULT_TYPE, HISTORY_TYPE, SEARCH_TYPE
STATUS_MESSAGE
Constructor and Description |
---|
MessageSourceService(MessageHistoryServiceImpl messageHistoryService)
Constructs MessageSourceService.
|
Modifier and Type | Method and Description |
---|---|
void |
contactModified(ContactPropertyChangeEvent evt)
If a contact is renamed update the locally stored message if any.
|
void |
contactPresenceStatusChanged(ContactPresenceStatusChangeEvent evt)
Updates contact source contacts with status.
|
ContactQuery |
createContactQuery(java.lang.String queryString)
Creates query for the given searchString.
|
ContactQuery |
createContactQuery(java.lang.String queryString,
int contactCount)
Creates query for the given searchString.
|
void |
eraseLocallyStoredHistory()
Permanently removes all locally stored message history,
remove recent contacts.
|
void |
eraseLocallyStoredHistory(ChatRoom room)
Permanently removes locally stored message history for the chatroom,
remove any recent contacts if any.
|
void |
eraseLocallyStoredHistory(MetaContact contact)
Permanently removes locally stored message history for the metacontact,
remove any recent contacts if any.
|
java.lang.String |
getDisplayName()
Returns the display name of this contact source.
|
int |
getIndex()
Returns the index of the contact source in the result list.
|
(package private) int |
getIndex(MessageSourceContact messageSourceContact)
Returns the index of the source contact, in the list of recent messages.
|
(package private) java.util.List<java.lang.String> |
getRecentContactIDs(java.lang.String provider,
java.util.Date after)
Searches for contact ids in history of recent messages.
|
int |
getType()
Returns default type to indicate that this contact source can be queried
by default filters.
|
(package private) void |
handleProviderAdded(ProtocolProviderService provider,
boolean isStatusChanged)
When a provider is added, do not block and start executing in new thread.
|
(package private) void |
handleProviderRemoved(ProtocolProviderService provider)
A provider has been removed.
|
(package private) boolean |
isSMSEnabled()
Access for source contacts impl.
|
void |
localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
Called to notify interested parties that a change in our presence in
a chat room has occured.
|
void |
messageDelivered(AdHocChatRoomMessageDeliveredEvent evt)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDelivered(ChatRoomMessageDeliveredEvent evt)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDelivered(MessageDeliveredEvent evt)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDeliveryFailed(AdHocChatRoomMessageDeliveryFailedEvent evt)
Not used.
|
void |
messageDeliveryFailed(ChatRoomMessageDeliveryFailedEvent evt)
Not used.
|
void |
messageDeliveryFailed(MessageDeliveryFailedEvent evt)
Not used.
|
void |
messageReceived(AdHocChatRoomMessageReceivedEvent evt)
Called when a new incoming Message has been received.
|
void |
messageReceived(ChatRoomMessageReceivedEvent evt)
Called when a new incoming Message has been received.
|
void |
messageReceived(MessageReceivedEvent evt)
Called when a new incoming Message has been received.
|
void |
metaContactRenamed(MetaContactRenamedEvent evt)
Indicates that a MetaContact has been modified.
|
void |
providerStatusChanged(ProviderPresenceStatusChangeEvent evt)
The method is called by a ProtocolProvider implementation whenever
a change in the presence status of the corresponding provider had
occurred.
|
void |
providerStatusMessageChanged(java.beans.PropertyChangeEvent evt)
The method is called by a ProtocolProvider implementation whenever a
change in the status message of the corresponding provider has occurred
and has been confirmed by the server.
|
void |
subscriptionCreated(SubscriptionEvent evt)
Indicates that a subscription has been successfully created and accepted
by the remote party.
|
void |
subscriptionFailed(SubscriptionEvent evt)
Indicates that a subscription has failed and/or was not accepted by the
remote party.
|
void |
subscriptionMoved(SubscriptionMovedEvent evt)
Indicates that a contact/subscription has been moved from one server
stored group to another.
|
void |
subscriptionRemoved(SubscriptionEvent evt)
Indicates that a subscription has been successfully removed and that
the remote party has acknowledged its removal.
|
void |
subscriptionResolved(SubscriptionEvent evt)
Indicates that a subscription has been successfully resolved and that
the server has acknowledged taking it into account.
|
void |
supportedOperationSetsChanged(ContactCapabilitiesEvent event)
Notifies this listener that the list of the OperationSet
capabilities of a Contact has changed.
|
void |
updateRecentMessages()
Updates the contact sources in the recent query if any.
|
childContactsReordered, metaContactAdded, metaContactAvatarUpdated, metaContactGroupAdded, metaContactGroupModified, metaContactGroupRemoved, metaContactModified, metaContactMoved, metaContactRemoved, protoContactAdded, protoContactModified, protoContactMoved, protoContactRemoved
MessageSourceService(MessageHistoryServiceImpl messageHistoryService)
public java.lang.String getDisplayName()
getDisplayName
in interface ContactSourceService
public int getType()
getType
in interface ContactSourceService
public int getIndex()
getIndex
in interface ContactSourceService
public ContactQuery createContactQuery(java.lang.String queryString)
createContactQuery
in interface ContactSourceService
queryString
- the string to search forpublic void updateRecentMessages()
boolean isSMSEnabled()
void handleProviderAdded(ProtocolProviderService provider, boolean isStatusChanged)
provider
- ProtocolProviderServicevoid handleProviderRemoved(ProtocolProviderService provider)
provider
- the ProtocolProviderService that has been unregistered.java.util.List<java.lang.String> getRecentContactIDs(java.lang.String provider, java.util.Date after)
provider
- after
- int getIndex(MessageSourceContact messageSourceContact)
messageSourceContact
- public ContactQuery createContactQuery(java.lang.String queryString, int contactCount)
createContactQuery
in interface ContactSourceService
queryString
- the string to search forcontactCount
- the maximum count of result contactspublic void contactPresenceStatusChanged(ContactPresenceStatusChangeEvent evt)
contactPresenceStatusChanged
in interface ContactPresenceStatusListener
evt
- the ContactPresenceStatusChangeEvent describing the statuspublic void providerStatusChanged(ProviderPresenceStatusChangeEvent evt)
ProviderPresenceStatusListener
providerStatusChanged
in interface ProviderPresenceStatusListener
evt
- ProviderStatusChangeEvent the event describing the status
change.public void providerStatusMessageChanged(java.beans.PropertyChangeEvent evt)
ProviderPresenceStatusListener
providerStatusMessageChanged
in interface ProviderPresenceStatusListener
evt
- a PropertyChangeEvent with a STATUS_MESSAGE property name,
containing the old and new status messages.public void localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
LocalUserChatRoomPresenceListener
localUserPresenceChanged
in interface LocalUserChatRoomPresenceListener
evt
- the LocalUserChatRoomPresenceChangeEvent instance
containing the chat room and the type, and reason of the changepublic void messageReceived(MessageReceivedEvent evt)
MessageListener
messageReceived
in interface MessageListener
evt
- the MessageReceivedEvent containing the newly
received message, its sender and other details.public void messageDelivered(MessageDeliveredEvent evt)
MessageListener
messageDelivered
in interface MessageListener
evt
- the MessageDeliveredEvent containing the id of the message
that has caused the event.public void messageDeliveryFailed(MessageDeliveryFailedEvent evt)
messageDeliveryFailed
in interface MessageListener
evt
- the MessageFailedEvent containing the ID of thepublic void messageReceived(ChatRoomMessageReceivedEvent evt)
ChatRoomMessageListener
messageReceived
in interface ChatRoomMessageListener
evt
- the ChatRoomMessageReceivedEvent containing the newly
received message, its sender and other details.public void messageDelivered(ChatRoomMessageDeliveredEvent evt)
ChatRoomMessageListener
messageDelivered
in interface ChatRoomMessageListener
evt
- the ChatRoomMessageDeliveredEvent containing the id
of the message that has caused the event.public void messageDeliveryFailed(ChatRoomMessageDeliveryFailedEvent evt)
messageDeliveryFailed
in interface ChatRoomMessageListener
evt
- the ChatroomMessageDeliveryFailedEvent containingpublic void messageReceived(AdHocChatRoomMessageReceivedEvent evt)
AdHocChatRoomMessageListener
messageReceived
in interface AdHocChatRoomMessageListener
evt
- the AdHocChatRoomMessageReceivedEvent containing the
newly received message, its sender and other details.public void messageDelivered(AdHocChatRoomMessageDeliveredEvent evt)
AdHocChatRoomMessageListener
messageDelivered
in interface AdHocChatRoomMessageListener
evt
- the AdHocChatRoomMessageDeliveredEvent containing the
id of the message that has caused the event.public void messageDeliveryFailed(AdHocChatRoomMessageDeliveryFailedEvent evt)
messageDeliveryFailed
in interface AdHocChatRoomMessageListener
evt
- the AdHocChatroomMessageDeliveryFailedEventpublic void subscriptionCreated(SubscriptionEvent evt)
SubscriptionListener
subscriptionCreated
in interface SubscriptionListener
evt
- the SubscriptionEvent containing the corresponding contactpublic void subscriptionFailed(SubscriptionEvent evt)
SubscriptionListener
subscriptionFailed
in interface SubscriptionListener
evt
- the SubscriptionEvent containing the corresponding contactpublic void subscriptionRemoved(SubscriptionEvent evt)
SubscriptionListener
subscriptionRemoved
in interface SubscriptionListener
evt
- the SubscriptionEvent containing the corresponding contactpublic void subscriptionMoved(SubscriptionMovedEvent evt)
SubscriptionListener
subscriptionMoved
in interface SubscriptionListener
evt
- a reference to the SubscriptionMovedEvent containing previous
and new parents as well as a ref to the source contact.public void subscriptionResolved(SubscriptionEvent evt)
SubscriptionListener
subscriptionResolved
in interface SubscriptionListener
evt
- the SubscriptionEvent containing the source contactpublic void contactModified(ContactPropertyChangeEvent evt)
contactModified
in interface SubscriptionListener
evt
- the ContactPropertyChangeEvent containing the sourcepublic void metaContactRenamed(MetaContactRenamedEvent evt)
metaContactRenamed
in interface MetaContactListListener
metaContactRenamed
in class MetaContactListAdapter
evt
- the MetaContactListEvent containing the corresponding contactpublic void supportedOperationSetsChanged(ContactCapabilitiesEvent event)
ContactCapabilitiesListener
supportedOperationSetsChanged
in interface ContactCapabilitiesListener
event
- a ContactCapabilitiesEvent with ID
ContactCapabilitiesEvent.SUPPORTED_OPERATION_SETS_CHANGED
which
specifies the Contact whose list of OperationSet
capabilities has changedpublic void eraseLocallyStoredHistory() throws java.io.IOException
java.io.IOException
public void eraseLocallyStoredHistory(MetaContact contact) throws java.io.IOException
java.io.IOException
public void eraseLocallyStoredHistory(ChatRoom room)
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.