Package org.jainslee.resources.diameter.rf

The Diameter Rf Resource Adaptor type is based on RFC 6733 and 3GPP specifications of Rf interface defined in:

3GPP Technical Specification 32.299 v7.1.0.

3GPP Technical Specification 32.299 v7.9.0.

3GPP Technical Specification 32.299 v8.13.0.

3GPP Technical Specification 32.299 v9.6.0.

3GPP Technical Specification 32.299 v10.0.0.

3GPP Technical Specification 32.299 v11.8.0.

3GPP Technical Specification 32.299 v12.11.0.

The RfProviderFactory provider factory interface provides methods to obtain a appropriate version of provider interface.

SBBs can obtain a RfProviderFactory instance via JNDI after specifying an appropriate <resource-adaptor-entity-binding> entry in the SBB deployment descriptor.

Following provider interfaces provide methods to obtain a factory class to create Diameter Credit Control AVPs and Diameter messages.

For Rf version 7.1.0. org.jainslee.resources.diameter.rf.v710.RfProvider

For Rf version 7.9.0. org.jainslee.resources.diameter.rf.v790.RfProvider

For Rf version 8.13.0. org.jainslee.resources.diameter.rf.v8d0.RfProvider

For Rf version 9.6.0. org.jainslee.resources.diameter.rf.v960.RfProvider

For Rf version 10.0.0. org.jainslee.resources.diameter.rf.va00.RfProvider

For Rf version 11.8.0. org.jainslee.resources.diameter.rf.vb80.RfProvider

For Rf version 12.11.0. org.jainslee.resources.diameter.rf.vcb0.RfProvider

SBBs can obtain instance of one of provider interfaces calling one of methods: getRfPoviderV710() getRfPoviderV790() getRfPoviderV8d0() getRfPoviderV960() getRfPoviderVa00() getRfPoviderVb80() getRfPoviderVcb0() These methods return either instance of RfProvider if resource adaptor entity is configured to support corresponding 3GPP version or null if resource adaptor entity is not configured to support such 3GPP version.

Client Functionality -- Sending Diameter Accounting Requests

Asynchronous Requests

Examples below are applicable to RfProvider for all supported 3GPP versions. The SBB developer has to use only packages corresponding to required 3GPP version as listed below:

For 3GPP 7.1.0 : org.jainslee.resources.diameter.rf.v710 and org.jainslee.resources.diameter.rf.types.v710

For 3GPP 7.9.0 : org.jainslee.resources.diameter.rf.v790 and org.jainslee.resources.diameter.rf.types.v790

For 3GPP 8.13.0 : org.jainslee.resources.diameter.rf.v8d0 and org.jainslee.resources.diameter.rf.types.v8d0

For 3GPP 9.6.0 : org.jainslee.resources.diameter.rf.v960 and org.jainslee.resources.diameter.rf.types.v960

For 3GPP 10.0.0 : org.jainslee.resources.diameter.rf.va00 and org.jainslee.resources.diameter.rf.types.va00

For 3GPP 11.8.0 : org.jainslee.resources.diameter.rf.vb80 and org.jainslee.resources.diameter.rf.types.vb80

For 3GPP 12.11.0 : org.jainslee.resources.diameter.rf.vcb0 and org.jainslee.resources.diameter.rf.types.vcb0

The RfProvider interface provides a method to create a RfClientSessionActivity on which asynchronous Diameter requests can then be sent.

Diameter activities are created using the createClientSessionActivity() method or the createRfClientSessionActivity(DiameterIdentity, DiameterIdentity) method. The RfClientSessionActivity returned can be used to send asynchronous requests. When answers are received by the Diameter stack, AccountingAnswer events are fired on the activity.

Synchronous Requests

Note: The synchronous API should only be used for simple test services that are not expected to run at high loads. The resource adaptor does not currently implement timeouts for synchronous requests, so SBBs may block indefinitely. Services that use the synchronous model also do not scale well.

The RfProvider interface also has methods which will send a Diameter request then block until the answer is received. A AccountingAnswer instance will be the return value of the method call. See the RfProvider class for details.

Example

The following code fragment demonstrates creating and sending an ACR-Start message. The diameterRfProvider variable contains the RA SBB provider interface retrieved from JNDI. (Note: the utility methods used to create grouped AVPs are not shown.)

        RfClientSessionActivity activity =
            diameterProvider.createRfClientSessionActivity(null, new DiameterIdentity("opencloud"));

        RfMessageFactory messageFactory = diameterProvider.getRfMessageFactory();
        AccountingRequest acr = messageFactory.createRfAccountingRequest(AccountingRecordType.START_RECORD);

        ActivityContextInterface diameterACI = diameterACIFactory.getActivityContextInterface(activity);
        diameterACI.attach(getSbbLocalObject());

        activity.sendAccountingRequest(acr);
    

Client Functionality -- Receiving Diameter Accounting Answers

Example

The following code fragment demonstrates an AccountingAnswer being received by an SBB.
        public void onAccountingAnswer(AccountingAnswer aca, ActivityContextInterface aci) {
            long resultCode = aca.getResultCode();

            // handle aca

        }
    

Server Functionality -- Receiving Diameter Accounting Requests

Example

        public void onAccountingRequest(AccountingRequest acr, ActivityContextInterface aci) {
            RfServerSessionActivity rfActivity = (RfServerSessionActivity) aci.getActivity();
            AccountingAnswer aca = rfActivity.createRfAccountingAnswer(acr); // copy values from request
            aca.setResultCode(DiameterResultCode.DIAMETER_SUCCESS);
            rfActivity.sendAccountingAnswer(aca);
        }