Search in sources :

Example 1 with DiameterActivityHandle

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

the class DiameterCCAResourceAdaptor method queryLiveness.

// Mandatory callback methods ------------------------------------------
public void queryLiveness(ActivityHandle handle) {
    tracer.info("Diameter CCA 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) InvalidTransactionException(javax.transaction.InvalidTransactionException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) SystemException(javax.transaction.SystemException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 2 with DiameterActivityHandle

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

the class DiameterGxResourceAdaptor method queryLiveness.

/**
 * {@inheritDoc}
 */
@Override
public void queryLiveness(final ActivityHandle handle) {
    tracer.info("Diameter Gx RA :: queryLiveness :: handle[" + handle + "].");
    final 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) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 3 with DiameterActivityHandle

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

the class DiameterGqResourceAdaptor method queryLiveness.

// Mandatory callback methods ------------------------------------------
@Override
public void queryLiveness(ActivityHandle handle) {
    tracer.info("Diameter Ro RA :: queryLiveness :: handle[" + handle + "].");
    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) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 4 with DiameterActivityHandle

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

the class DiameterRoResourceAdaptor method queryLiveness.

// Mandatory callback methods ------------------------------------------
public void queryLiveness(ActivityHandle handle) {
    tracer.info("Diameter Ro RA :: queryLiveness :: handle[" + handle + "].");
    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) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 5 with DiameterActivityHandle

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

the class DiameterS6aResourceAdaptor method stateChanged.

/* (non-Javadoc)
   * @see org.mobicents.slee.resource.diameter.s6a.handlers.S6aSessionCreationListener#stateChanged(org.jdiameter.api.app.AppSession, java.lang.Enum, java.lang.Enum)
   */
public void stateChanged(AppSession source, Enum oldState, Enum newState) {
    DiameterActivityHandle dah = getActivityHandle(source.getSessionId());
    Object activity = getActivity(dah);
    if (activity != null) {
        if (source instanceof ServerShSession) {
            try {
                // damn, no common, do something unexpected
                StateChangeListener<AppSession> scl = (StateChangeListener<AppSession>) activity;
                scl.stateChanged(source, oldState, newState);
            } catch (Exception e) {
                tracer.warning("Failed to deliver state, for: " + dah + " on stateChanged( " + source + ", " + oldState + ", " + newState + " )", e);
            }
        }
    } else {
        tracer.warning("No activity for: " + dah + " on stateChanged( " + source + ", " + oldState + ", " + newState + " )");
    }
}
Also used : AppSession(org.jdiameter.api.app.AppSession) StateChangeListener(org.jdiameter.api.app.StateChangeListener) DiameterActivityHandle(org.mobicents.slee.resource.diameter.base.DiameterActivityHandle) 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) ServerShSession(org.jdiameter.api.sh.ServerShSession)

Aggregations

InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)10 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)10 DiameterActivityHandle (org.mobicents.slee.resource.diameter.base.DiameterActivityHandle)10 AvpDataException (org.jdiameter.api.AvpDataException)9 OperationNotSupportedException (javax.naming.OperationNotSupportedException)8 DiameterActivityImpl (org.mobicents.slee.resource.diameter.base.DiameterActivityImpl)7 IOException (java.io.IOException)5 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)4 InternalException (org.jdiameter.api.InternalException)4 AppSession (org.jdiameter.api.app.AppSession)3 StateChangeListener (org.jdiameter.api.app.StateChangeListener)3 ServerShSession (org.jdiameter.api.sh.ServerShSession)3 InvalidTransactionException (javax.transaction.InvalidTransactionException)1 SystemException (javax.transaction.SystemException)1 AvpNotAllowedException (net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException)1