use of org.pentaho.di.ui.repository.repositoryexplorer.model.UIDatabaseConnection in project pentaho-kettle by pentaho.
the class ConnectionsController method refreshConnectionList.
// package-local visibility for testing purposes
void refreshConnectionList() {
final List<UIDatabaseConnection> tmpList = new ArrayList<UIDatabaseConnection>();
Runnable r = new Runnable() {
@Override
public void run() {
try {
ObjectId[] dbIdList = repository.getDatabaseIDs(false);
for (ObjectId dbId : dbIdList) {
DatabaseMeta dbMeta = repository.loadDatabaseMeta(dbId, null);
RepositoryElementMetaInterface repoMeta = repository.getObjectInformation(dbId, RepositoryObjectType.DATABASE);
UIDatabaseConnection conn = null;
try {
conn = UIObjectRegistry.getInstance().constructUIDatabaseConnection(dbMeta, repository);
} catch (UIObjectCreationException uoe) {
conn = new UIDatabaseConnection(dbMeta, repository);
}
if (conn != null) {
conn.setRepositoryElementMetaInterface(repoMeta);
tmpList.add(conn);
}
}
} catch (KettleException e) {
if (mainController == null || !mainController.handleLostRepository(e)) {
// convert to runtime exception so it bubbles up through the UI
throw new RuntimeException(e);
}
}
}
};
doWithBusyIndicator(r);
dbConnectionList.setChildren(tmpList);
}
Aggregations