Search in sources :

Example 1 with CreditControlServerSession

use of net.java.slee.resource.diameter.cca.CreditControlServerSession in project jain-slee.diameter by RestComm.

the class DiameterCCAResourceAdaptor method processRequest.

// NetworkReqListener Implementation -----------------------------------
public Answer processRequest(Request request) {
    // FIXME: baranowb: check if ACR is vald here also
    if (request.getCommandCode() == CreditControlRequest.commandCode) {
        DiameterActivity activity;
        try {
            activity = raProvider.createActivity(request);
            if (activity == null) {
                tracer.severe("Diameter CCA RA :: Failed to create session, Command-Code: " + request.getCommandCode() + ", Session-Id: " + request.getSessionId());
            } else {
                // We can only have server session?, but for sake error catching
                if (activity instanceof CreditControlServerSession) {
                    CreditControlServerSessionImpl session = (CreditControlServerSessionImpl) activity;
                    ((ServerCCASessionImpl) session.getSession()).processRequest(request);
                }
            }
        } catch (CreateActivityException e) {
            tracer.severe("Failure trying to create CCA Activity.", e);
        }
    } else {
        tracer.severe("Diameter CCA RA :: Received unexpected Request. Either its not CCR or session should exist to handle this, Command-Code: " + request.getCommandCode() + ", Session-Id: " + request.getSessionId());
    }
    // Returning null so we can answer later
    return null;
}
Also used : CreditControlServerSession(net.java.slee.resource.diameter.cca.CreditControlServerSession) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) DiameterActivity(net.java.slee.resource.diameter.base.DiameterActivity) ServerCCASessionImpl(org.jdiameter.server.impl.app.cca.ServerCCASessionImpl)

Aggregations

CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)1 DiameterActivity (net.java.slee.resource.diameter.base.DiameterActivity)1 CreditControlServerSession (net.java.slee.resource.diameter.cca.CreditControlServerSession)1 ServerCCASessionImpl (org.jdiameter.server.impl.app.cca.ServerCCASessionImpl)1