JBoss.orgCommunity Documentation
In the last chapter we integrated the Enabler in the JAIN SLEE Service's Sbb, the Parent Sbb, in this chapter it is explained how to use the Enabler's Sbb, the Child Sbb.
Enabler performs following tasks:
send subscription events on behalf of Parent Sbb
based on values exchanged between Enabler and Server, Enabler keeps track of subscription life time(expiration) and issues refresh requests to Server
JAIN SLEE SIP Subscription Client Enabler control flow
The JBoss Communications
JAIN SLEE SIP Subscription Client
Enabler Sbb, the Child Sbb, implements the
org.mobicents.slee.enabler.sip.SubscriptionClientChildSbbLocalObject
, which extends the
org.mobicents.slee.SbbLocalObjectExt
and
org.mobicents.slee.enabler.sip.SubscriptionClientChild
interfaces, the latter declares the methods which can be used to
interact with the SIP Event Server:
package org.mobicents.slee.enabler.sip;
public SubscriptionData getSubscriptionData();
public void subscribe(SubscriptionData subscriptionData) throws SubscriptionException;
public void subscribe(SubscriptionData subscriptionData, SubscriptionRequestContent content) throws SubscriptionException;
public void unsubscribe() throws SubscriptionException;
getSubscriptionData();
method:
returns the static data related to the subscription, which can be used to, for instance, retrieve the resource subscribed.
public void subscribe(SubscriptionData subscriptionData) throws SubscriptionException;
method:
Requests the creation of a new SIP subscription, from the specified subscription data. For detailed information related with the SubscriptionData class, please read its javadoc.
public void subscribe(SubscriptionData subscriptionData, SubscriptionRequestContent content) throws SubscriptionException;
method:
Requests the creation of a new SIP subscription, from the specified subscription data, and with content to be included in the initial subscribe request. For detailed information related with the SubscriptionData and SubscriptionRequestContent classes, please read its javadoc.
unsubscribe() throws SubscriptionException;
method:
this method should be called to explicitly to terminate the subscription. The subscription will be effectively terminated once a notification with terminated state is received. If enabler is refreshing, when this method is called, it will throw exception.
The Child Relation in the Parent Sbb Abstract Class is used to create and retrieve the Child Sbb:
SubscriptionClientChildLocalObject sbb = null;
// creation
try {
sbb = (SubscriptionClientChildLocalObject) getSipSubscriptionClientChildRelation().create(childName);
}
catch (Exception e) {
tracer.severe("Failed to create child sbb", e);
}
// retrieval
try {
sbb = (SubscriptionClientChildLocalObject) getSipSubscriptionClientChildRelation().get(childName);
}
catch (Exception e) {
tracer.severe("Failed to retrieve child sbb", e);
}
Enabler can be configured with SLEE environment entries. Currently following entries are supported:
Table 4.1. Environment entry table
Name | Type | Description |
---|---|---|
server.address |
java.lang.String |
Specifies address to which requests should be forwarded. It has form of ip:port pair. |
expires.drift |
java.lang.Integer |
Specifies time drift, in seconds, between value of Expires/Min-Expires values and automatic refresh performed by enabler. For instance if Expires value passed(and accepted by Server) is 3600, time drift set to 10, Enabler will refresh publication after 3590 |