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(javax.microedition.midlet.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
equals, 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(javax.microedition.midlet.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


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.