Search in sources :

Example 1 with CxDxServerSessionImpl

use of org.jdiameter.server.impl.app.cxdx.CxDxServerSessionImpl 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;
}
Also used : CxDxClientSessionImpl(org.jdiameter.client.impl.app.cxdx.CxDxClientSessionImpl) ServerCxDxSession(org.jdiameter.api.cxdx.ServerCxDxSession) AppSession(org.jdiameter.api.app.AppSession) ClientCxDxSession(org.jdiameter.api.cxdx.ClientCxDxSession) CxDxServerSessionImpl(org.jdiameter.server.impl.app.cxdx.CxDxServerSessionImpl)

Aggregations

AppSession (org.jdiameter.api.app.AppSession)1 ClientCxDxSession (org.jdiameter.api.cxdx.ClientCxDxSession)1 ServerCxDxSession (org.jdiameter.api.cxdx.ServerCxDxSession)1 CxDxClientSessionImpl (org.jdiameter.client.impl.app.cxdx.CxDxClientSessionImpl)1 CxDxServerSessionImpl (org.jdiameter.server.impl.app.cxdx.CxDxServerSessionImpl)1