/** * Connection identifier of this connection * @return identifier * @throws SQLException */ public String getConnectionId() { return this.serverConn.getLogonResult().getSessionID(); }
protected TimeZone getServerTimeZone() throws SQLException { return this.driverConnection.getServerConnection().getLogonResult().getTimeZone(); }
/** * Get's the name of the user who got this connection. * @return Sring object giving the user name * @throws SQLException if the connection is closed */ String getUserName() throws SQLException { checkConnection(); return this.serverConn.getLogonResult().getUserName(); }
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())); if (result.isAuthenticated()) { logonResult.addProperty(GSSCredential.class.getName(), result.getDelegationCredential());
inToken = (byte[])result.getProperty(ILogon.KRB5TOKEN);
@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$ }
String getVDBName() throws SQLException { //Check to see the connection is open checkConnection(); //get the virtual database name to which we are connected. return this.serverConn.getLogonResult().getVdbName(); }
@Deprecated /** * Will return 0 for Teiid 9.0+ servers * @return * @throws SQLException */ public int getVDBVersion() throws SQLException { checkConnection(); return this.serverConn.getLogonResult().getVdbVersion(); }
private ILogon connectSession() throws CommunicationException, ConnectionException { ILogon newLogon = this.serverInstance.getService(ILogon.class); if (this.logonResult != null) { try { newLogon.assertIdentity(logonResult.getSessionToken()); } catch (TeiidException e) { // session is no longer valid disconnect(); } } if (this.logonResult == null) { try { logon(newLogon); } catch (LogonException e) { // Propagate the original message as it contains the message we want // to give to the user throw new ConnectionException(e); } catch (TeiidComponentException e) { if (e.getCause() instanceof CommunicationException) { throw (CommunicationException)e.getCause(); } throw new CommunicationException(JDBCPlugin.Event.TEIID20018, e, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20018)); } } return newLogon; }
LogonResult result = new LogonResult(sessionInfo.getSessionToken(), sessionInfo.getVDBName(), clusterName); if (krb5ServiceTicket != null) { result.addProperty(ILogon.KRB5TOKEN, krb5ServiceTicket);
inToken = (byte[])result.getProperty(ILogon.KRB5TOKEN);
derived = true; workContext = context; this.result = new LogonResult(context.getSessionToken(), context.getVdbName(), null); passthrough = true;
public String getCatalog() throws SQLException { //Check to see the connection is open checkConnection(); //catalogs are not supported return this.serverConn.getLogonResult().getVdbName(); }
@Deprecated /** * Will return 0 for Teiid 9.0+ servers * @return * @throws SQLException */ public int getVDBVersion() throws SQLException { checkConnection(); return this.serverConn.getLogonResult().getVdbVersion(); }
private ILogon connectSession() throws CommunicationException, ConnectionException { ILogon newLogon = this.serverInstance.getService(ILogon.class); if (this.logonResult != null) { try { newLogon.assertIdentity(logonResult.getSessionToken()); } catch (TeiidException e) { // session is no longer valid disconnect(); } } if (this.logonResult == null) { try { logon(newLogon); } catch (LogonException e) { // Propagate the original message as it contains the message we want // to give to the user throw new ConnectionException(e); } catch (TeiidComponentException e) { if (e.getCause() instanceof CommunicationException) { throw (CommunicationException)e.getCause(); } throw new CommunicationException(JDBCPlugin.Event.TEIID20018, e, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20018)); } } return newLogon; }
/** * Connection identifier of this connection * @return identifier * @throws SQLException */ public String getConnectionId() { return this.serverConn.getLogonResult().getSessionID(); }
LogonResult result = new LogonResult(); result.addProperty(ILogon.AUTH_TYPE, authType); return result;
protected TimeZone getServerTimeZone() throws SQLException { return this.driverConnection.getServerConnection().getLogonResult().getTimeZone(); }
private void logon(ILogon newLogon) throws LogonException, TeiidComponentException, CommunicationException { SocketServerInstance instance = this.serverInstance; updateConnectionProperties(connProps, instance.getLocalAddress(), true); LogonResult newResult = null; // - if gss if (connProps.contains(TeiidURL.CONNECTION.JAAS_NAME)) { newResult = MakeGSS.authenticate(newLogon, connProps); } else { newResult = newLogon.logon(connProps); } AuthenticationType type = (AuthenticationType) newResult.getProperty(ILogon.AUTH_TYPE); if (type != null) { //server has issued an additional challenge if (type == AuthenticationType.GSS) { newResult = MakeGSS.authenticate(newLogon, connProps); } else { throw new LogonException(JDBCPlugin.Event.TEIID20034, JDBCPlugin.Util.gs(JDBCPlugin.Event.TEIID20034, type)); } } logoff(); this.logonResult = newResult; }
private CallableStatementImpl getCallableStatement() throws SQLException { ConnectionImpl conn = Mockito.mock(ConnectionImpl.class); ServerConnection sc = Mockito.mock(ServerConnection.class); Mockito.stub(sc.getLogonResult()).toReturn(new LogonResult()); Mockito.stub(conn.getServerConnection()).toReturn(sc); CallableStatementImpl mmcs = new CallableStatementImpl(conn, "{?=call x(?)}", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); return mmcs; }