use of org.jdiameter.client.impl.app.cxdx.CxDxClientSessionImpl in project jain-slee.diameter by RestComm.
the class CxDxSessionFactory 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[])
*/
public AppSession getNewSession(String sessionId, Class<? extends AppSession> appSessionClass, ApplicationId applicationId, Object[] args) {
AppSession appSession = null;
if (appSessionClass == ClientCxDxSession.class) {
CxDxClientSessionImpl clientSession = null;
clientSession = (CxDxClientSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = clientSession;
} else if (appSessionClass == ServerCxDxSession.class) {
org.jdiameter.server.impl.app.cxdx.CxDxServerSessionImpl serverSession = null;
serverSession = (CxDxServerSessionImpl) super.getNewSession(sessionId, appSessionClass, applicationId, args);
appSession = serverSession;
} else {
throw new IllegalArgumentException("Wrong session class!![" + appSessionClass + "]. Supported[" + ServerCxDxSession.class + "," + ClientCxDxSession.class + "]");
}
return appSession;
}
Aggregations