JBoss.orgCommunity Documentation

Chapter 2. Resource Adaptor Type

2.1. Activities
2.2. Events
2.3. Activity Context Interface Factory
2.4. Resource Adaptor Interface
2.5. Restrictions
2.6. Sbb Code Examples

Diameter Gx Resource Adaptor Type is defined by Mobicents team as part of effort to standardize RA Types.

Diameter Gx Type 2.7.0.FINAL defines the following Activities:

net.java.slee.resource.diameter.gx.GxClientSessionActivity

This type of activity represents client side of Gx session. Credit-Control-Request (CCR) messages can be created and sent in this Activity, receiving the respective Answer (or timeout) later on this Activity.

This activity type can be created with call to the proper createGxClientSessionActivity method of net.java.slee.resource.diameter.gx.GxProvider. It ends once underlying Credit Control session ends.

State machine for client Credit Control sessions can be found at Section 7 of Diameter Credit Control Application RFC.

net.java.slee.resource.diameter.gx.GxServerSessionActivity

This type of activity represents server side of Gx session. Credit-Control-Request (CCR) are received in this Activity and respective Answers are sent from it.

This activity type is implicitly created by the Resource Adaptor upon reception of the Credit-Control-Request message. It ends once underlying Credit Control session ends.

State machine for client Credit Control sessions can be found at Section 7 of Diameter Credit Control Application RFC.

All activities define methods required to properly function and expose necessary information to JAIN SLEE services. Gx Server Activity is defined as follows:



    public public GxCreditControlAnswer createGxCreditControlAnswer();
    public void sendCreditControlAnswer(GxCreditControlAnswer cca) throws IOException;
    
public GxCreditControlAnswer createGxCreditControlAnswer();

This method creates a Gx-specific Credit-Control-Answer message pre-populated with the AVPs appropriate for this session.

public void sendCreditControlAnswer(GxCreditControlAnswer cca) throws IOException;

This method sends a Credit-Control-Answer message to the peer.

Gx Client Activity is defined as follows:



    public void sendEventGxCreditControlRequest(GxCreditControlRequest ccr)
        throws IOException;
    public void sendInitialGxCreditControlRequest(GxCreditControlRequest ccr)
        throws IOException;
    public void sendUpdateGxCreditControlRequest(GxCreditControlRequest ccr)
        throws IOException;
    public void sendTerminationGxCreditControlRequest(GxCreditControlRequest ccr)
        throws IOException;
    
public void sendEventGxCreditControlRequest(GxCreditControlRequest ccr) throws IOException;

This method sends an event Credit-Control-Request.

public void sendInitialGxCreditControlRequest(GxCreditControlRequest ccr) throws IOException;

This method sends an initial Credit-Control-Request.

public void sendUpdateGxCreditControlRequest(GxCreditControlRequest ccr) throws IOException;

This method sends an update (intermediate) Credit-Control-Request.

public void sendTerminationGxCreditControlRequest(GxCreditControlRequest ccr) throws IOException;

This method sends a termination Credit-Control-Request.

Note

It is safe to type cast all the mentioned Diameter Activities to it's super interface net.java.slee.resource.diameter.base.DiameterActivity defined in Diameter Base Activities section.

Diameter Gx Resource Adaptor Type declares the Diameter Credit Control Application specific events, ie, Credit-Control-Request/Answer.

The following tables shows which events are fired on each activity.



Important

Spaces where introduced in Name and Event Class column values, to correctly render the table. Please remove them when using copy/paste.

The JBoss Communications Diameter Gx Activity Context Interface Factory is defined as follows:



    package net.java.slee.resource.diameter.gx;
    import javax.slee.ActivityContextInterface;
    import javax.slee.UnrecognizedActivityException;
    public interface GxActivityContextInterfaceFactory {
        public ActivityContextInterface 
            getActivityContextInterface(GxClientSessionActivity cSession
                throws UnrecognizedActivityException;
        public ActivityContextInterface 
            getActivityContextInterface(GxServerSessionActivity sSession)
                throws UnrecognizedActivityException;
    }
    

The JBoss Communications Diameter Gx Resource Adaptor SBB Interface provides SBBs with access to the Diameter objects required for creating and sending messages. It is defined as follows:



    package net.java.slee.resource.diameter.gx;
    import java.io.IOException;
    import net.java.slee.resource.diameter.base.CreateActivityException;
    import net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException;
    import net.java.slee.resource.diameter.base.events.avp.DiameterIdentity;
    import net.java.slee.resource.diameter.gx.events.GxCreditControlAnswer;
    import net.java.slee.resource.diameter.gx.events.GxCreditControlRequest;
    public interface GxProvider {
        public GxMessageFactory getGxMessageFactory();
        public GxAvpFactory getGxAvpFactory();
        public GxClientSessionActivity createGxClientSessionActivity()
            throws CreateActivityException;
        public GxClientSessionActivity createGxClientSessionActivity(
            DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
                throws CreateActivityException;
        public GxCreditControlAnswer sendGxCreditControlRequest(GxCreditControlRequest ccr)
            throws IOException;
        public DiameterIdentity[] getConnectedPeers();
        public int getPeerCount();
        public Validator getValidator();
    }
    

Current Resource Adaptor Type has no defined restrictions.

TODO