com.nokia.notifications
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.
Modifier and Type | Method and Description |
---|---|
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. |
public static java.lang.String getNotificationsEnablerVersion()
null
if
the version or Notification Enabler is not available.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.
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.NotificationSession
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