SHOW Signed
 

net.rim.device.api.notification
Class NotificationsManager

java.lang.Object
  |
  +--net.rim.device.api.notification.NotificationsManager
All Implemented Interfaces:
NotificationsConstants

public final class NotificationsManager
extends Object
implements NotificationsConstants

Manages the handling of events between applications and the notification engine. Keeps track of registered engine listeners as well as known consequence implementors.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 3.6.0

Field Summary
 
Fields inherited from interface net.rim.device.api.notification.NotificationsConstants
CALLERID_ADDRESSCARD_UID, CASUAL, CONTINUOUS_REPEAT, CRITICAL, CUSTOM_TUNE_NAME, DEFAULT_LEVEL, FORCE_NO_REPEAT_NOTIFICATIONS_FLAG, FORCED, IMPORTANT, IN_HOLSTER_ENGINE_STATE, MANUAL_TRIGGER, NO_RELATED_SOURCE, NO_SOURCE, NOTIFICATION_LEVEL_KEY, NOTIFICATION_PRIVATE_FLAG_KEY, NOTIFICATION_REPEAT_COUNT, NOTIFICATION_REPEAT_DELAY, OUT_OF_HOLSTER_ENGINE_STATE, OUT_OF_HOLSTER_TRIGGER, SENSITIVE, STOP_CONDITIONS
 
Method Summary
 Category: Signed static void cancelAllDeferredEvents(long sourceID, int triggerIndex, Object context)
          Cancels all events matching the source, level and trigger.
 Category: Signed static void cancelDeferredEvent(long sourceID, long eventID, Object eventReference, int triggerIndex, Object context)
          Cancels the event.
 Category: Signed static void cancelImmediateEvent(long sourceID, long eventID, Object eventReference, Object context)
          Cancels any current immediate events.
 Category: Signed static void deregisterConsequence(long consequenceID)
          Removes the consequence from the list of known consequences.
 Category: Signed static void deregisterNotificationsEngineListener(long sourceID, NotificationsEngineListener listener)
          Removes the listener from the list of known listeneres.
 Category: Signed static void deregisterSource(long sourceID)
          Removes the application from the list of known event sources.
 Category: Signed static int getDeferredEventCount(long sourceID)
          Returns the count of all events matching the source currently in the queue.
 Category: Signed static long[] getDeferredEventIds(long sourceID)
          Returns the count of all events matching the source currently in the queue.
 Category: Signed static Object[] getDeferredEvents(long sourceID)
          Returns the count of all events matching the source currently in the queue.
 Category: Signed static long getLastEventDate()
          Method returns time stamp when the latest even either immediate or deferred happened
 Category: Signed static int getMasterNotificationVolume()
          Returns the master volume setting for notifications.
 Category: Signed static void hideSource(long sourceID)
          Hide the application from the list of known event sources.
 Category: Signed static boolean isHidden(long sourceID)
          Returns true if this source is marked as hidden.
 Category: Signed static boolean isImmediateEventOccuring(long sourceIdLong)
          Tests whether a particular event is playing or led blinking for an profile
 Category: Signed static boolean isVibrateOnly()
          Returns whether the device is in a Vibrate-Only mode.
 Category: Signed static void moveSource(long srcSourceID, long destSourceID)
          Changes the value of the source identifier specified by srcSourceID to destSourceID.
 Category: Signed static void negotiateDeferredEvent(long sourceID, long eventID, Object eventReference, long eventDate, int triggerIndex, Object context)
          Adds the specified event to the event queue.
 Category: Signed static void registerConsequence(long consequenceID, Consequence consequence)
          Adds a new consequence to the list of known event consequences.
 Category: Signed static void registerNotificationsEngineListener(long sourceID, NotificationsEngineListener listener)
          Adds a listener to the list of known engine listeners.
 Category: Signed static void registerSource(long sourceID, Object source, int level)
          Adds the application to the list of known event sources.
 Category: Signed static void registerSource(long sourceID, Object source, int level, long relatedSourceID)
          Adds the application to the list of known event sources, inheriting defaults from another application.
 Category: Signed static void setPhoneRingTone(String ringtone)
          Sets the ringtone for all profiles.
 Category: Signed static void triggerImmediateEvent(long sourceID, long eventID, Object eventReference, Object context)
          Triggers an immediate event.
 Category: Signed static void triggerImmediateEvent(long sourceID, long eventID, Object eventReference, Object context, int notificationCategory)
          Triggers an immediate event.
 Category: Signed static void unHideSource(long sourceID)
          Reveal a hidden the application from the list of known event sources.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail


