|
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 | |||||||||
public interface NotificationService
This service is previewed for use by bundles that implement some kind of user notification (e.g. playing sounds, poping systray tooltips, or triggering commands.) In the case when such bundles would like to leave the user the possibility to enable/disable or configure these notifications they could register an event type in this Registry service.
| Method Summary | |
|---|---|
void |
addActionHandler(NotificationHandler handler)
Adds an object that executes the actual action of a notification action. |
void |
addNotificationChangeListener(NotificationChangeListener listener)
Registers a listener that would be notified of changes that have occurred in the registered event notifications. |
NotificationData |
fireNotification(String eventType)
Fires all notifications registered for the specified eventType using the default message specified upon registration as a notification message wherever appropriate. |
NotificationData |
fireNotification(String eventType,
String messageTitle,
String message,
byte[] icon,
Object tag)
Fires all notifications registered for the specified eventType using message as a notification message wherever appropriate (e.g. |
NotificationData |
fireNotification(String eventType,
String messageTitle,
String message,
Map<String,String> extra,
byte[] icon,
Object tag)
Fires all notifications registered for the specified eventType using message as a notification message wherever appropriate (e.g. |
Iterable<NotificationHandler> |
getActionHandlers(String actionType)
Gets at list of handler for the specified action type. |
NotificationAction |
getEventNotificationAction(String eventType,
String actionType)
Returns the NotificationAction corresponding to the given event and action type. |
Iterable<String> |
getRegisteredEvents()
Returns an iterator over a list of all events registered in this notification service. |
boolean |
isActive(String eventType)
Indicates whether or not actions for the specified eventType are activated. |
void |
registerDefaultNotificationForEvent(String eventType,
NotificationAction handler)
Registers a default notification for the given eventType by specifying the action to be performed when a notification is fired for this event. |
void |
registerDefaultNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
Registers a default notification for the given eventType by specifying the type of the action to be performed when a notification is fired for this event, the actionDescriptor for sound and command actions and the defaultMessage for popup and log actions. |
void |
registerNotificationForEvent(String eventType,
NotificationAction action)
Registers a notification for the given eventType by specifying the action to be performed when a notification is fired for this event. |
void |
registerNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
Registers a notification for the given eventType by specifying the type of the action to be performed when a notification is fired for this event, the actionDescriptor for sound and command actions and the defaultMessage for popup and log actions. |
void |
removeActionHandler(String actionType)
Removes an object that executes the actual action of notification action. |
void |
removeEventNotification(String eventType)
Removes the given eventType from the list of event notifications. |
void |
removeEventNotificationAction(String eventType,
String actionType)
Removes the event notification corresponding to the specified actionType and eventType. |
void |
removeNotificationChangeListener(NotificationChangeListener listener)
Remove the specified listener so that it won't receive further notifications of changes that occur with actions registered for events stored by this service. |
void |
restoreDefaults()
Deletes all registered events and actions and registers and saves the default events as current. |
void |
setActive(String eventType,
boolean isActive)
Activates or deactivates all notification actions related to the specified eventType. |
| Method Detail |
|---|
void registerNotificationForEvent(String eventType,
NotificationAction action)
eventType - the name of the event (as defined by the plug-in that's
registering it) that we are setting an action for.action - the NotificationAction, which would be
used to perform the notification action.
void registerDefaultNotificationForEvent(String eventType,
NotificationAction handler)
eventType - the name of the event (as defined by the plug-in that's
registering it) that we are setting an action for.handler - the NotificationActionHandler, which would be
used to perform the notification action.
void registerDefaultNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
The method allows registering more than one actionType for a specific event. Setting the same actionType for the same eventType twice however would cause the first setting to be overridden. Default events are stored or executed at first run or when they are missing in the configuration. Also the registered default events are used when restoreDefaults is called.
eventType - the name of the event (as defined by the plug-in 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.
void registerNotificationForEvent(String eventType,
String actionType,
String actionDescriptor,
String defaultMessage)
The method allows registering more than one actionType for a specific event. Setting the same actionType for the same eventType twice however would cause the first setting to be overridden.
eventType - the name of the event (as defined by the plug-in 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.void restoreDefaults()
void removeEventNotification(String eventType)
This method does nothing if the given eventType is not contained in the list of registered event types.
eventType - the name of the event (as defined by the plugin that's
registering it) to be removed.
void removeEventNotificationAction(String eventType,
String actionType)
This method does nothing if the given eventType or actionType are not contained in the list of registered types.
eventType - 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).Iterable<String> getRegisteredEvents()
NotificationAction getEventNotificationAction(String eventType,
String actionType)
This method returns null if the given eventType or actionType are not contained in the list of registered types.
eventType - 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.
void addNotificationChangeListener(NotificationChangeListener listener)
listener - the listener that we'd like to register for changes in
the event notifications stored by this service.void removeNotificationChangeListener(NotificationChangeListener listener)
listener - the listener to remove.void addActionHandler(NotificationHandler handler)
handler - The handler that executes the action.void removeActionHandler(String actionType)
actionType - The handler type to remove.Iterable<NotificationHandler> getActionHandlers(String actionType)
actionType - the type for which the list of handlers should be
retrieved or null if all handlers shall be returned.
NotificationData fireNotification(String eventType,
String messageTitle,
String message,
byte[] icon,
Object tag)
This method does nothing if the given eventType is not contained in the list of registered event types.
eventType - the type of the event that we'd like to fire a
notification for.messageTitle - the message title to use if and where appropriate
(e.g. with systray)message - 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
NotificationData fireNotification(String eventType,
String messageTitle,
String message,
Map<String,String> extra,
byte[] icon,
Object tag)
This method does nothing if the given eventType is not contained in the list of registered event types.
eventType - the type of the event that we'd like to fire a
notification for.messageTitle - the message title to use if and where appropriate
(e.g. with systray)message - 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
NotificationData fireNotification(String eventType)
This method does nothing if the given eventType is not contained in the list of registered event types.
eventType - the type of the event that we'd like to fire a
notification for.
void setActive(String eventType,
boolean isActive)
eventType - 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.boolean isActive(String eventType)
false if the given
eventType is not contained in the list of registered event types.
eventType - 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.
|
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 | |||||||||