Search in sources :

Example 1 with GqServerSessionActivity

use of net.java.slee.resource.diameter.gq.GqServerSessionActivity in project jain-slee.diameter by RestComm.

the class DiameterGqResourceAdaptor method processRequest.

// NetworkReqListener Implementation -----------------------------------
@Override
public Answer processRequest(Request request) {
    if (tracer.isInfoEnabled()) {
        tracer.info("Diameter Gq RA :: Got Request. Command-Code[" + request.getCommandCode() + "]");
    }
    // * NO other message should make it here, if it gets its an error ?
    if (request.getCommandCode() == GqAARequest.COMMAND_CODE) {
        DiameterActivity activity;
        try {
            activity = raProvider.createActivity(request);
            if (activity == null) {
                tracer.severe("Diameter Gq 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 GqServerSessionActivity) {
                    GqServerSessionActivityImpl session = (GqServerSessionActivityImpl) activity;
                    ((GqServerSessionImpl) session.getSession()).processRequest(request);
                }
            }
        } catch (CreateActivityException e) {
            tracer.severe("Failure trying to create Gq Activity.", e);
        }
        // Returning null so we can answer later
        return null;
    } else {
        if (tracer.isInfoEnabled()) {
            tracer.info("Diameter Gq RA :: Received unexpected Request. Either its not AAR or session should exist to handle this, Command-Code: " + request.getCommandCode() + ", Session-Id: " + request.getSessionId());
        }
    }
    return null;
}
Also used : GqServerSessionActivity(net.java.slee.resource.diameter.gq.GqServerSessionActivity) GqServerSessionImpl(org.jdiameter.server.impl.app.gq.GqServerSessionImpl) 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 GqServerSessionActivity (net.java.slee.resource.diameter.gq.GqServerSessionActivity)1 GqServerSessionImpl (org.jdiameter.server.impl.app.gq.GqServerSessionImpl)1