Search in sources :

Example 16 with DiameterActivityImpl

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

the class DiameterRxResourceAdaptor method queryLiveness.

/**
 * {@inheritDoc}
 */
@Override
public void queryLiveness(final ActivityHandle handle) {
    tracer.info("Diameter Rx 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) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 17 with DiameterActivityImpl

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

the class DiameterShServerResourceAdaptor method activityCreated.

/**
 * Method for performing tasks when activity is created, such as informing SLEE about it and storing into internal map.
 *
 * @param ac the activity that has been created
 */
private void activityCreated(DiameterActivity ac, boolean suspended) {
    try {
        // Inform SLEE that Activity Started
        DiameterActivityImpl activity = (DiameterActivityImpl) ac;
        if (suspended) {
            sleeEndpoint.startActivitySuspended(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        } else {
            sleeEndpoint.startActivity(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        }
        // Put it into our activities map
        activities.put(activity.getActivityHandle(), activity);
        if (tracer.isInfoEnabled()) {
            tracer.info("Activity started [" + activity.getActivityHandle() + "]");
        }
    } catch (Exception e) {
        tracer.severe("Error creating/starting activity.", e);
    }
}
Also used : DiameterActivityImpl(org.mobicents.slee.resource.diameter.base.DiameterActivityImpl) AvpDataException(org.jdiameter.api.AvpDataException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 18 with DiameterActivityImpl

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

the class DiameterShServerResourceAdaptor method queryLiveness.

// Mandatory callback methods ------------------------------------------
public void queryLiveness(ActivityHandle handle) {
    tracer.info("Diameter ShServer 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) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 19 with DiameterActivityImpl

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

the class DiameterShClientResourceAdaptor method activityCreated.

/**
 * Method for performing tasks when activity is created, such as informing SLEE about it and storing into internal map.
 *
 * @param ac the activity that has been created
 */
private void activityCreated(DiameterActivity ac, boolean suspended) {
    try {
        // Inform SLEE that Activity Started
        DiameterActivityImpl activity = (DiameterActivityImpl) ac;
        if (suspended) {
            sleeEndpoint.startActivitySuspended(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        } else {
            sleeEndpoint.startActivity(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        }
        // Put it into our activites map
        activities.put(activity.getActivityHandle(), activity);
        if (tracer.isInfoEnabled()) {
            tracer.info("Activity started [" + activity.getActivityHandle() + "]");
        }
    } catch (Exception e) {
        tracer.severe("Error creating/starting activity.", e);
    }
}
Also used : DiameterActivityImpl(org.mobicents.slee.resource.diameter.base.DiameterActivityImpl) OverloadException(org.jdiameter.api.OverloadException) AvpDataException(org.jdiameter.api.AvpDataException) InternalException(org.jdiameter.api.InternalException) RouteException(org.jdiameter.api.RouteException) AvpNotAllowedException(net.java.slee.resource.diameter.base.events.avp.AvpNotAllowedException) IllegalDiameterStateException(org.jdiameter.api.IllegalDiameterStateException) IOException(java.io.IOException) CreateActivityException(net.java.slee.resource.diameter.base.CreateActivityException) OperationNotSupportedException(javax.naming.OperationNotSupportedException) InvalidConfigurationException(javax.slee.resource.InvalidConfigurationException)

Example 20 with DiameterActivityImpl

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

the class DiameterGqResourceAdaptor method addActivity.

// Session Management --------------------------------------------------
/**
 * Method for performing tasks when activity is created, such as informing SLEE about it and storing into internal map.
 *
 * @param ac
 *          the activity that has been created
 */
private void addActivity(final DiameterActivity ac, final boolean suspend) {
    try {
        // Inform SLEE that Activity Started
        DiameterActivityImpl activity = (DiameterActivityImpl) ac;
        if (suspend) {
            sleeEndpoint.startActivitySuspended(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        } else {
            sleeEndpoint.startActivity(activity.getActivityHandle(), activity, MARSHALABLE_ACTIVITY_FLAGS);
        }
        // Set the listener
        activity.setSessionListener(this);
        // Put it into our activities map
        activities.put(activity.getActivityHandle(), activity);
        if (tracer.isInfoEnabled()) {
            tracer.info("Activity started [" + activity.getActivityHandle() + "]");
        }
    } catch (Exception e) {
        tracer.severe("Error creating activity", e);
        throw new RuntimeException("Error creating activity", e);
    }
}
Also used : 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)

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