public interface SubscriptionActivity
NB: Dialogs may be associated with any number of subscription activities. Apart from the Big Notify operation, it is the application's responsibility to send the appropriate messages on each dialog during subscription initiation, refreshes and termination. For example, the application must respond to the initial SUBSCRIBE request and send the initial NOTIFY request on a new dialog, and it must send the final "Subscription-State: terminated" NOTIFY request on the dialog.
SubscriptionActivityfor a resource is created on demand by calling
BigGroupProvider.getSubscriptionActivity(String, boolean). This method takes an application-defined string key, which uniquely identifies the subscribed resource.
terminate()is called, or may be ended implicitly when all subscription dialog activities have ended, and no SLEE facilities (timer, AC naming etc) have references to the activity.
ServerTransactionactivity, as normal. It is the application's responsibility to create the dialog activity for the subscription. The application may then call
addSubscriptionDialog()to add the dialog to the set of subscription dialogs associated with the
SubscriptionActivity. The dialog will then take part in any Big Notify operations. The application should set a timer based on the subscription's expiry time.
SubscriptionActivitydoes not directly take part in subscription refreshes, it is up to the application to process them. If the refresh is accepted, the application should reset the subscription's expiry timer, if it set one. If the application does not accept the refresh, it can end the dialog, or remove it from the
sendNotify()method initiates a Big Notify operation. This is where a NOTIFY is sent on all dialogs associated with a
SubscriptionActivity. This is more efficient and convenient than the application generating all the NOTIFY requests itself. This creates a
NotifyActivity, and the results of the notification are collected in a
removeSubscriptionDialog(net.java.slee.resource.sip.DialogActivity). This will ensure the dialog no longer takes part in Big Notify operations.
removeSubscriptionDialog(net.java.slee.resource.sip.DialogActivity). This does not happen automatically when the dialog activity ends for any reason. When a subscription dialog is removed it no longer takes part in Big Notify operations.
|Modifier and Type||Method and Description|
Adds the given dialog to this
Get the unique string that identifies the subscribed resource.
Removes the given dialog from this
Generates and sends a NOTIFY out on all subscription dialogs, and gathers the responses in a single
Terminates this subscription activity immediately.
void addSubscriptionDialog(DialogActivity dialog)
SubscriptionActivity. The dialog will now take part in subsequent Big Notify operations on this activity.
dialog- a dialog activity that was created by an initial SUBSCRIBE request.
void removeSubscriptionDialog(DialogActivity subscriberDialog)
SubscriptionActivity. The dialog will no longer take part in subsequent Big Notify operations on this activity. No messages are sent on the dialog. If there are no more subscribed dialogs, and no SLEE facilities have references to this
SubscriptionActivity, it will be ended automatically.
subscriberDialog- the subscription dialog representing a subscribed user agent
NotifyActivity sendNotify(long timeout, UpdateRequest notifyUpdater)
NotifyResultEvent, a.k.a. Big Notify.
timeout- the maximum time (in milliseconds) to wait for all responses, before firing the
notifyUpdater- a function to update the NOTIFY request before it is sent. This must be used to populate the NOTIFY request with the application's current view of resource state.
NotifyActivity, on which the
NotifyResultEventwill be fired
IllegalArgumentException- if timeout is negative or notifyUpdater is