public class NotificationManager extends java.lang.Object implements AdHocChatRoomMessageListener, CallChangeListener, CallListener, CallPeerConferenceListener, CallPeerListener, CallPeerSecurityListener, ChatRoomMessageListener, FileTransferListener, LocalUserAdHocChatRoomPresenceListener, LocalUserChatRoomPresenceListener, MessageListener, org.jitsi.service.neomedia.recording.Recorder.Listener, org.osgi.framework.ServiceListener, TypingNotificationsListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BUSY_CALL
Default event type for a busy call.
|
static java.lang.String |
CALL_SAVED
Default event type for call been saved using a recorder.
|
static java.lang.String |
CALL_SECURITY_ERROR
Default event type for security error on a call.
|
static java.lang.String |
CALL_SECURITY_ON
Default event type for activated security on a call.
|
static ImageID |
DEFAULT_USER_PHOTO
The image used, when a contact has no photo specified.
|
static java.lang.String |
DIALING
Default event type for dialing.
|
static java.lang.String |
HANG_UP
Default event type for hanging up calls.
|
static java.lang.String |
INCOMING_CALL
Default event type for receiving calls (incoming calls).
|
static java.lang.String |
INCOMING_FILE
Default event type for incoming file transfers.
|
static java.lang.String |
INCOMING_MESSAGE
Default event type for receiving messages.
|
static java.lang.String |
OUTGOING_CALL
Default event type for outgoing calls.
|
static java.lang.String |
PROACTIVE_NOTIFICATION
Default event type for
proactive notifications (typing notifications when chatting).
|
static java.lang.String |
SECURITY_MESSAGE
Default event type when a secure message received.
|
Constructor and Description |
---|
NotificationManager() |
Modifier and Type | Method and Description |
---|---|
void |
callEnded(CallEvent ev)
Implements CallListener.callEnded.
|
void |
callPeerAdded(CallPeerEvent evt)
Implements the CallChangeListener.callPeerAdded method.
|
void |
callPeerRemoved(CallPeerEvent evt)
Implements the CallChangeListener.callPeerRemoved method.
|
void |
callStateChanged(CallChangeEvent ev)
Indicates that a change has occurred in the state of the source call.
|
void |
conferenceFocusChanged(CallPeerConferenceEvent ev)
Notifies this listener about a change in the characteristic of being a
conference focus of a specific CallPeer.
|
void |
conferenceMemberAdded(CallPeerConferenceEvent conferenceEvent)
Indicates that the given conference member has been added to the given
peer.
|
void |
conferenceMemberErrorReceived(CallPeerConferenceEvent ev)
Notifies this listener about an error packet received from specific
CallPeer.
|
void |
conferenceMemberRemoved(CallPeerConferenceEvent ev)
Notifies this listener about the removal of a specific
ConferenceMember from the list of
ConferenceMembers of a specific CallPeer
acting as a conference focus.
|
void |
fileTransferCreated(FileTransferCreatedEvent ev)
Called when a FileTransferCreatedEvent has been received.
|
void |
fileTransferRequestCanceled(FileTransferRequestEvent ev)
Called when an IncomingFileTransferRequest has been canceled
from the contact who sent it.
|
void |
fileTransferRequestReceived(FileTransferRequestEvent event)
When a request has been received we show a notification.
|
void |
fileTransferRequestRejected(FileTransferRequestEvent ev)
Called when an IncomingFileTransferRequest has been rejected.
|
static void |
fireChatNotification(java.lang.Object chatContact,
java.lang.String eventType,
java.lang.String messageTitle,
java.lang.String message,
java.lang.String messageUID)
Fires a chat message notification for the given event type through the
NotificationService.
|
static java.util.Map<java.lang.Object,ProtocolProviderFactory> |
getProtocolProviderFactories()
Returns all ProtocolProviderFactorys obtained from the bundle
context.
|
static java.util.List<ProtocolProviderService> |
getProtocolProviders()
Returns all protocol providers currently registered.
|
void |
incomingCallReceived(CallEvent ev)
Implements CallListener.incomingCallReceived.
|
(package private) void |
init()
Initialize, register default notifications and start listening for
new protocols or removed one and find any that are already registered.
|
boolean |
isConference(Call call)
Checks if the contained call is a conference call.
|
void |
localUserAdHocPresenceChanged(LocalUserAdHocChatRoomPresenceChangeEvent evt)
Implements the
LocalUserAdHocChatRoomPresenceListener.localUserPresenceChanged
method
|
void |
localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
Implements the
LocalUserChatRoomPresenceListener.localUserPresenceChanged
method.
|
void |
messageDelivered(AdHocChatRoomMessageDeliveredEvent ev)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDelivered(ChatRoomMessageDeliveredEvent ev)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDelivered(MessageDeliveredEvent ev)
Called when the underlying implementation has received an indication
that a message, sent earlier has been successfully received by the
destination.
|
void |
messageDeliveryFailed(AdHocChatRoomMessageDeliveryFailedEvent ev)
Called to indicate that delivery of a message sent earlier to the chat
room has failed.
|
void |
messageDeliveryFailed(ChatRoomMessageDeliveryFailedEvent ev)
Called to indicate that delivery of a message sent earlier to the chat
room has failed.
|
void |
messageDeliveryFailed(MessageDeliveryFailedEvent ev)
Called to indicated that delivery of a message sent earlier has failed.
|
void |
messageReceived(AdHocChatRoomMessageReceivedEvent evt)
Implements the AdHocChatRoomMessageListener.messageReceived
method.
|
void |
messageReceived(ChatRoomMessageReceivedEvent evt)
Implements the ChatRoomMessageListener.messageReceived method.
|
void |
messageReceived(MessageReceivedEvent evt)
Fired on new messages.
|
void |
outgoingCallCreated(CallEvent event)
Do nothing.
|
void |
peerAddressChanged(CallPeerChangeEvent ev)
Indicates that a change has occurred in the address of the source
CallPeer.
|
void |
peerDisplayNameChanged(CallPeerChangeEvent ev)
Indicates that a change has occurred in the display name of the source
CallPeer.
|
void |
peerImageChanged(CallPeerChangeEvent ev)
Indicates that a change has occurred in the image of the source
CallPeer.
|
void |
peerStateChanged(CallPeerChangeEvent ev)
Fired when peer's state is changed
|
void |
peerTransportAddressChanged(CallPeerChangeEvent ev)
Indicates that a change has occurred in the transport address that we
use to communicate with the peer.
|
void |
recorderStopped(org.jitsi.service.neomedia.recording.Recorder recorder)
Notifies that a specific Recorder has
stopped recording the media associated with it.
|
void |
securityMessageRecieved(CallPeerSecurityMessageEvent ev)
Processes the received security message.
|
void |
securityNegotiationStarted(CallPeerSecurityNegotiationStartedEvent ev)
The handler for the security event received.
|
void |
securityOff(CallPeerSecurityOffEvent ev)
The handler for the security event received.
|
void |
securityOn(CallPeerSecurityOnEvent ev)
When a securityOnEvent is received.
|
void |
securityTimeout(CallPeerSecurityTimeoutEvent ev)
The handler for the security event received.
|
void |
serviceChanged(org.osgi.framework.ServiceEvent event)
Implements the ServiceListener method.
|
void |
typingNotificationDeliveryFailed(TypingNotificationEvent ev)
Called to indicate that sending typing notification has failed.
|
void |
typingNotificationReceived(TypingNotificationEvent ev)
Informs the user what is the typing state of his chat contacts.
|
public static final java.lang.String BUSY_CALL
public static final java.lang.String CALL_SAVED
public static final java.lang.String CALL_SECURITY_ERROR
public static final java.lang.String CALL_SECURITY_ON
public static final ImageID DEFAULT_USER_PHOTO
public static final java.lang.String DIALING
public static final java.lang.String HANG_UP
public static final java.lang.String INCOMING_CALL
public static final java.lang.String INCOMING_FILE
public static final java.lang.String INCOMING_MESSAGE
public static final java.lang.String OUTGOING_CALL
public static final java.lang.String PROACTIVE_NOTIFICATION
public static final java.lang.String SECURITY_MESSAGE
public static void fireChatNotification(java.lang.Object chatContact, java.lang.String eventType, java.lang.String messageTitle, java.lang.String message, java.lang.String messageUID)
chatContact
- the chat contact to which the chat message corresponds;
the chat contact could be a Contact or a ChatRoom.eventType
- the event type for which we fire a notificationmessageTitle
- the title of the messagemessage
- the content of the messagemessageUID
- the message UIDpublic static java.util.Map<java.lang.Object,ProtocolProviderFactory> getProtocolProviderFactories()
public static java.util.List<ProtocolProviderService> getProtocolProviders()
public void callEnded(CallEvent ev)
callEnded
in interface CallListener
ev
- the CallEventpublic void callPeerAdded(CallPeerEvent evt)
callPeerAdded
in interface CallChangeListener
evt
- the CallPeerEvent that notifies us for the changepublic void callPeerRemoved(CallPeerEvent evt)
callPeerRemoved
in interface CallChangeListener
evt
- the CallPeerEvent that has been triggeredpublic void callStateChanged(CallChangeEvent ev)
callStateChanged
in interface CallChangeListener
ev
- the CallChangeEvent instance containing the source
calls and its old and new state.public void conferenceFocusChanged(CallPeerConferenceEvent ev)
conferenceFocusChanged
in interface CallPeerConferenceListener
ev
- a CallPeerConferenceEvent with ID
CallPeerConferenceEvent#CONFERENCE_FOCUS_CHANGED
and no associated ConferenceMemberpublic void conferenceMemberAdded(CallPeerConferenceEvent conferenceEvent)
conferenceMemberAdded
in interface CallPeerConferenceListener
conferenceEvent
- the eventpublic void conferenceMemberErrorReceived(CallPeerConferenceEvent ev)
conferenceMemberErrorReceived
in interface CallPeerConferenceListener
ev
- a CallPeerConferenceEvent with ID
CallPeerConferenceEvent#CONFERENCE_MEMBER_ERROR_RECEIVED
and the error message associated with the packet.public void conferenceMemberRemoved(CallPeerConferenceEvent ev)
conferenceMemberRemoved
in interface CallPeerConferenceListener
ev
- a CallPeerConferenceEvent with ID
CallPeerConferenceEvent#CONFERENCE_MEMBER_REMOVED
and conferenceMember property specifying the
ConferenceMember which was removedpublic void fileTransferCreated(FileTransferCreatedEvent ev)
fileTransferCreated
in interface FileTransferListener
ev
- the FileTransferCreatedEvent containing the newly
received file transfer and other details.public void fileTransferRequestCanceled(FileTransferRequestEvent ev)
fileTransferRequestCanceled
in interface FileTransferListener
ev
- the FileTransferRequestEvent containing the
request which was canceled.public void fileTransferRequestReceived(FileTransferRequestEvent event)
fileTransferRequestReceived
in interface FileTransferListener
event
- FileTransferRequestEventFileTransferListener.fileTransferRequestReceived(FileTransferRequestEvent)
public void fileTransferRequestRejected(FileTransferRequestEvent ev)
fileTransferRequestRejected
in interface FileTransferListener
ev
- the FileTransferRequestEvent containing the
received request which was rejected.public void incomingCallReceived(CallEvent ev)
incomingCallReceived
in interface CallListener
ev
- the CallEventvoid init()
public boolean isConference(Call call)
call
- the call to checktrue
if the contained Call is a conference
call, otherwise - returns false
.public void localUserAdHocPresenceChanged(LocalUserAdHocChatRoomPresenceChangeEvent evt)
localUserAdHocPresenceChanged
in interface LocalUserAdHocChatRoomPresenceListener
evt
- the LocalUserAdHocChatRoomPresenceChangeEvent that
notified us of a presence changepublic void localUserPresenceChanged(LocalUserChatRoomPresenceChangeEvent evt)
localUserPresenceChanged
in interface LocalUserChatRoomPresenceListener
evt
- the LocalUserChatRoomPresenceChangeEvent that
notified uspublic void messageDelivered(AdHocChatRoomMessageDeliveredEvent ev)
messageDelivered
in interface AdHocChatRoomMessageListener
ev
- the AdHocChatRoomMessageDeliveredEvent containing the
id of the message that has caused the event.public void messageDelivered(ChatRoomMessageDeliveredEvent ev)
messageDelivered
in interface ChatRoomMessageListener
ev
- the ChatRoomMessageDeliveredEvent containing the id
of the message that has caused the event.public void messageDelivered(MessageDeliveredEvent ev)
messageDelivered
in interface MessageListener
ev
- the MessageDeliveredEvent containing the id of the message
that has caused the event.public void messageDeliveryFailed(AdHocChatRoomMessageDeliveryFailedEvent ev)
messageDeliveryFailed
in interface AdHocChatRoomMessageListener
ev
- the AdHocChatroomMessageDeliveryFailedEvent
containing the ID of the message whose delivery has failed.public void messageDeliveryFailed(ChatRoomMessageDeliveryFailedEvent ev)
messageDeliveryFailed
in interface ChatRoomMessageListener
ev
- the ChatroomMessageDeliveryFailedEvent containing
the ID of the message whose delivery has failed.public void messageDeliveryFailed(MessageDeliveryFailedEvent ev)
messageDeliveryFailed
in interface MessageListener
ev
- the MessageFailedEvent containing the ID of the
message whose delivery has failed.public void messageReceived(AdHocChatRoomMessageReceivedEvent evt)
messageReceived
in interface AdHocChatRoomMessageListener
evt
- the AdHocChatRoomMessageReceivedEvent that notified
uspublic void messageReceived(ChatRoomMessageReceivedEvent evt)
messageReceived
in interface ChatRoomMessageListener
evt
- the ChatRoomMessageReceivedEvent that notified us
that a message has been receivedpublic void messageReceived(MessageReceivedEvent evt)
messageReceived
in interface MessageListener
evt
- the MessageReceivedEvent containing
details on the received messagepublic void outgoingCallCreated(CallEvent event)
outgoingCallCreated
in interface CallListener
event
- the CallEventpublic void peerAddressChanged(CallPeerChangeEvent ev)
peerAddressChanged
in interface CallPeerListener
ev
- The CallPeerChangeEvent instance containing
the source event as well as its previous and its new address.public void peerDisplayNameChanged(CallPeerChangeEvent ev)
peerDisplayNameChanged
in interface CallPeerListener
ev
- The CallPeerChangeEvent instance containing
the source event as well as its previous and its new display names.public void peerImageChanged(CallPeerChangeEvent ev)
peerImageChanged
in interface CallPeerListener
ev
- The CallPeerChangeEvent instance containing
the source event as well as its previous and its new image.public void peerStateChanged(CallPeerChangeEvent ev)
peerStateChanged
in interface CallPeerListener
ev
- fired CallPeerEventpublic void peerTransportAddressChanged(CallPeerChangeEvent ev)
peerTransportAddressChanged
in interface CallPeerListener
ev
- The CallPeerChangeEvent instance containing
the source event as well as its previous and its new transport address.public void recorderStopped(org.jitsi.service.neomedia.recording.Recorder recorder)
recorderStopped
in interface org.jitsi.service.neomedia.recording.Recorder.Listener
recorder
- the Recorder which has stopped recording its
associated mediapublic void securityMessageRecieved(CallPeerSecurityMessageEvent ev)
securityMessageRecieved
in interface CallPeerSecurityListener
ev
- the event we receivedpublic void securityNegotiationStarted(CallPeerSecurityNegotiationStartedEvent ev)
securityNegotiationStarted
in interface CallPeerSecurityListener
ev
- the security started event receivedpublic void securityOff(CallPeerSecurityOffEvent ev)
securityOff
in interface CallPeerSecurityListener
ev
- the security event receivedpublic void securityOn(CallPeerSecurityOnEvent ev)
securityOn
in interface CallPeerSecurityListener
ev
- the event we receivedpublic void securityTimeout(CallPeerSecurityTimeoutEvent ev)
securityTimeout
in interface CallPeerSecurityListener
ev
- the security timeout event receivedpublic void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
event
- The ServiceEvent object.public void typingNotificationDeliveryFailed(TypingNotificationEvent ev)
typingNotificationDeliveryFailed
in interface TypingNotificationsListener
ev
- a TypingNotificationEvent containing the sender
of the notification and its type.public void typingNotificationReceived(TypingNotificationEvent ev)
typingNotificationReceived
in interface TypingNotificationsListener
ev
- the event containing details on the typing notification
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.