Search in sources :

Example 1 with RxServerSessionActivity

use of net.java.slee.resource.diameter.rx.RxServerSessionActivity in project jain-slee.diameter by RestComm.

the class DiameterRxResourceAdaptor method processRequest.

// NetworkReqListener Implementation -----------------------------------
public Answer processRequest(final Request request) {
    if (tracer.isInfoEnabled()) {
        tracer.info("Diameter Rx RA :: Got Request. Command-Code[" + request.getCommandCode() + "]");
    }
    // FIXME: baranowb: check if ACR is vald here also
    if (request.getCommandCode() == AARequest.commandCode) {
        DiameterActivity activity;
        try {
            activity = raProvider.createActivity(request);
            if (activity == null) {
                tracer.severe("Diameter Rx RA :: Failed to create session, Command-Code: " + request.getCommandCode() + ", Session-Id: " + request.getSessionId());
            } else {
                if (activity instanceof RxServerSessionActivity) {
                    final RxServerSessionActivityImpl session = (RxServerSessionActivityImpl) activity;
                    ((ServerRxSessionImpl) session.getSession()).processRequest(request);
                }
            }
        } catch (CreateActivityException e) {
            tracer.severe("Failure trying to create Rx Activity.", e);
        }
        // Returning null so we can answer later
        return null;
    } else {
        if (tracer.isInfoEnabled()) {
            tracer.info("Diameter Rx 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 : ServerRxSessionImpl(org.jdiameter.server.impl.app.rx.ServerRxSessionImpl) RxServerSessionActivity(net.java.slee.resource.diameter.rx.RxServerSessionActivity) 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 RxServerSessionActivity (net.java.slee.resource.diameter.rx.RxServerSessionActivity)1 ServerRxSessionImpl (org.jdiameter.server.impl.app.rx.ServerRxSessionImpl)1