Search in sources :

Example 1 with CreateActivityException

use of net.java.slee.resource.diameter.base.CreateActivityException 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)

Example 2 with CreateActivityException

use of net.java.slee.resource.diameter.base.CreateActivityException 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)

Example 3 with CreateActivityException

use of net.java.slee.resource.diameter.base.CreateActivityException 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)

Example 4 with CreateActivityException

use of net.java.slee.resource.diameter.base.CreateActivityException in project jain-slee.diameter by RestComm.

the class DiameterGxResourceAdaptor method processRequest.

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

Example 5 with CreateActivityException

use of net.java.slee.resource.diameter.base.CreateActivityException 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)6 DiameterActivity (net.java.slee.resource.diameter.base.DiameterActivity)5 CreditControlServerSession (net.java.slee.resource.diameter.cca.CreditControlServerSession)1 GqServerSessionActivity (net.java.slee.resource.diameter.gq.GqServerSessionActivity)1 GxServerSessionActivity (net.java.slee.resource.diameter.gx.GxServerSessionActivity)1 RoServerSessionActivity (net.java.slee.resource.diameter.ro.RoServerSessionActivity)1 RxServerSessionActivity (net.java.slee.resource.diameter.rx.RxServerSessionActivity)1 ServerCCASessionImpl (org.jdiameter.server.impl.app.cca.ServerCCASessionImpl)1 GqServerSessionImpl (org.jdiameter.server.impl.app.gq.GqServerSessionImpl)1 ServerGxSessionImpl (org.jdiameter.server.impl.app.gx.ServerGxSessionImpl)1 ServerRfSessionImpl (org.jdiameter.server.impl.app.rf.ServerRfSessionImpl)1 ServerRoSessionImpl (org.jdiameter.server.impl.app.ro.ServerRoSessionImpl)1 ServerRxSessionImpl (org.jdiameter.server.impl.app.rx.ServerRxSessionImpl)1 DiameterActivityImpl (org.mobicents.slee.resource.diameter.base.DiameterActivityImpl)1