JBoss.orgCommunity Documentation
This chapter explains how to setup a JAIN SLEE Service Sbb to use the Enabler.
In short terms, a Service's Sbb will define the Enabler's Sbb as a child, and to achieve that it will need to setup the XML Descriptor, Abstract Class and SbbLocalObject interface.
The Service's Sbb will be referred as the Parent Sbb in the following sections.
Relation betweeen Parent Sbb, Enabler instance and subscriptions to Presence Server, look as follows:
JAIN SLEE SIP Subscription Client Enabler design
The JBoss Communications JAIN SLEE SIP Subscription Client Enabler Sbb provides synchronous callbacks to the Parent's Sbb, and that can only be achieved if the Parent's SbbLocalObject extends a specific Java interface, deployed also by the Enabler, and provides it's SbbLocalObject to the Enabler's Sbb, through a specific method exposed by the latter interface. The Enabler stores the Parent's SbbLocalObject and uses it when a callback to the Parent's Sbb is needed.
The SbbLocalObject which must be used or extended by the Parent's Sbb
is named
org.mobicents.slee.enabler.sip.SubscriptionClientParentSbbLocalObject
, which extends the
javax.slee.SbbLocalObject
and
org.mobicents.slee.enabler.sip.SubscriptionClientParent
interfaces, the latter declares the callbacks which must be
implemented in the Parent's Sbb Abstract Class:
package org.mobicents.slee.enabler.sip;
public interface SubscriptionClientParent {
public void subscribeSucceed(int responseCode,
SubscriptionClientChildLocalObject enabler);
public void unsubscribeSucceed(int responseCode,
SubscriptionClientChildLocalObject enabler);
public void onNotify(Notify notify,
SubscriptionClientChildLocalObject enabler);
public void subscribeFailed(int responseCode, S
ubscriptionClientChildLocalObject sbbLocalObject);
public void resubscribeFailed(int responseCode,
SubscriptionClientChildLocalObject sbbLocalObject);
public void unsubscribeFailed(int responseCode,
SubscriptionClientChildLocalObject sbbLocalObject);
}
subscribeSucceed(int responseCode, SubscriptionClientChildLocalObject enabler);
method:
Callback from the Enabler providing details about initial subscription. If it indicates error, enabler instance should be discarded.
unsubscribeSucceed(int responseCode, SubscriptionClientChildLocalObject enabler);
method:
Callback from the Enabler providing details about remove subscription. If it indicates error, enabler instance should be discarded.
onNotify(Notify notify, SubscriptionClientChildLocalObject enabler);
method:
Callback from the Enabler providing details about notification. If notification indicates termination of subscription, enabler can be safely removed.
subscribeFailed(SubscriptionClientChildLocalObject sbbLocalObject);
method:
Callback from the Enabler indicating communication failure, enabler instance must be discarded.
resubscribeFailed(SubscriptionClientChildLocalObject sbbLocalObject);
method:
Callback from the Enabler indicating communication failure, enabler instance must be discarded.
unsubscribeFailed(SubscriptionClientChildLocalObject sbbLocalObject);
method:
Callback from the Enabler indicating communication failure, enabler instance must be discarded.
The Parent Sbb Abstract Class must implement the callbacks in it's
SbbLocalObject, that is, must implement the
org.mobicents.slee.enabler.sip.SubscriptionClientParent
interface discussed in last section.
The Enabler is a Child Sbb. Parent requires JAIN SLEE 1.1 Child
Relation to
access Enabler. SLEE specification mandates parent to
declare an
abstract method to retrieve the
javax.slee.ChildRelation
object, which is used to create or access specific Child Sbbs. This
method may be declared as follows:
public abstract ChildRelation getSipSubscriptionClientChildRelation();
The Parent Sbb must define following information in its descriptor
A reference to the Enabler's Child Sbb is defined right after the Parent's Sbb Vendor ID element, using the following XML element:
<sbb-ref>
<sbb-name>SipSubscriptionClientChildSbb</sbb-name>
<sbb-vendor>org.mobicents</sbb-vendor>
<sbb-version>1.0</sbb-version>
<sbb-alias>sipSubClientChildSbb</sbb-alias>
</sbb-ref>
The method name to get the Enabler's ChildRelation object must be defined after the CMP Fields (if any), this XML element links the sbb-alias previously defined with the abstract method declared in the Parent's Sbb Abstract Class:
<get-child-relation-method>
<sbb-alias-ref>sipSubClientChildSbb</sbb-alias-ref>
<get-child-relation-method-name>getSipSubscriptionClientChildRelation</get-child-relation-method-name>
<default-priority>0</default-priority>
</get-child-relation-method>
After the
sbb-abstract-class
element the Parent's SbbLocalObject interface name is defined:
<sbb-local-interface>
<sbb-local-interface-name>...</sbb-local-interface-name>
</sbb-local-interface>