cancelAllDeferredEvents

public static void cancelAllDeferredEvents(long sourceID,
                                           int triggerIndex,
                                           Object context)
Cancels all events matching the source, level and trigger.
Parameters:
sourceID - Identifier of the application that queued the events.
triggerIndex - Identifier of the way in which the events were to be triggered.
context - Optional context object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

cancelDeferredEvent

public static void cancelDeferredEvent(long sourceID,
                                       long eventID,
                                       Object eventReference,
                                       int triggerIndex,
                                       Object context)
Cancels the event. This could be the current event being negotiated or a future event still in the event queue.
Parameters:
sourceID - Identifier of the application that queued the event.
eventID - Application-specific event identifier.
eventReference - Application-specific event cookie.
triggerIndex - Identifier of the way in which the event was to be triggered.
context - Optional context object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

cancelImmediateEvent

public static void cancelImmediateEvent(long sourceID,
                                        long eventID,
                                        Object eventReference,
                                        Object context)
Cancels any current immediate events.
Parameters:
sourceID - Identifier of the application that triggered the event.
eventID - Application-specific event identifier.
eventReference - Application-specific event cookie.
context - Optional context object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

deregisterConsequence

public static void deregisterConsequence(long consequenceID)
Removes the consequence from the list of known consequences.
Parameters:
consequenceID - GUID of the consequence object to deregister.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

deregisterNotificationsEngineListener

public static void deregisterNotificationsEngineListener(long sourceID,
                                                         NotificationsEngineListener listener)
Removes the listener from the list of known listeneres.
Parameters:
sourceID - GUID of the listener object to deregister.
listener - Listener object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

deregisterSource

public static void deregisterSource(long sourceID)
Removes the application from the list of known event sources.
Parameters:
sourceID - Identifier of the application to deregister.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getDeferredEventCount

public static int getDeferredEventCount(long sourceID)
Returns the count of all events matching the source currently in the queue.
Parameters:
sourceID - GUID of the source object.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getDeferredEventIds

public static long[] getDeferredEventIds(long sourceID)
Returns the count of all events matching the source currently in the queue.
Parameters:
sourceID - GUID of the source object.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getDeferredEvents

public static Object[] getDeferredEvents(long sourceID)
Returns the count of all events matching the source currently in the queue.
Parameters:
sourceID - GUID of the source object.
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getLastEventDate

public static long getLastEventDate()
Method returns time stamp when the latest even either immediate or deferred happened
Returns:
Time stamp when the latest even either immediate or deferred happened.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getMasterNotificationVolume

public static int getMasterNotificationVolume()
Returns the master volume setting for notifications.
Returns:
the master volume setting as an integer from 0 (silent) to 100 (max)
Since:
JDE 4.7.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

hideSource

public static void hideSource(long sourceID)
Hide the application from the list of known event sources.
Parameters:
sourceID - Identifier of the application to hide.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isHidden

public static boolean isHidden(long sourceID)
Returns true if this source is marked as hidden.
Returns:
boolean true if this source is marked as hidden, false otherwise.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isImmediateEventOccuring

public static boolean isImmediateEventOccuring(long sourceIdLong)
Tests whether a particular event is playing or led blinking for an profile
Returns:
True if it an immediate event is occuring
Since:
JDE 4.1.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isVibrateOnly

public static boolean isVibrateOnly()
Returns whether the device is in a Vibrate-Only mode.
Returns:
true if the device is in a Vibrate-Only mode, false otherwise.
Since:
JDE 4.7.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

moveSource

public static void moveSource(long srcSourceID,
                              long destSourceID)
Changes the value of the source identifier specified by srcSourceID to destSourceID. If destSourceID is already registered to another source, it will be overwritten by the source identifier srcSourceID and it will no longer be accessible.
Parameters:
srcSourceID - Old Identifier of the source.
destSourceID - New Identifier of the source.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

negotiateDeferredEvent

