Search in sources :

Example 1 with ServerRoSessionImpl

use of org.jdiameter.server.impl.app.ro.ServerRoSessionImpl in project jain-slee.diameter by RestComm.

the class DiameterRoResourceAdaptor method processRequest.

// NetworkReqListener Implementation -----------------------------------
public Answer processRequest(Request request) {
    if (tracer.isInfoEnabled()) {
        tracer.info("Diameter Ro RA :: Got Request. Command-Code[" + request.getCommandCode() + "]");
    }
    // FIXME: baranowb: check if ACR is vald here also
    if (request.getCommandCode() == RoCreditControlRequest.commandCode) {
        DiameterActivity activity;
        try {
            activity = raProvider.createActivity(request);
            if (activity == null) {
                tracer.severe("Diameter Ro 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 RoServerSessionActivity) {
                    RoServerSessionActivityImpl session = (RoServerSessionActivityImpl) activity;
                    ((ServerRoSessionImpl) session.getSession()).processRequest(request);
                }
            }
        } catch (CreateActivityException e) {
            tracer.severe("Failure trying to create Ro Activity.", e);
        }
        // Returning null so we can answer later
        return null;
    } else {
        if (tracer.isInfoEnabled()) {
            tracer.info("Diameter Ro RA :: Received unexpected Request. Either its not CCR or session should exist to handle this, Command-Code: " + request.getCommandCode() + ", Session-Id: " + request.getSessionId());
        }
    }
    return null;
}
Also used : RoServerSessionActivity(net.java.slee.resource.diameter.ro.RoServerSessionActivity) ServerRoSessionImpl(org.jdiameter.server.impl.app.ro.ServerRoSessionImpl) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) DiameterActivity(net.java.slee.resource.diameter.base.DiameterActivity)

Aggregations

CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)1 DiameterActivity (net.java.slee.resource.diameter.base.DiameterActivity)1 RoServerSessionActivity (net.java.slee.resource.diameter.ro.RoServerSessionActivity)1 ServerRoSessionImpl (org.jdiameter.server.impl.app.ro.ServerRoSessionImpl)1