use of org.jdiameter.api.app.AppSession 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 + " )");
}
}
use of org.jdiameter.api.app.AppSession in project jain-slee.diameter by RestComm.
the class S6aSessionFactory method getNewSession.
/* (non-Javadoc)
* @see org.jdiameter.common.api.app.IAppSessionFactory#getNewSession(java.lang.String, java.lang.Class, org.jdiameter.api.ApplicationId, java.lang.Object[])
*/
@Override
public AppSession getNewSession(String sessionId, Class<? extends AppSession> appSessionClass, ApplicationId applicationId, Object[] args) {
AppSession appSession = null;
if (appSessionClass == ServerS6aSession.class) {
S6aServerSessionImpl serverSession = null;
serverSession = (S6aServerSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = serverSession;
} else if (appSessionClass == ClientS6aSession.class) {
S6aClientSessionImpl clientSession = null;
clientSession = (S6aClientSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = clientSession;
} else {
throw new IllegalArgumentException("Wrong session class: [" + appSessionClass + "]. Supported[" + ServerS6aSession.class + "," + ClientS6aSession.class + "]");
}
return appSession;
}
use of org.jdiameter.api.app.AppSession 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.jdiameter.api.app.AppSession in project jain-slee.diameter by RestComm.
the class S13SessionFactory method getNewSession.
/* (non-Javadoc)
* @see org.jdiameter.common.api.app.IAppSessionFactory#getNewSession(java.lang.String, java.lang.Class, org.jdiameter.api.ApplicationId, java.lang.Object[])
*/
@Override
public AppSession getNewSession(String sessionId, Class<? extends AppSession> appSessionClass, ApplicationId applicationId, Object[] args) {
AppSession appSession = null;
if (appSessionClass == ServerS13Session.class) {
S13ServerSessionImpl serverSession = null;
serverSession = (S13ServerSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = serverSession;
} else if (appSessionClass == ClientS13Session.class) {
S13ClientSessionImpl clientSession = null;
clientSession = (S13ClientSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = clientSession;
} else {
throw new IllegalArgumentException("Wrong session class: [" + appSessionClass + "]. Supported[" + ServerS13Session.class + "," + ClientS13Session.class + "]");
}
return appSession;
}
use of org.jdiameter.api.app.AppSession 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 + " )");
}
}
Aggregations