public static void negotiateDeferredEvent(long sourceID,
                                          long eventID,
                                          Object eventReference,
                                          long eventDate,
                                          int triggerIndex,
                                          Object context)

Adds the specified event to the event queue. Exactly where in the queue the event is inserted is engine-specific, i.e., neither the event nor the application can decide it.

The triggerIndex parameter specifies further criteria for determining the event. Currently only two values are defined:

  • NotificationsConstants.OUT_OF_HOLSTER_TRIGGER
  • NotificationsConstants.MANUAl_TRIGGER
If OUT_OF_HOLSTER_TRIGGER is specified, the event will occur when the device is next removed from the holster. Furthermore, the event will expire on it's own if the eventDate time is reached. Finally, the current implementation will drop this event if the device is NOT in the holster when this call is made.

If the value MANUAL_TRIGGER is specified as the triggerIndex, the eventDate expiry parameter is ignored.

An event can be cancelled via the cancelDeferredEvent method. Furthermore, this call must be made to cancel an event that has no timeout.

Parameters:
sourceID - Identifier of the application that is queuing the event.
eventID - Application-specific event identifier.
eventReference - Application-specific event cookie.
eventDate - Event expiry time in absolute time in ms. This parameter is currently ignored UNLESS the triggerIndex is NotificationsConstants.OUT_OF_HOLSTER_TRIGGER
triggerIndex - Identifier of the way in which the event will be triggered.
context - Optional context object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

registerConsequence

public static void registerConsequence(long consequenceID,
                                       Consequence consequence)
Adds a new consequence to the list of known event consequences.
Parameters:
consequenceID - GUID of the consequence object to register.
consequence - Consequence object itself.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

registerNotificationsEngineListener

public static void registerNotificationsEngineListener(long sourceID,
                                                       NotificationsEngineListener listener)
Adds a listener to the list of known engine listeners.
Parameters:
sourceID - GUID of the listener object to register.
listener - Listener object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

registerSource

public static void registerSource(long sourceID,
                                  Object source,
                                  int level)
Adds the application to the list of known event sources.
Parameters:
sourceID - Identifier of the application to register.
source - Source application object.
level - Level at which the application is to be registered.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

registerSource

public static void registerSource(long sourceID,
                                  Object source,
                                  int level,
                                  long relatedSourceID)
Adds the application to the list of known event sources, inheriting defaults from another application. This allows appications to register sub types (ie different settings for different email addresses, different calendar sources etc (ie personal vs corprorate calendar reminders)
Parameters:
sourceID - Identifier of the application to register.
source - Source application object.
level - Level at which the application is to be registered.
relatedSourceID - Identifier of the application that this source will inherit from
Throws:
NullPointerException - if source is null.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setPhoneRingTone

public static void setPhoneRingTone(String ringtone)
Sets the ringtone for all profiles.
Parameters:
ringtone - Filename of the ringtone to be set.
Since:
JDE 4.7.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

triggerImmediateEvent

public static void triggerImmediateEvent(long sourceID,
                                         long eventID,
                                         Object eventReference,
                                         Object context)
Triggers an immediate event. This is intended to support consequences such as tone, vibration or the LED. In other words, things that do not require user interaction.
Parameters:
sourceID - Identifier of the application triggering the event.
eventID - Application-specific event identifier.
eventReference - Application-specific event cookie.
categoryId -
context - Optional context object.
Since:
JDE 3.6.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

triggerImmediateEvent

public static void triggerImmediateEvent(long sourceID,
                                         long eventID,
                                         Object eventReference,
                                         Object context,
                                         int notificationCategory)
Triggers an immediate event. This is intended to support consequences such as tone, vibration or the LED. In other words, things that do not require user interaction.
Parameters:
sourceID - Identifier of the application triggering the event.
eventID - Application-specific event identifier.
eventReference - Application-specific event cookie.
context - Optional context object.
notificationCategory - identifies a category of notifications one of NotificationsConstants#CATEGORY_PHONE NotificationsConstants#CATEGORY_MESSAGES NotificationsConstants#CATEGORY_REMINDERS
Since:
JDE 4.7.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

unHideSource

public static void unHideSource(long sourceID)
Reveal a hidden the application from the list of known event sources.
Parameters:
sourceID - Identifier of the application to un hide.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.