Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.galagonotification
Class GalagoNotification

java.lang.Object
  extended by net.java.sip.communicator.impl.galagonotification.GalagoNotification

public final class GalagoNotification
extends Object

Declares the native functions required by the galagonotification bundle.

Author:
Lubomir Marinov

Method Summary
static long dbus_bus_get_session()
          Connects to the DBUS_BUS_SESSION D-Bus bus daemon and registers with it.
static void dbus_connection_unref(long connection)
          Decrements the reference count of the specified DBusConnection and finalizes it if the count reaches zero.
static String[] getCapabilities(long connection)
          Invokes org.freedesktop.Notifications.GetCapabilities through the specified DBusConnection in order to retrieve the optional capabilities supported by the freedesktop.org Desktop Notifications server.
static long notify(long connection, String appName, long replacesId, BufferedImage icon, String summary, String body, int expireTimeout)
          Invokes org.freedesktop.Notifications.Notify through the specified DBusConnection in order to send a notification to the freedesktop.org Desktop Notifications server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

dbus_bus_get_session

public static long dbus_bus_get_session()
                                 throws DBusException
Connects to the DBUS_BUS_SESSION D-Bus bus daemon and registers with it.

Returns:
a new reference to a DBusConnection to the DBUS_BUS_SESSION D-Bus bus daemon
Throws:
DBusException - if connecting to and registering with the DBUS_BUS_SESSION D-Bus bus daemon fails

dbus_connection_unref

public static void dbus_connection_unref(long connection)
Decrements the reference count of the specified DBusConnection and finalizes it if the count reaches zero.

Parameters:
connection - the DBusConnection to decrement the reference count of

getCapabilities

public static String[] getCapabilities(long connection)
                                throws DBusException
Invokes org.freedesktop.Notifications.GetCapabilities through the specified DBusConnection in order to retrieve the optional capabilities supported by the freedesktop.org Desktop Notifications server.

Parameters:
connection - the DBusConnection with the freedesktop.org Desktop Notifications server
Returns:
an array of Strings listing the optional capabilities supported by the freedesktop.org Desktop Notifications server
Throws:
DBusException - if retrieving the optional capabilities of the freedesktop.org Desktop Notifications server fails

notify

public static long notify(long connection,
                          String appName,
                          long replacesId,
                          BufferedImage icon,
                          String summary,
                          String body,
                          int expireTimeout)
                   throws DBusException
Invokes org.freedesktop.Notifications.Notify through the specified DBusConnection in order to send a notification to the freedesktop.org Desktop Notifications server.

Parameters:
connection - the DBusConnection with the freedesktop.org Desktop Notifications server
appName - the optional name of the application sending the notification
replacesId - the optional notification identifier of an existing notification to be replaced by the notification being sent; 0 to not replace any existing notification
icon - the optional icon to be displayed by the notification if the server supports such display. Not supported by this implementation at this time.
summary - the summary text briefly describing the notification
body - the optional detailed body text of the notification
expireTimeout - the time in milliseconds since the display of the notification after which the notification should automatically close. If -1, the notification's expiration time is dependent on the notification server's settings. If 0, never expires.
Returns:
the unique identifier of the sent notification if replacesId is 0; replacesId if replacesId is not 0
Throws:
DBusException - if sending the notification to the freedesktop.org Desktop Notifications server fails

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.