|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter
net.java.sip.communicator.impl.protocol.sip.EventPackageSupport
net.java.sip.communicator.impl.protocol.sip.EventPackageSubscriber
public class EventPackageSubscriber
Implements the subscriber part of RFC 3265 "Session Initiation Protocol (SIP)-Specific Event Notification" and thus eases the creation of event package-specific implementations.
| Nested Class Summary | |
|---|---|
static class |
EventPackageSubscriber.Subscription
Represents a general event package subscription in the sense of RFC 3265 "Session Initiation Protocol (SIP)-Specific Event Notification" from the point of view of the subscriber and its signaling characteristics such as Request URI, id tag value of its Event header, the Dialog which has been created by the associated SUBSCRIBE request or through which it was sent. |
| Field Summary |
|---|
| Fields inherited from class net.java.sip.communicator.impl.protocol.sip.EventPackageSupport |
|---|
contentSubType, eventPackage, protocolProvider, subscriptionDuration, timer |
| Constructor Summary | |
|---|---|
EventPackageSubscriber(ProtocolProviderServiceSipImpl protocolProvider,
String eventPackage,
int subscriptionDuration,
String contentSubType,
TimerScheduler timer,
int refreshMargin)
Initializes a new EventPackageSubscriber instance which is to provide subscriber support according to RFC 3265 to a specific SIP ProtocolProviderService implementation for a specific event package. |
|
| Method Summary | |
|---|---|
protected EventPackageSubscriber.Subscription |
getSubscription(javax.sip.address.Address toAddress,
String eventId)
Gets the Subscription from the list of subscriptions managed by this instance which is associated with a specific subscription Address/Request URI and has a specific id tag in its Event header. |
protected EventPackageSubscriber.Subscription |
getSubscription(String callId)
Gets the Subscription from the list of subscriptions managed by this instance which is associated with a specific CallId. |
void |
poll(EventPackageSubscriber.Subscription subscription)
Adds a specific Subscription to the list of subscriptions managed by this instance only if another Subscription with the same subscription Address/Request URI and id tag of its associated Event header does not exist in the list. |
boolean |
processRequest(javax.sip.RequestEvent requestEvent)
Implements MethodProcessor.processRequest(RequestEvent). |
boolean |
processResponse(javax.sip.ResponseEvent responseEvent)
Implements MethodProcessor.processResponse(ResponseEvent). |
boolean |
processTimeout(javax.sip.TimeoutEvent timeoutEvent)
If we got timeout we there is a problem with the connection, lets inform the provider. |
void |
subscribe(EventPackageSubscriber.Subscription subscription)
Creates and sends a SUBSCRIBE request to the subscription Address/Request URI of a specific Subscription in order to request receiving event notifications and adds the specified Subscription to the list of subscriptions managed by this instance. |
void |
unsubscribe(javax.sip.address.Address toAddress,
boolean assertSubscribed)
Creates and sends a SUBSCRIBE request to a specific subscription Address/Request URI if it matches a Subscription with an id tag of its Event header of null in the list of subscriptions managed by this instance with an Expires header value of zero in order to terminate receiving event notifications and removes the specified Subscription from the list of subscriptions managed by this instance. |
void |
unsubscribe(javax.sip.address.Address toAddress,
String eventId,
boolean assertSubscribed)
Creates and sends a SUBSCRIBE request to a specific subscription Address/Request URI if it matches a Subscription with an id tag of its Event header of a specific value in the list of subscriptions managed by this instance with an Expires header value of zero in order to terminate receiving event notifications and removes the specified Subscription from the list of subscriptions managed by this instance. |
| Methods inherited from class net.java.sip.communicator.impl.protocol.sip.EventPackageSupport |
|---|
addSubscription, getEventPackage, getOrCreateServerTransaction, getSubscriptions, processAuthenticationChallenge, processAuthenticationChallenge, removeSubscription, removeSubscription, removeSubscription, sendNotImplementedResponse |
| Methods inherited from class net.java.sip.communicator.impl.protocol.sip.MethodProcessorAdapter |
|---|
processDialogTerminated, processIOException, processTransactionTerminated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventPackageSubscriber(ProtocolProviderServiceSipImpl protocolProvider,
String eventPackage,
int subscriptionDuration,
String contentSubType,
TimerScheduler timer,
int refreshMargin)
protocolProvider - the SIP ProtocolProviderService implementation
for which the new instance is to provide subscriber support
for a specific event packageeventPackage - the name of the event package the new instance is to implement
and carry in the Event and Allow-Events headerssubscriptionDuration - the duration of each subscription to be managed by the new
instance and to be carried in the Expires headerscontentSubType - the sub-type of the content type of the NOTIFY bodies to be
announced, expected and supported by the subscriptions to be
managed by the new instancetimer - the Timer support which is to refresh the
subscriptions to be managed by the new instancerefreshMargin - the number of seconds before a subscription to be managed by
the new instance expires that the new instance should attempt
to refresh it| Method Detail |
|---|
protected EventPackageSubscriber.Subscription getSubscription(javax.sip.address.Address toAddress,
String eventId)
getSubscription in class EventPackageSupporttoAddress - the subscription Address/Request URI of the
Subscription to be retrievedeventId - the id tag placed in the Event header of the
Subscription to be retrieved if there is one or null if
the Subscription should have no id tag in its Event header
protected EventPackageSubscriber.Subscription getSubscription(String callId)
getSubscription in class EventPackageSupportcallId - the CallId associated with the Subscription to be
retrieved
public void poll(EventPackageSubscriber.Subscription subscription)
throws OperationFailedException
subscription - the new Subscription to be added to the list
of subscriptions managed by this instance if there is no other
Subscription in the list which has the same subscription
Address/Request URI and id tag of its Event header
OperationFailedException - if we fail constructing or sending the
subscription requestpublic boolean processRequest(javax.sip.RequestEvent requestEvent)
MethodProcessor.processRequest(RequestEvent). Handles
only NOTIFY requests because they are the only requests concerning event
package subscribers and if the processing of a given request requires
event package-specific handling, delivers the request to the matching
Subscription instance. Examples of such event package-specific handling
include handling the termination of an existing Subscription and
processing the bodies of the NOTIFY requests for active Subscriptions.
processRequest in interface MethodProcessorprocessRequest in class MethodProcessorAdapterrequestEvent - a RequestEvent specifying the SIP
Request to be processed
public boolean processResponse(javax.sip.ResponseEvent responseEvent)
MethodProcessor.processResponse(ResponseEvent).
Handles only responses to SUBSCRIBE requests because they are the only
requests concerning event package subscribers (and the only requests sent
by them, for that matter) and if the processing of a given response
requires event package-specific handling, delivers the response to the
matching Subscription instance. Examples of such event
package-specific handling include letting the respective
Subscription handle the success or failure in the establishment
of a subscription.
processResponse in interface MethodProcessorprocessResponse in class MethodProcessorAdapterresponseEvent - a ResponseEvent specifying the SIP
Response to be processed
public boolean processTimeout(javax.sip.TimeoutEvent timeoutEvent)
processTimeout in interface MethodProcessorprocessTimeout in class MethodProcessorAdaptertimeoutEvent - the timeoutEvent received indicating either the
message retransmit or transaction timed out
public void subscribe(EventPackageSubscriber.Subscription subscription)
throws OperationFailedException
subscription - a Subscription which specifies the properties of
the SUBSCRIBE request to be created and sent, to be added to
the list of subscriptions managed by this instance
OperationFailedException - if we fail constructing or sending the
subscription request.
public void unsubscribe(javax.sip.address.Address toAddress,
boolean assertSubscribed)
throws IllegalArgumentException,
OperationFailedException
toAddress - a subscription Address/Request URI which
identifies a Subscription to be removed from the
list of subscriptions managed by this instanceassertSubscribed - true to assert if the specified subscription
Address/Request URI does not identify an existing
Subscription in the list of subscriptions managed
by this instance; false to not assert if the
mentioned condition is met
IllegalArgumentException - if assertSubscribed is true and
toAddress does not identify an existing
Subscription in the list of subscriptions
managed by this instance
OperationFailedException - if we fail constructing or sending the
unSUBSCRIBE request.
public void unsubscribe(javax.sip.address.Address toAddress,
String eventId,
boolean assertSubscribed)
throws IllegalArgumentException,
OperationFailedException
toAddress - a subscription Address/Request URI which
identifies a Subscription to be removed from the
list of subscriptions managed by this instanceeventId - the id tag placed in the Event header of the
Subscription to be matched if there is one or
null if the Subscription should have no
id tag in its Event headerassertSubscribed - true to assert if the specified subscription
Address/Request URI does not identify an existing
Subscription in the list of subscriptions managed
by this instance; false to not assert if the
mentioned condition is met
IllegalArgumentException - if assertSubscribed is true and
toAddress and eventId do not
identify an existing Subscription in the list of
subscriptions managed by this instance
OperationFailedException - if we fail constructing or sending the
unSUBSCRIBE request.
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||