use of com.cubrid.common.ui.spi.progress.TaskExecutor in project cubrid-manager by CUBRID.
the class StartBrokerAction method run.
/**
* Override the run method in order to complete starting broker environment
*
*/
public void run() {
final Object[] obj = this.getSelectedObj();
DefaultCubridNode selection = (DefaultCubridNode) obj[0];
ServerInfo site = selection.getServer().getServerInfo();
StartBrokerTask task = new StartBrokerTask(site);
task.setBrokerName(selection.getLabel());
final String taskName = Messages.bind(Messages.startBrokerTaskName, selection.getLabel());
TaskExecutor taskExecutor = new CommonTaskExec(taskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection.getParent());
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.common.ui.spi.progress.TaskExecutor in project cubrid-manager by CUBRID.
the class StartBrokerEnvAction method run.
/**
* Override the run method in order to complete starting broker environment
*
*/
public void run() {
final Object[] obj = this.getSelectedObj();
CubridBrokerFolder selection = (CubridBrokerFolder) obj[0];
if (null == selection) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StartBrokerEnvTask task = new StartBrokerEnvTask(serverInfo);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.startBrokerEnvTaskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
selection.setRunning(true);
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection);
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.common.ui.spi.progress.TaskExecutor in project cubrid-manager by CUBRID.
the class StopBrokerEnvAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
final Object[] obj = this.getSelectedObj();
CubridBrokerFolder selection = (CubridBrokerFolder) obj[0];
if (null == selection) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopBrokerEnvTask task = new StopBrokerEnvTask(serverInfo);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopBrokerEnvTaskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
selection.setRunning(false);
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection);
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.common.ui.spi.progress.TaskExecutor in project cubrid-manager by CUBRID.
the class QueryLogDialog method loadData.
/**
* load the data
*
* @return boolean
*/
public boolean loadData() {
CommonQueryTask<QueryLogList> task = new CommonQueryTask<QueryLogList>(server.getServerInfo(), CommonSendMsg.getCommonSimpleSendMsg(), new QueryLogList());
TaskExecutor taskExecutor = new CommonTaskExec(Messages.loadQueryLogTaskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return false;
}
queryLogList = task.getResultModel();
return true;
}
use of com.cubrid.common.ui.spi.progress.TaskExecutor in project cubrid-manager by CUBRID.
the class EditBackupPlanDialog method okPressed.
/**
* When press ok button,call it
*/
public void okPressed() {
// Gets the data of dialog
int intLever = leverCombo.getSelectionIndex();
if (intLever == 1 && !CommonUITool.openConfirmBox(Messages.msgLevelOneWarning)) {
return;
}
if (intLever == 2 && !CommonUITool.openConfirmBox(Messages.msgLevelTwoWarning)) {
return;
}
String newBackupid = idText.getText().trim();
String newPath = pathText.getText().trim();
String newPeriodType = periodGroup.getTextOfTypeCombo();
String newPeriodDate = periodGroup.getDetailValue();
String newTime = periodGroup.getTime();
String newLever = Integer.toString(intLever);
OnOffType newArchivedel = deleteButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
OnOffType newUpdatestatus = updateButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
String bkNum = null;
OnOffType newStroreold = null;
if (isBkNumSupports) {
newStroreold = OnOffType.OFF;
bkNum = String.valueOf(numKeepBackups.getSelection());
if (StringUtil.isEmpty(bkNum)) {
bkNum = "0";
}
} else {
newStroreold = storeButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
bkNum = "0";
}
OnOffType newOnoff = onlineButton.getSelection() ? OnOffType.ON : OnOffType.OFF;
YesNoType newZip = useCompressButton.getSelection() ? YesNoType.Y : YesNoType.N;
YesNoType newCheck = checkingButton.getSelection() ? YesNoType.Y : YesNoType.N;
String newMt = Integer.valueOf(numThreadspinner.getSelection()).toString();
// Sets the object of backupPlanInfo
backupPlanInfo.setBackupid(newBackupid);
backupPlanInfo.setPath(newPath);
backupPlanInfo.setPeriod_type(newPeriodType);
backupPlanInfo.setPeriod_date(newPeriodDate);
backupPlanInfo.setTime(newTime);
backupPlanInfo.setLevel(newLever);
backupPlanInfo.setArchivedel(newArchivedel.getText());
backupPlanInfo.setUpdatestatus(newUpdatestatus.getText());
backupPlanInfo.setStoreold(newStroreold.getText());
backupPlanInfo.setOnoff(newOnoff.getText());
backupPlanInfo.setZip(newZip.getText());
backupPlanInfo.setCheck(newCheck.getText());
backupPlanInfo.setMt(newMt);
backupPlanInfo.setBknum(bkNum);
// Executes the task
ServerInfo serverInfo = database.getServer().getServerInfo();
BackupPlanTask backupPlanTask = new BackupPlanTask(opBackupInfo, serverInfo);
backupPlanTask.setDbname(database.getName());
backupPlanTask.setBackupid(newBackupid);
backupPlanTask.setPath(newPath);
backupPlanTask.setPeriodType(newPeriodType);
backupPlanTask.setPeriodDate(newPeriodDate);
backupPlanTask.setTime(newTime);
backupPlanTask.setLevel(newLever);
backupPlanTask.setArchivedel(newArchivedel);
backupPlanTask.setUpdatestatus(newUpdatestatus);
backupPlanTask.setStoreold(newStroreold);
backupPlanTask.setOnoff(newOnoff);
backupPlanTask.setZip(newZip);
backupPlanTask.setCheck(newCheck);
backupPlanTask.setMt(newMt);
backupPlanTask.setBknum(bkNum);
String taskName = Messages.bind(Messages.editBackupPlanTaskName, newBackupid);
TaskExecutor taskExecutor = new CommonTaskExec(taskName);
taskExecutor.addTask(backupPlanTask);
new ExecTaskWithProgress(taskExecutor).exec();
if (taskExecutor.isSuccess()) {
super.okPressed();
}
}
Aggregations