Search in sources :

Example 1 with S6aClientSessionImpl

use of org.jdiameter.client.impl.app.s6a.S6aClientSessionImpl 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;
}
Also used : ClientS6aSession(org.jdiameter.api.s6a.ClientS6aSession) AppSession(org.jdiameter.api.app.AppSession) ServerS6aSession(org.jdiameter.api.s6a.ServerS6aSession) S6aClientSessionImpl(org.jdiameter.client.impl.app.s6a.S6aClientSessionImpl) S6aServerSessionImpl(org.jdiameter.server.impl.app.s6a.S6aServerSessionImpl)

Aggregations

AppSession (org.jdiameter.api.app.AppSession)1 ClientS6aSession (org.jdiameter.api.s6a.ClientS6aSession)1 ServerS6aSession (org.jdiameter.api.s6a.ServerS6aSession)1 S6aClientSessionImpl (org.jdiameter.client.impl.app.s6a.S6aClientSessionImpl)1 S6aServerSessionImpl (org.jdiameter.server.impl.app.s6a.S6aServerSessionImpl)1