JBoss.orgCommunity Documentation

Chapter 4. Using the Mobicents JAIN SLEE SIP Publication Client Enabler

4.1. The Child's SbbLocalObject Interface
4.2. Creating And Retrieving The Child Sbb
4.3. Enabler configuration

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:

manage publication

send publication events on behalf of Parent Sbb

automatic refresh

based on values exchanged between Enabler and Server, Enabler keeps track of publication life time(expiration) and issues refresh requests to Server

JAIN SLEE SIP Publication Client Enabler control flow

The Mobicents JAIN SLEE SIP Publication Client Enabler Sbb, the Child Sbb, implements the org.mobicents.slee.enabler.sip.PublicationClientChildSbbLocalObject , which extends the javax.slee.SbbLocalObject and org.mobicents.slee.enabler.sip.PublicationClientChild interfaces, the latter declares the methods which can be used to interact with the Server:



package org.mobicents.slee.enabler.sip;
public interface PublicationClientChild {
    
    public void newPublication(String entity, String eventPackage, String document, String contentType, 
        String contentSubType, int expires);
    public void modifyPublication(String document, String contentType
        , String contentSubType, int expires);
    public void removePublication();
    public String getEntity();
    public String getETag();
    public void setParentSbb(PublicationClientParentSbbLocalObject parent);
}
        
        

The Child Relation in the Parent Sbb Abstract Class is used to create and retrieve the Child Sbb, it is important to not forget to pass the Parent's SbbLocalObject to the Child after creation:



public PublicationClientChildLocalInterface getPublicationClientChildSbb() {
    final ChildRelation childRelation = getSipPublicationClientChildRelation();
    if (childRelation.isEmpty()) {
        try {
            // creates new instance
            SipPublicationClientChildSbbLocalInterface sbb = 
                (PublicationClientChildSbbLocalObject) childRelation.create();
            // passes the parent sbb local object to the child
            sbb.setParentSbb((PublicationClientParentSbbLocalObject) 
                sbbContext.getSbbLocalObject());
            return sbb;
        } catch (Exception e) {
            tracer.severe("Failed to create child sbb", e);
            return null;
        }
    }else {
        (PublicationClientChildSbbLocalObject) return childRelation.iterator().next();
    }
}
    
        

The SbbLocalObject of the Child could also be stored in a CMP Field for the simplest retrieval, but unless you are going to reuse each instance several times it's better to have less state, specially in clustered environments.

Enabler can be configured with SLEE environment entries. Currently following entries are supported: