Search in sources :

Example 11 with InvalidSessionException

use of org.teiid.client.security.InvalidSessionException in project teiid by teiid.

the class LogonImpl method assertIdentity.

@Override
public void assertIdentity(SessionToken checkSession) throws InvalidSessionException, TeiidComponentException {
    if (checkSession == null) {
        // disassociate
        this.updateDQPContext(new SessionMetadata());
        return;
    }
    SessionMetadata sessionInfo = null;
    try {
        sessionInfo = this.service.validateSession(checkSession.getSessionID());
    } catch (SessionServiceException e) {
        throw new TeiidComponentException(RuntimePlugin.Event.TEIID40062, e);
    }
    if (sessionInfo == null) {
        throw new InvalidSessionException(RuntimePlugin.Event.TEIID40063);
    }
    SessionToken st = sessionInfo.getSessionToken();
    if (!st.equals(checkSession)) {
        throw new InvalidSessionException(RuntimePlugin.Event.TEIID40064);
    }
    this.updateDQPContext(sessionInfo);
}
Also used : InvalidSessionException(org.teiid.client.security.InvalidSessionException) SessionToken(org.teiid.client.security.SessionToken) SessionMetadata(org.teiid.adminapi.impl.SessionMetadata) TeiidComponentException(org.teiid.core.TeiidComponentException) SessionServiceException(org.teiid.dqp.service.SessionServiceException)

Aggregations

InvalidSessionException (org.teiid.client.security.InvalidSessionException)11 SessionMetadata (org.teiid.adminapi.impl.SessionMetadata)5 LogonException (org.teiid.client.security.LogonException)4 TeiidComponentException (org.teiid.core.TeiidComponentException)4 Properties (java.util.Properties)3 Test (org.junit.Test)3 SessionToken (org.teiid.client.security.SessionToken)3 IOException (java.io.IOException)2 Method (java.lang.reflect.Method)2 UnknownHostException (java.net.UnknownHostException)2 Connection (java.sql.Connection)2 Subject (javax.security.auth.Subject)2 ILogon (org.teiid.client.security.ILogon)2 LogonResult (org.teiid.client.security.LogonResult)2 ResultsFuture (org.teiid.client.util.ResultsFuture)2 SessionServiceException (org.teiid.dqp.service.SessionServiceException)2 CommunicationException (org.teiid.net.CommunicationException)2 ConnectionException (org.teiid.net.ConnectionException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 InetSocketAddress (java.net.InetSocketAddress)1