use of com.cubrid.common.ui.spi.progress.TaskJobExecutor in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method loadServerEnvInfo.
/**
* Load Server Environment Info
*/
private void loadServerEnvInfo(final ServerInfo serverInfo, final String key) {
if (serverInfo.isConnected() == false) {
return;
}
final GetEnvInfoTask getEnvInfoTask = new GetEnvInfoTask(serverInfo);
TaskJobExecutor taskJobExec = new CommonTaskJobExec(new ITaskExecutorInterceptor() {
public void completeAll() {
Object input = serviceTreeViewer.getInput();
ServiceDashboardInfo sDashInfo = getSelectedDashInfo(input, serverInfo.getServerName(), key);
EnvInfo envInfo = getEnvInfoTask.loadEnvInfo();
setEnvData(sDashInfo, envInfo);
serviceTreeViewer.refresh(input);
}
public IStatus postTaskFinished(ITask task) {
return Status.OK_STATUS;
}
});
taskJobExec.addTask(getEnvInfoTask);
executeTask(taskJobExec, serverInfo.getServerName(), Messages.taskGetServerEnvInfo);
}
use of com.cubrid.common.ui.spi.progress.TaskJobExecutor in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method loadServerDbInfo.
/**
* Load Server Database Info
*/
private void loadServerDbInfo(final ServerInfo serverInfo, final String key) {
if (serverInfo.isConnected() == false) {
return;
}
final GetDatabaseListTask getDatabaseListTask = new GetDatabaseListTask(serverInfo);
TaskJobExecutor taskJobExec = new CommonTaskJobExec(new ITaskExecutorInterceptor() {
public void completeAll() {
Object input = serviceTreeViewer.getInput();
ServiceDashboardInfo sDashInfo = getSelectedDashInfo(input, serverInfo.getServerName(), key);
List<DatabaseInfo> databaseInfoList = getDatabaseListTask.loadDatabaseInfo();
setDbData(sDashInfo, databaseInfoList);
serviceTreeViewer.refresh(input);
}
public IStatus postTaskFinished(ITask task) {
return Status.OK_STATUS;
}
});
taskJobExec.addTask(getDatabaseListTask);
executeTask(taskJobExec, serverInfo.getServerName(), Messages.taskGetServerDbInfo);
}
use of com.cubrid.common.ui.spi.progress.TaskJobExecutor in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method loadServerVolumeData.
/**
* Load Server Volume Info
*/
private void loadServerVolumeData(final ServerInfo serverInfo, final String key) {
List<String> dbList = serverInfo.getAllDatabaseList();
if (dbList == null || dbList.size() == 0) {
return;
}
final List<CommonQueryTask<DbSpaceInfoList>> getVolumnTaskList = new ArrayList<CommonQueryTask<DbSpaceInfoList>>();
for (String dbname : dbList) {
CommonQueryTask<DbSpaceInfoList> task = new CommonQueryTask<DbSpaceInfoList>(serverInfo, CommonSendMsg.getCommonDatabaseSendMsg(), new DbSpaceInfoList());
task.setDbName(dbname);
getVolumnTaskList.add(task);
}
TaskJobExecutor taskJobExec = new CommonTaskJobExec(new ITaskExecutorInterceptor() {
public void completeAll() {
Object input = serviceTreeViewer.getInput();
ServiceDashboardInfo sDashInfo = getSelectedDashInfo(input, serverInfo.getServerName(), key);
setVolumeData(sDashInfo, getVolumnTaskList);
serviceTreeViewer.refresh(input);
}
public IStatus postTaskFinished(ITask task) {
return Status.OK_STATUS;
}
});
for (CommonQueryTask<DbSpaceInfoList> task : getVolumnTaskList) {
taskJobExec.addTask(task);
}
executeTask(taskJobExec, serverInfo.getServerName(), Messages.taskGetServerVolumeInfo);
}
use of com.cubrid.common.ui.spi.progress.TaskJobExecutor in project cubrid-manager by CUBRID.
the class ServiceDashboardEditor method loadServerHostInfo.
/**
* Load Server Host Info
*/
private void loadServerHostInfo(final ServerInfo serverInfo, final String key) {
final CommonQueryTask<HostStatData> task = new CommonQueryTask<HostStatData>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), new HostStatData());
TaskJobExecutor taskJobExec = new CommonTaskJobExec(new ITaskExecutorInterceptor() {
public void completeAll() {
Object input = serviceTreeViewer.getInput();
ServiceDashboardInfo sDashInfo = getSelectedDashInfo(input, serverInfo.getServerName(), key);
HostStatData hostInfo = task.getResultModel();
setHostData(sDashInfo, hostInfo);
serviceTreeViewer.refresh(input);
}
public IStatus postTaskFinished(ITask task) {
return Status.OK_STATUS;
}
});
taskJobExec.addTask(task);
executeTask(taskJobExec, serverInfo.getServerName(), Messages.taskGetServerHostInfo);
}
use of com.cubrid.common.ui.spi.progress.TaskJobExecutor in project cubrid-manager by CUBRID.
the class PstmtOneDataDialog method updateData.
/**
*
* Update the data
*
* @param parameterList List<PstmtParameter>
*/
private void updateData(List<PstmtParameter> parameterList) {
beginTimestamp = System.currentTimeMillis();
String jobName = Messages.executeSqlJobName;
JobFamily jobFamily = new JobFamily();
String serverName = database.getServer().getServerInfo().getServerName();
String dbName = database.getName();
jobFamily.setServerName(serverName);
jobFamily.setDbName(dbName);
TaskJobExecutor taskExec = new CommonTaskJobExec(this);
PstmtDataTask task = new PstmtDataTask(sqlTxt.getText(), database, parameterList, null);
taskExec.addTask(task);
taskExec.schedule(jobName, jobFamily, false, Job.SHORT);
}
Aggregations