Search in sources :

Example 21 with DiameterActivityImpl

use of org.mobicents.slee.resource.diameter.base.DiameterActivityImpl in project jain-slee.diameter by RestComm.

the class DiameterRfResourceAdaptor method processRequest.

// NetworkReqListener Implementation -----------------------------------
/*
   * (non-Javadoc)
   * @see org.jdiameter.api.NetworkReqListener#processRequest(org.jdiameter.api.Request)
   */
public Answer processRequest(Request request) {
    DiameterActivityImpl activity;
    try {
        activity = (DiameterActivityImpl) raProvider.createActivity(request);
        if (activity instanceof RfServerSessionActivityImpl) {
            RfServerSessionActivityImpl assai = (RfServerSessionActivityImpl) activity;
            ((ServerRfSessionImpl) assai.getSession()).processRequest(request);
        } else if (activity instanceof RfClientSessionActivityImpl) {
            RfClientSessionActivityImpl assai = (RfClientSessionActivityImpl) activity;
            ((ClientRfSessionImpl) assai.getSession()).processRequest(request);
        }
    } catch (CreateActivityException e) {
        tracer.severe("Failure trying to create Rf Activity.", e);
    }
    // returning null so we can answer later
    return null;
}
Also used : ServerRfSessionImpl(org.jdiameter.server.impl.app.rf.ServerRfSessionImpl) DiameterActivityImpl(org.mobicents.slee.resource.diameter.base.DiameterActivityImpl) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException)

Example 22 with DiameterActivityImpl

use of org.mobicents.slee.resource.diameter.base.DiameterActivityImpl in project jain-slee.diameter by RestComm.

the class DiameterRfResourceAdaptor method queryLiveness.

// Mandatory callback methods ------------------------------------------
public void queryLiveness(ActivityHandle handle) {
    tracer.info("Diameter Rf RA :: queryLiveness :: handle[" + handle + "].");
    if (!(handle instanceof DiameterActivityHandle)) {
        return;
    }
    DiameterActivityImpl activity = (DiameterActivityImpl) activities.get((DiameterActivityHandle) handle);
    if (activity != null && !activity.isValid()) {
        try {
            sleeEndpoint.endActivity(handle);
        } catch (Exception e) {
            tracer.severe("Failure ending non-live activity.", e);
        }
    }
}
Also used : DiameterActivityHandle(org.mobicents.slee.resource.diameter.base.DiameterActivityHandle) DiameterActivityImpl(org.mobicents.slee.resource.diameter.base.DiameterActivityImpl) AvpDataException(org.jdiameter.api.AvpDataException) InternalException(org.jdiameter.api.InternalException) IllegalDiameterStateException(org.jdiameter.api.IllegalDiameterStateException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Aggregations

DiameterActivityImpl (org.mobicents.slee.resource.diameter.base.DiameterActivityImpl)22 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)19 InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)18 AvpDataException (org.jdiameter.api.AvpDataException)16 OperationNotSupportedException (javax.naming.OperationNotSupportedException)14 IOException (java.io.IOException)11 DiameterActivityHandle (org.mobicents.slee.resource.diameter.base.DiameterActivityHandle)7 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)6 InternalException (org.jdiameter.api.InternalException)6 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)3 DiameterMessageFactoryImpl (org.mobicents.slee.resource.diameter.base.DiameterMessageFactoryImpl)3 InvalidTransactionException (javax.transaction.InvalidTransactionException)2 SystemException (javax.transaction.SystemException)2 OverloadException (org.jdiameter.api.OverloadException)1 RouteException (org.jdiameter.api.RouteException)1 ServerRfSessionImpl (org.jdiameter.server.impl.app.rf.ServerRfSessionImpl)1