Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip
Class EventPackageSupport.Subscription

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.EventPackageSupport.Subscription
Direct Known Subclasses:
EventPackageNotifier.Subscription, EventPackageSubscriber.Subscription
Enclosing class:
EventPackageSupport

protected static class EventPackageSupport.Subscription
extends Object

Represents a general event package subscription in the sense of RFC 3265 "Session Initiation Protocol (SIP)-Specific Event Notification" and its signaling characteristics such as Request URI, id tag value of its Event header.

Author:
Lubomir Marinov

Field Summary
protected  javax.sip.address.Address address
          The subscription Address/Request URI associated with this instance and the target of the SUBSCRIBE requests being created as descriptions of this instance or of the NOTIFY requests being sent.
protected  String eventId
          The id tag to be present in Event headers in order to have this Subscription associated with a specific Request or Response.
 
Constructor Summary
EventPackageSupport.Subscription(javax.sip.address.Address address, String eventId)
          Initializes a new Subscription instance with a specific subscription Address/Request URI and a specific id tag of the associated Event headers.
 
Method Summary
protected  boolean addressEquals(javax.sip.address.Address address)
          Determines whether the Address/Request URI of this Subscription is equal to a specific Address in the sense of identifying one and the same resource.
protected  boolean equals(javax.sip.address.Address address, String eventId)
          Determines whether this Subscription is identified by a specific subscription Address/Request URI and a specific id tag of Event headers.
 javax.sip.address.Address getAddress()
          Gets the subscription Address/Request URI associated with this instance and the target of the SUBSCRIBE requests being created as descriptions of this instance or of the NOTIFY requests being sent.
protected  javax.sip.Dialog getDialog()
          Gets the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in.
 String getEventId()
          Gets the id tag to be present in Event headers in order to have this Subscription associated with a specific Request or Response.
protected  void removed()
          Notifies this Subscription that it has been removed from the list of subscriptions of the EventPackageSupport which used to contain it.
protected  void setDialog(javax.sip.Dialog dialog)
          Sets the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in.
protected  void setTimerTask(TimerTask timerTask)
          Sets the TimerTask associated this Subscription.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

protected final javax.sip.address.Address address
The subscription Address/Request URI associated with this instance and the target of the SUBSCRIBE requests being created as descriptions of this instance or of the NOTIFY requests being sent.


eventId

protected final String eventId
The id tag to be present in Event headers in order to have this Subscription associated with a specific Request or Response.

Constructor Detail

EventPackageSupport.Subscription

public EventPackageSupport.Subscription(javax.sip.address.Address address,
                                        String eventId)
Initializes a new Subscription instance with a specific subscription Address/Request URI and a specific id tag of the associated Event headers.

Parameters:
address - the subscription Address/Request URI which is to be the target of the SUBSCRIBE requests associated with the new instance or of the NOTIFY requests to be sent
eventId - the value of the id tag to be placed in the Event headers of the SUBSCRIBE and/or NOTIFY requests created for the new instance and to be present in the received Event headers in order to have the new instance associated with them
Method Detail

addressEquals

protected boolean addressEquals(javax.sip.address.Address address)
Determines whether the Address/Request URI of this Subscription is equal to a specific Address in the sense of identifying one and the same resource.

Parameters:
address - the Address to be checked for value equality to the Address/Request URI of this Subscription
Returns:
true if the Address/Request URI of this Subscription is equal to the specified Address in the sense of identifying one and the same resource

equals

protected boolean equals(javax.sip.address.Address address,
                         String eventId)
Determines whether this Subscription is identified by a specific subscription Address/Request URI and a specific id tag of Event headers.

Parameters:
address - the subscription Address/Request URI to be compared to the respective property of this Subscription
eventId - the id tag of Event headers to be compared to the respective property of this Subscription
Returns:
true if this Subscription has the specified subscription Address/Request URI and the specified id tag of Event headers; otherwise, false

getAddress

public final javax.sip.address.Address getAddress()
Gets the subscription Address/Request URI associated with this instance and the target of the SUBSCRIBE requests being created as descriptions of this instance or of the NOTIFY requests being sent.

Returns:
the subscription Address/Request URI associated with this instance and the target of the SUBSCRIBE requests being created as descriptions of this instance or of the NOTIFY requests being sent

getDialog

protected javax.sip.Dialog getDialog()
Gets the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in.

Returns:
the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in; null if the success of the SUBSCRIBE request has not been confirmed yet or this Subscription was removed from the list of the EventPackageSupport it used to be in

getEventId

public final String getEventId()
Gets the id tag to be present in Event headers in order to have this Subscription associated with a specific Request or Response. It is also being added to the Event headers when they are created during the generation of Requests or Responses describing this Subscription instance.

Returns:
the id tag to be present in Event headers in order to have this Subscription associated with a specific Request or Response

removed

protected void removed()
Notifies this Subscription that it has been removed from the list of subscriptions of the EventPackageSupport which used to contain it.


setDialog

protected void setDialog(javax.sip.Dialog dialog)
Sets the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in.

Parameters:
dialog - the Dialog which was created by the SUBSCRIBE request associated with this Subscription or which was used to send that request in

setTimerTask

protected void setTimerTask(TimerTask timerTask)
Sets the TimerTask associated this Subscription. If this Subscription already knows of a different TimerTask, that different one is first canceled before remembering the specified new one.

Parameters:
timerTask - a TimerTask to be associated with this Subscription

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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