mirror of https://github.com/sipwise/jitsi.git
parent
c477dd269d
commit
80b489dfea
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification;
|
||||
|
||||
/**
|
||||
* The <tt>CommandNotificationHandler</tt> interface is meant to be implemented
|
||||
* by the notification bundle in order to provide handling of command actions.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface CommandNotificationHandler
|
||||
extends NotificationActionHandler
|
||||
{
|
||||
/**
|
||||
* Executes the program pointed by the descriptor.
|
||||
*/
|
||||
public void execute();
|
||||
|
||||
/**
|
||||
* Returns the descriptor pointing to the command to be executed.
|
||||
*
|
||||
* @return the descriptor pointing to the command to be executed.
|
||||
*/
|
||||
public String getDescriptor();
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification;
|
||||
|
||||
/**
|
||||
* The <tt>LogMessageNotificationHandler</tt> interface is meant to be
|
||||
* implemented by the notification bundle in order to provide handling of
|
||||
* log actions.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface LogMessageNotificationHandler
|
||||
extends NotificationActionHandler
|
||||
{
|
||||
/**
|
||||
* Indicates that this log is of type trace. If this <tt>logType</tt> is set
|
||||
* the messages would be logged as trace logs.
|
||||
*/
|
||||
public static final String TRACE_LOG_TYPE = "TraceLog";
|
||||
|
||||
/**
|
||||
* Indicates that this log is of type info. If this <tt>logType</tt> is set
|
||||
* the messages would be logged as info logs.
|
||||
*/
|
||||
public static final String INFO_LOG_TYPE = "InfoLog";
|
||||
|
||||
/**
|
||||
* Indicates that this log is of type error. If this <tt>logType</tt> is set
|
||||
* the messages would be logged as error logs.
|
||||
*/
|
||||
public static final String ERROR_LOG_TYPE = "ErrorLog";
|
||||
|
||||
/**
|
||||
* Returns the type of the log. One of the XXX_LOG_TYPE-s declared in this
|
||||
* interface.
|
||||
* @return the type of the log. One of the XXX_LOG_TYPE-s declared in this
|
||||
* interface.
|
||||
*/
|
||||
public String getLogType();
|
||||
|
||||
/**
|
||||
* Logs the given message.
|
||||
* @param message the message to log
|
||||
*/
|
||||
public void logMessage(String message);
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification;
|
||||
|
||||
/**
|
||||
* The <tt>NotificationActionHandler</tt> is the parent interface of all specific
|
||||
* notification handlers used for handling different action types. This
|
||||
* interface is used in the NotificationService in all methods dealing with
|
||||
* action handlers.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface NotificationActionHandler
|
||||
{}
|
||||
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification;
|
||||
|
||||
/**
|
||||
* The <tt>PopupMessageNotificationHandler</tt> interface is meant to be
|
||||
* implemented by the notification bundle in order to provide handling of
|
||||
* popup message actions.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface PopupMessageNotificationHandler
|
||||
extends NotificationActionHandler
|
||||
{
|
||||
/**
|
||||
* Returns the default message to be used when no message is provided to the
|
||||
* <tt>popupMessage</tt> method.
|
||||
*
|
||||
* @return the default message to be used when no message is provided to the
|
||||
* <tt>popupMessage</tt> method.
|
||||
*/
|
||||
public String getDefaultMessage();
|
||||
|
||||
/**
|
||||
* Pops up a message with the given <tt>message</tt> content and the given
|
||||
* <tt>title</tt>.
|
||||
*
|
||||
* @param title the title of the popup
|
||||
* @param message the message to show in the popup
|
||||
*/
|
||||
public void popupMessage(String title, String message);
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification;
|
||||
|
||||
/**
|
||||
* The <tt>SoundNotificationHandler</tt> interface is meant to be
|
||||
* implemented by the notification bundle in order to provide handling of
|
||||
* sound actions.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public interface SoundNotificationHandler
|
||||
extends NotificationActionHandler
|
||||
{
|
||||
/**
|
||||
* Returns the loop interval. This is the interval of milliseconds to wait
|
||||
* before repeating the sound, when playing a sound in loop. If this method
|
||||
* returns -1 the sound should not played in loop.
|
||||
*
|
||||
* @return the loop interval
|
||||
*/
|
||||
public int getLoopInterval();
|
||||
|
||||
/**
|
||||
* Returns the descriptor pointing to the sound to be played.
|
||||
*
|
||||
* @return the descriptor pointing to the sound to be played.
|
||||
*/
|
||||
public String getDescriptor();
|
||||
|
||||
/**
|
||||
* Start playing the sound pointed by <tt>getDescriotor</tt>. This
|
||||
* method should check the loopInterval value to distinguish whether to play
|
||||
* a simple sound or to play it in loop.
|
||||
*/
|
||||
public void start();
|
||||
|
||||
/**
|
||||
* Stops playing the sound pointing by <tt>getDescriptor</tt>. This method
|
||||
* is meant to be used to stop sounds that are played in loop.
|
||||
*/
|
||||
public void stop();
|
||||
}
|
||||
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.notification.*;
|
||||
|
||||
/**
|
||||
* Fired any time that a new action (i.e. of an action type previously not
|
||||
* registered for the corresponding event type) has been added for an event
|
||||
* type.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class NotificationActionAddedEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* The type of the notification action that is being added.
|
||||
*/
|
||||
private String actionType = null;
|
||||
|
||||
/**
|
||||
* The type of the event that a new action is being added for.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* The descriptor of the action (i.e. audio file uri, or a command line
|
||||
* string) that will be performed when notifications are being fired for
|
||||
* the corresponding event type.
|
||||
*/
|
||||
private String actionDescriptor = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of this event according to the specified type.
|
||||
* @param source NotificationService
|
||||
* @param eventType String
|
||||
* @param actionType String
|
||||
* @param actionDescriptor String
|
||||
*/
|
||||
public NotificationActionAddedEvent(NotificationService source,
|
||||
String eventType,
|
||||
String actionType,
|
||||
String actionDescriptor)
|
||||
{
|
||||
super(source);
|
||||
this.eventType = eventType;
|
||||
this.actionType = actionType;
|
||||
this.actionDescriptor = actionDescriptor;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,127 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.notification.*;
|
||||
|
||||
/**
|
||||
* Fired any time an action type is added, removed or changed.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class NotificationActionTypeEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* Indicates that a new action is added to an event type.
|
||||
*/
|
||||
public static final String ACTION_ADDED = "ActionAdded";
|
||||
|
||||
/**
|
||||
* Indicates that an action was removed for a given event type.
|
||||
*/
|
||||
public static final String ACTION_REMOVED = "ActionRemoved";
|
||||
|
||||
/**
|
||||
* Indicates that an action for a given event type has changed. For example
|
||||
* the action descriptor is changed.
|
||||
*/
|
||||
public static final String ACTION_CHANGED = "ActionChanged";
|
||||
|
||||
/**
|
||||
* The type of the notification action that is being added.
|
||||
*/
|
||||
private String sourceActionType = null;
|
||||
|
||||
/**
|
||||
* The type of the event that a new action is being added for.
|
||||
*/
|
||||
private String sourceEventType = null;
|
||||
|
||||
/**
|
||||
* The descriptor of the action (i.e. audio file uri, or a command line
|
||||
* string) that will be performed when notifications are being fired for
|
||||
* the corresponding event type.
|
||||
*/
|
||||
private NotificationActionHandler actionHandler = null;
|
||||
|
||||
/**
|
||||
* The type of this event. One of the static field constants declared in
|
||||
* this class.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of this event according to the specified type.
|
||||
*
|
||||
* @param source the <tt>NotificationService</tt> that dispatched this event
|
||||
* @param eventType the type of this event. One of the static fields
|
||||
* declared in this class
|
||||
* @param sourceEventType the event type for which this event occured
|
||||
* @param sourceActionType the action type corresponding to this event
|
||||
* @param actionHandler the <tt>NotificationActionHandler</tt> that handles
|
||||
* the given action
|
||||
*/
|
||||
public NotificationActionTypeEvent( NotificationService source,
|
||||
String eventType,
|
||||
String sourceEventType,
|
||||
String sourceActionType,
|
||||
NotificationActionHandler actionHandler)
|
||||
{
|
||||
super(source);
|
||||
|
||||
this.eventType = eventType;
|
||||
this.sourceEventType = sourceEventType;
|
||||
this.sourceActionType = sourceActionType;
|
||||
this.actionHandler = actionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the action type, for which this event is about.
|
||||
*
|
||||
* @return the action type, for which this event is about.
|
||||
*/
|
||||
public String getSourceActionType()
|
||||
{
|
||||
return sourceActionType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the event type, to which the given action belongs.
|
||||
*
|
||||
* @return the event type, to which the given action belongs
|
||||
*/
|
||||
public String getSourceEventType()
|
||||
{
|
||||
return sourceEventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>NotificationActionHandler</tt> that handles the action,
|
||||
* for which this event is about.
|
||||
*
|
||||
* @return the <tt>NotificationActionHandler</tt> that handles the action,
|
||||
* for which this event is about.
|
||||
*/
|
||||
public NotificationActionHandler getActionHandler()
|
||||
{
|
||||
return actionHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of this event. One of ACTION_XXX constants declared in this
|
||||
* class.
|
||||
*
|
||||
* @return the type of this event
|
||||
*/
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.notification.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.notification.*;
|
||||
|
||||
/**
|
||||
* Fired any time an event type is added or removed.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class NotificationEventTypeEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* Indicates that a new event type is added.
|
||||
*/
|
||||
public static final String EVENT_TYPE_ADDED = "EventTypeAdded";
|
||||
|
||||
/**
|
||||
* Indicates that an event type was removed.
|
||||
*/
|
||||
public static final String EVENT_TYPE_REMOVED = "EventTypeRemoved";
|
||||
|
||||
/**
|
||||
* The type of the event that a new action is being added for.
|
||||
*/
|
||||
private String sourceEventType = null;
|
||||
|
||||
/**
|
||||
* The type of this event. One of the static field constants declared in
|
||||
* this class.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of this event according to the specified type.
|
||||
*
|
||||
* @param source the <tt>NotificationService</tt> that dispatched this event
|
||||
* @param eventType the type of this event. One of the static fields
|
||||
* declared in this class
|
||||
* @param sourceEventType the event type for which this event occured
|
||||
*/
|
||||
public NotificationEventTypeEvent( NotificationService source,
|
||||
String eventType,
|
||||
String sourceEventType)
|
||||
{
|
||||
super(source);
|
||||
|
||||
this.eventType = eventType;
|
||||
this.sourceEventType = sourceEventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>eventType</tt>, for which this event is about.
|
||||
*
|
||||
* @return the <tt>eventType</tt>, for which this event is about.
|
||||
*/
|
||||
public String getSourceEventType()
|
||||
{
|
||||
return sourceEventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of this event. One of EVENT_TYPE_XXX constants declared in this
|
||||
* class.
|
||||
*
|
||||
* @return the type of this event
|
||||
*/
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue