use of net.sourceforge.sqlexplorer.connections.SessionEstablishedListener in project tdq-studio-se by Talend.
the class OpenPasswordConnectDialogAction method run.
public void run() {
SessionEstablishedListener listener = null;
if (!user.hasAuthenticated())
listener = new SessionEstablishedAdapter() {
@Override
public void sessionEstablished(Session session) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
DatabaseStructureView dsView = SQLExplorerPlugin.getDefault().getDatabaseStructureView();
if (dsView != null)
try {
dsView.addUser(user);
} catch (SQLCannotConnectException e) {
MessageDialog.openError(Display.getDefault().getActiveShell(), "Cannot connect", e.getMessage());
}
}
});
}
};
ConnectionJob.createSession(alias, user, listener, alwaysPrompt);
}
use of net.sourceforge.sqlexplorer.connections.SessionEstablishedListener in project tdq-studio-se by Talend.
the class User method sessionEstablished.
/**
* Callback when a session has been established; notifies the next listener in the queue and then starts to
* establish a new session
*/
@Override
public synchronized void sessionEstablished(Session session) {
SessionEstablishedListener listener = newSessionsQueue.removeFirst();
listener.sessionEstablished(session);
if (!newSessionsQueue.isEmpty()) {
ConnectionJob.createSession(alias, this, this, false);
}
}
Aggregations