com.nokia.notifications
Class NotificationSessionFactory

java.lang.Object
  extended by com.nokia.notifications.NotificationSessionFactory

public final class NotificationSessionFactory
extends java.lang.Object

Creates NotificationSession that this MIDlet can use to communicate with the Notification Enabler. Each MIDlet may use only one NotificationSession instance at a time.

To get notification callbacks for the NotificationSessionListener, the NotificationSession should be kept open the whole lifetime of the MIDlet.

See Also:
NotificationSession, NotificationSessionListener

Method Summary
static java.lang.String getNotificationsEnablerVersion()
          Returns the version of the Notification Enabler
static NotificationSession openSession(MIDlet midlet, java.lang.String serviceId, java.lang.String applicationId, NotificationSessionListener listener)
           Creates NotificationSession that this MIDlet can use to communicate with the Notification Enabler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getNotificationsEnablerVersion

public static java.lang.String getNotificationsEnablerVersion()
Returns the version of the Notification Enabler

Returns:
the version of the Notification Enabler or null if the version or Notification Enabler is not available.

openSession

public static NotificationSession openSession(MIDlet midlet,
                                              java.lang.String serviceId,
                                              java.lang.String applicationId,
                                              NotificationSessionListener listener)
                                       throws NotificationException,
                                              java.lang.NullPointerException,
                                              java.lang.IllegalArgumentException

Creates NotificationSession that this MIDlet can use to communicate with the Notification Enabler. Each MIDlet may use only one NotificationSession instance at a time.

Note that this method can block for a while in case the client is not yet ready to accept opening new sessions.

Parameters:
midlet - The MIDlet that wants to open session with the Notification Enabler.
serviceId - Deprecated It is not used by the API, however you still need to pass the Service ID value.
applicationId - The ID that server uses to identify the notification target application.
listener - The listener to be notified when NotificationMessage, NotificationInfo or NotificationState is received.
Returns:
the NotificationSession
Throws:
NotificationException - if a session could not be opened.
java.lang.NullPointerException - if midlet, serviceId, applicationId or listener is null
java.lang.IllegalArgumentException - if serviceId or applicationId is empty or not acceptable