Search in sources :

Example 1 with StateChangeListener

use of org.jdiameter.api.app.StateChangeListener 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)

Example 2 with StateChangeListener

use of org.jdiameter.api.app.StateChangeListener in project jain-slee.diameter by RestComm.

the class DiameterS13ResourceAdaptor method stateChanged.

/* (non-Javadoc)
   * @see org.mobicents.slee.resource.diameter.s13.handlers.S13SessionCreationListener#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)

Example 3 with StateChangeListener

use of org.jdiameter.api.app.StateChangeListener in project jain-slee.diameter by RestComm.

the class DiameterCxDxResourceAdaptor method stateChanged.

/* (non-Javadoc)
   * @see org.mobicents.slee.resource.diameter.cxdx.handlers.CxDxSessionCreationListener#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

OperationNotSupportedException (javax.naming.OperationNotSupportedException)3 InvalidConfigurationException (javax.slee.resource.InvalidConfigurationException)3 CreateActivityException (net.java.slee.resource.diameter.base.CreateActivityException)3 AvpDataException (org.jdiameter.api.AvpDataException)3 IllegalDiameterStateException (org.jdiameter.api.IllegalDiameterStateException)3 InternalException (org.jdiameter.api.InternalException)3 AppSession (org.jdiameter.api.app.AppSession)3 StateChangeListener (org.jdiameter.api.app.StateChangeListener)3 ServerShSession (org.jdiameter.api.sh.ServerShSession)3 DiameterActivityHandle (org.mobicents.slee.resource.diameter.base.DiameterActivityHandle)3