|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.service.notification.NotificationServiceImpl
class NotificationServiceImpl
The implementation of the NotificationService.
| Constructor Summary | |
|---|---|
NotificationServiceImpl()
Creates an instance of NotificationServiceImpl by loading all previously saved notifications. |
|
| Method Summary | |
|---|---|
void |
addActionHandler(NotificationHandler handler)
Adds an object that executes the actual action of a notification action. |
void |
addNotificationChangeListener(NotificationChangeListener listener)
Adds the given listener to the list of change listeners. |
NotificationData |
fireNotification(String eventType)
If there is a registered event notification of the given eventType and the event notification is currently activated, we go through the list of registered actions and execute them. |
NotificationData |
fireNotification(String eventType,
String title,
String message,
byte[] icon,
Object tag)
If there is a registered event notification of the given eventType and the event notification is currently activated, the list of registered actions is executed. |
NotificationData |
fireNotification(String eventType,
String title,
String message,
Map<String,String> extra,
byte[] icon,
Object tag)
If there is a registered event notification of the given eventType and the event notification is currently activated, the list of registered actions is executed. |
Iterable<NotificationHandler> |
getActionHandlers(String actionType)
Gets a list of handler for the specified action type. |
NotificationAction |
getEventNotificationAction(String eventType,
String actionType)
Returns the notification action corresponding to the given eventType and actionType. |
Iterable<String> |
getRegisteredEvents()
Returns an iterator over a list of all events registered in this notification service. |
boolean |
isActive(String eventType)
Finds the EventNotification corresponding to the given eventType and returns its isActive status. |
void |
registerDefaultNotificationForEvent(String eventType,
NotificationAction action)
Creates a new default EventNotification or obtains the corresponding existing one and registers a new action in it. |
void |
registerDefaultNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
Creates a new default EventNotification or obtains the corresponding existing one and registers a new action in it. |
void |
registerNotificationForEvent(String eventType,
NotificationAction action)
Creates a new EventNotification or obtains the corresponding existing one and registers a new action in it. |
void |
registerNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
Creates a new EventNotification or obtains the corresponding existing one and registers a new action in it. |
void |
removeActionHandler(String actionType)
Removes an object that executes the actual action of notification action. |
void |
removeEventNotification(String eventType)
Removes the EventNotification corresponding to the given eventType from the table of registered event notifications. |
void |
removeEventNotificationAction(String eventType,
String actionType)
Removes the given actionType from the list of actions registered for the given eventType. |
void |
removeNotificationChangeListener(NotificationChangeListener listener)
Removes the given listener from the list of change listeners. |
void |
restoreDefaults()
Deletes all registered events and actions and registers and saves the default events as current. |
void |
setActive(String eventType,
boolean isActive)
Finds the EventNotification corresponding to the given eventType and marks it as activated/deactivated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
NotificationServiceImpl()
| Method Detail |
|---|
public void registerNotificationForEvent(String eventType,
NotificationAction action)
registerNotificationForEvent in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) that we are setting an action for.action - the NotificationAction responsible for
handling the given actionType
public void registerNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
registerNotificationForEvent in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) that we are setting an action for.actionType - the type of the action that is to be executed when the
specified event occurs (could be one of the ACTION_XXX fields).actionDescriptor - a String containing a description of the action
(a URI to the sound file for audio notifications or a command line for
exec action types) that should be executed when the action occurs.defaultMessage - the default message to use if no specific message
has been provided when firing the notification.public void removeEventNotification(String eventType)
removeEventNotification in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) to be removed.
public void removeEventNotificationAction(String eventType,
String actionType)
removeEventNotificationAction in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) for which we'll remove the notification.actionType - the type of the action that is to be executed when the
specified event occurs (could be one of the ACTION_XXX fields).public Iterable<String> getRegisteredEvents()
getRegisteredEvents in interface NotificationService
public NotificationAction getEventNotificationAction(String eventType,
String actionType)
getEventNotificationAction in interface NotificationServiceeventType - the type of the event that we'd like to retrieve.actionType - the type of the action that we'd like to retrieve a
descriptor for.
public void addNotificationChangeListener(NotificationChangeListener listener)
addNotificationChangeListener in interface NotificationServicelistener - the listener that we'd like to register to listen for
changes in the event notifications stored by this service.public void removeNotificationChangeListener(NotificationChangeListener listener)
removeNotificationChangeListener in interface NotificationServicelistener - the listener that we'd like to removepublic void addActionHandler(NotificationHandler handler)
addActionHandler in interface NotificationServicehandler - The handler that executes the action.public void removeActionHandler(String actionType)
removeActionHandler in interface NotificationServiceactionType - The handler type to remove.public Iterable<NotificationHandler> getActionHandlers(String actionType)
getActionHandlers in interface NotificationServiceactionType - the type for which the list of handlers should be
retrieved or null if all handlers shall be returned.
public NotificationData fireNotification(String eventType,
String title,
String message,
byte[] icon,
Object tag)
fireNotification in interface NotificationServiceeventType - the type of the event that we'd like to fire a
notification for.title - the title of the given messagemessage - the message to use if and where appropriate (e.g. with
systray or log notification.)icon - the icon to show in the notification if and where appropriatetag - additional info to be used by the notification handler
public NotificationData fireNotification(String eventType,
String title,
String message,
Map<String,String> extra,
byte[] icon,
Object tag)
fireNotification in interface NotificationServiceeventType - the type of the event that we'd like to fire a
notification for.title - the title of the given messagemessage - the message to use if and where appropriate (e.g. with
systray or log notification.)extra - the extra data to pass (especially for Command execution)icon - the icon to show in the notification if and where appropriatetag - additional info to be used by the notification handler
public NotificationData fireNotification(String eventType)
fireNotification in interface NotificationServiceeventType - the type of the event that we'd like to fire a
notification for.
public void setActive(String eventType,
boolean isActive)
setActive in interface NotificationServiceeventType - the name of the event, which actions should be activated
/deactivated.isActive - indicates whether to activate or deactivate the actions
related to the specified eventType.public boolean isActive(String eventType)
isActive in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registered it) that we are checking.
true if actions for the specified eventType
are activated, false - otherwise. If the given
eventType is not contained in the list of registered event
types - returns false.
public void registerDefaultNotificationForEvent(String eventType,
NotificationAction action)
registerDefaultNotificationForEvent in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) that we are setting an action for.action - the NotificationAction to register
public void registerDefaultNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
registerDefaultNotificationForEvent in interface NotificationServiceeventType - the name of the event (as defined by the plugin that's
registering it) that we are setting an action for.actionType - the type of the action that is to be executed when the
specified event occurs (could be one of the ACTION_XXX fields).actionDescriptor - a String containing a description of the action
(a URI to the sound file for audio notifications or a command line for
exec action types) that should be executed when the action occurs.defaultMessage - the default message to use if no specific message
has been provided when firing the notification.public void restoreDefaults()
restoreDefaults in interface NotificationService
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||