/** * Get the sessionID. * @return * @since 4.3 */ public String getSessionID() { return this.sessionToken.getSessionID(); }
/** * Returns a string representing the current state of the object. */ public String toString() { return "SessionToken[" + getUsername() + "," + this.sessionID + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
/** * Create an unauthenticated session * @param userName * @param app * @param vdb * @return */ public static SessionMetadata createTemporarySession(String userName, String app, VDBMetaData vdb) { long creationTime = System.currentTimeMillis(); SessionMetadata newSession = new SessionMetadata(); newSession.setSessionToken(new SessionToken(userName)); newSession.setSessionId(newSession.getSessionToken().getSessionID()); newSession.setUserName(userName); newSession.setCreatedTime(creationTime); newSession.setApplicationName(app); newSession.setVDBName(vdb.getName()); newSession.setVDBVersion(vdb.getVersion()); newSession.setVdb(vdb); newSession.setEmbedded(true); return newSession; }
@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); }
@Override public LogonResult logon( Properties connectionProperties) throws LogonException, TeiidComponentException { return new LogonResult(new SessionToken(1, connectionProperties.getProperty(TeiidURL.CONNECTION.USER_NAME, "fooUser")), "foo", "fake"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
/** * Create an unauthenticated session * @param userName * @param app * @param vdb * @return */ public static SessionMetadata createTemporarySession(String userName, String app, VDBMetaData vdb) { long creationTime = System.currentTimeMillis(); SessionMetadata newSession = new SessionMetadata(); newSession.setSessionToken(new SessionToken(userName)); newSession.setSessionId(newSession.getSessionToken().getSessionID()); newSession.setUserName(userName); newSession.setCreatedTime(creationTime); newSession.setApplicationName(app); newSession.setVDBName(vdb.getName()); newSession.setVDBVersion(vdb.getVersion()); newSession.setVdb(vdb); newSession.setEmbedded(true); return newSession; }
LogonResult logonResult = new LogonResult(new SessionToken(0, "temp"), "internal", "internal"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ logonResult.addProperty(ILogon.KRB5TOKEN, result.getServiceToken()); logonResult.addProperty(ILogon.KRB5_ESTABLISHED, new Boolean(result.isAuthenticated()));
/** * Create an unauthenticated session * @param userName * @param app * @param vdb * @return */ public static SessionMetadata createTemporarySession(String userName, String app, VDBMetaData vdb) { long creationTime = System.currentTimeMillis(); SessionMetadata newSession = new SessionMetadata(); newSession.setSessionToken(new SessionToken(userName)); newSession.setSessionId(newSession.getSessionToken().getSessionID()); newSession.setUserName(userName); newSession.setCreatedTime(creationTime); newSession.setApplicationName(app); newSession.setVDBName(vdb.getName()); newSession.setVDBVersion(vdb.getVersion()); newSession.setVdb(vdb); newSession.setEmbedded(true); return newSession; }
stub(mock.getLogonResult()).toReturn(new LogonResult(new SessionToken(1, "admin"), STD_DATABASE_NAME, "fake")); //$NON-NLS-1$ return new ConnectionImpl(mock, props, url);
/** * Get the sessionID. * @return * @since 4.3 */ public String getSessionID() { return this.sessionToken.getSessionID(); }
/** * Returns a string representing the current state of the object. */ public String toString() { return "SessionToken[" + getUsername() + "," + this.sessionID + "]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ }
newSession.setSessionToken(new SessionToken(userName)); newSession.setSessionId(newSession.getSessionToken().getSessionID()); newSession.setUserName(userName); newSession.setCreatedTime(creationTime);
public String getUserName() { return this.sessionToken.getUsername(); }
public String getUserName() { return this.sessionToken.getUsername(); }