Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class EventPackageUtils

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.EventPackageUtils

public final class EventPackageUtils
extends Object

Implements utility methods to aid the manipulation of Dialog instances and extend the mentioned type with additional functionality.

Author:
Lubomir Marinov

Method Summary
static boolean addSubscription(javax.sip.Dialog dialog, Object subscription)
          Associates a specific subscription with the a given Dialog in order to allow it to keep the dialog in question alive even after a BYE request.
static boolean isByeProcessed(javax.sip.Dialog dialog)
          Determines whether a BYE request has already been processed in a specific Dialog and thus allows determining whether the dialog in question should be terminated when the last associated subscription is terminated.
static boolean processByeThenIsDialogAlive(javax.sip.Dialog dialog)
          Processes a BYE request in a specific Dialog for the purposes of subscription associations and returns an indicator which determines whether the specified dialog should still be considered alive after the processing of the BYE request.
static boolean removeSubscriptionThenIsDialogAlive(javax.sip.Dialog dialog, Object subscription)
          Dissociates a specific subscription with a given Dialog in order to no longer allow it to keep the dialog in question alive even after a BYE request, deletes the dialog if there are no other subscriptions associated with it and a BYE request has already been received and returns an indicator which determines whether the specified dialog is still alive after the dissociation of the given subscription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addSubscription

public static boolean addSubscription(javax.sip.Dialog dialog,
                                      Object subscription)
                               throws javax.sip.SipException
Associates a specific subscription with the a given Dialog in order to allow it to keep the dialog in question alive even after a BYE request.

Parameters:
dialog - the Dialog to associate the subscription with and to be kept alive after a BYE request because of the subscription
subscription - the subscription to be associated with dialog and keep it alive after a BYE request
Returns:
true if the specified subscription was associated with the given dialog; false if no changes were applied
Throws:
javax.sip.SipException - if the dialog is already terminated.

isByeProcessed

public static boolean isByeProcessed(javax.sip.Dialog dialog)
Determines whether a BYE request has already been processed in a specific Dialog and thus allows determining whether the dialog in question should be terminated when the last associated subscription is terminated.

Parameters:
dialog - the Dialog to be examined
Returns:
true if a BYE request has already been processed in the specified dialog; false, otherwise

processByeThenIsDialogAlive

public static boolean processByeThenIsDialogAlive(javax.sip.Dialog dialog)
                                           throws javax.sip.SipException
Processes a BYE request in a specific Dialog for the purposes of subscription associations and returns an indicator which determines whether the specified dialog should still be considered alive after the processing of the BYE request.

Parameters:
dialog - the Dialog in which a BYE request has arrived
Returns:
true if dialog should still be considered alive after processing the mentioned BYE request; false if dialog is to be expected to die after processing the request in question
Throws:
javax.sip.SipException - if the dialog is already terminated.

removeSubscriptionThenIsDialogAlive

public static boolean removeSubscriptionThenIsDialogAlive(javax.sip.Dialog dialog,
                                                          Object subscription)
Dissociates a specific subscription with a given Dialog in order to no longer allow it to keep the dialog in question alive even after a BYE request, deletes the dialog if there are no other subscriptions associated with it and a BYE request has already been received and returns an indicator which determines whether the specified dialog is still alive after the dissociation of the given subscription.

Parameters:
dialog - the Dialog to dissociate the subscription with and to no longer be kept alive after a BYE request because of the subscription
subscription - the subscription to be dissociated with dialog and to no longer be kept alive after a BYE request because of the subscription
Returns:
true if the dialog is still alive after the dissociation; false if the dialog was terminated because of the dissociation

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.