Search in sources :

Example 1 with S13ServerSessionImpl

use of org.jdiameter.server.impl.app.s13.S13ServerSessionImpl 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;
}
Also used : ServerS13Session(org.jdiameter.api.s13.ServerS13Session) AppSession(org.jdiameter.api.app.AppSession) ClientS13Session(org.jdiameter.api.s13.ClientS13Session) S13ClientSessionImpl(org.jdiameter.client.impl.app.s13.S13ClientSessionImpl) S13ServerSessionImpl(org.jdiameter.server.impl.app.s13.S13ServerSessionImpl)

Aggregations

AppSession (org.jdiameter.api.app.AppSession)1 ClientS13Session (org.jdiameter.api.s13.ClientS13Session)1 ServerS13Session (org.jdiameter.api.s13.ServerS13Session)1 S13ClientSessionImpl (org.jdiameter.client.impl.app.s13.S13ClientSessionImpl)1 S13ServerSessionImpl (org.jdiameter.server.impl.app.s13.S13ServerSessionImpl)1