Creates a new timer notification with the specified
type
,
message
and
userData
and inserts it into the list of notifications with a given date,
period and number of occurrences.
Creates a new timer notification with the specified
type
,
message
and
userData
and inserts it into the list of notifications with a given date,
period and number of occurrences.
If the timer notification to be inserted has a date that is before the current date,
the method behaves as if the specified date were the current date.
For once-off notifications, the notification is delivered immediately.
For periodic notifications, the first notification is delivered immediately and the
subsequent ones are spaced as specified by the period parameter.
Note that once the timer notification has been added into the list of notifications,
its associated date, period and number of occurrences cannot be updated.
In the case of a periodic notification, uses a fixed-delay execution scheme, as specified in
Timer
. In order to use a fixed-rate execution scheme, use
Timer.addNotification(String, String, Object, Date, long, long, boolean)
instead.
Returns:
The identifier of the new created timer notification.
Parameters:
- type - The timer notification type.
- message - The timer notification detailed message.
- userData - The timer notification user data object.
- date - The date when the notification occurs.
- period - The period of the timer notification (in milliseconds).
- nbOccurences - The total number the timer notification will be emitted.
Throws:
- java.lang.IllegalArgumentException - The date is {@code null} or
the period or the number of occurrences is negative.
See Also:
Timer.addNotification(String, String, Object, Date, long, long, boolean)
,