use of org.mobicents.slee.resource.diameter.base.DiameterActivityHandle 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 + " )");
}
}
use of org.mobicents.slee.resource.diameter.base.DiameterActivityHandle 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);
}
}
}
use of org.mobicents.slee.resource.diameter.base.DiameterActivityHandle 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 + " )");
}
}
use of org.mobicents.slee.resource.diameter.base.DiameterActivityHandle 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);
}
}
}
use of org.mobicents.slee.resource.diameter.base.DiameterActivityHandle 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);
}
}
}
Aggregations