use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.DelBackupPlanTask in project cubrid-manager by CUBRID.
the class SetupEnvTestCase method deleteBackupPlan.
public boolean deleteBackupPlan(String backupPlanId) {
DelBackupPlanTask task = new DelBackupPlanTask(serverInfo);
task.setDbname(testDbName);
task.setBackupid(backupPlanId);
task.execute();
return task.isSuccess();
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.DelBackupPlanTask in project cubrid-manager by CUBRID.
the class DeleteBackupPlanAction method run.
/**
* Deletes the selected backup plan
*
*/
public void run(ISchemaNode[] nodeArray) {
List<String> nodeNames = new ArrayList<String>();
for (Object obj : nodeArray) {
ICubridNode selection = (ICubridNode) obj;
nodeNames.add(selection.getLabel());
}
if (!CommonUITool.openConfirmBox(Messages.bind(Messages.delBackupPlanConfirmContent, nodeNames))) {
return;
}
String taskName = Messages.bind(Messages.delBackupPlanTaskName, nodeNames);
CommonTaskExec taskExecutor = new CommonTaskExec(taskName);
for (Object obj : nodeArray) {
CubridDatabase database = null;
if (obj instanceof DefaultSchemaNode) {
database = ((DefaultSchemaNode) obj).getDatabase();
}
if (database == null) {
CommonUITool.openErrorBox(Messages.msgSelectDB);
return;
}
ServerInfo serverInfo = database.getServer().getServerInfo();
DelBackupPlanTask delBackupPlanTask = new DelBackupPlanTask(serverInfo);
delBackupPlanTask.setDbname(database.getName());
String backupid = ((DefaultSchemaNode) obj).getLabel();
delBackupPlanTask.setBackupid(backupid);
taskExecutor.addTask(delBackupPlanTask);
}
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
for (Object obj : nodeArray) {
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
DefaultSchemaNode delNode = ((DefaultSchemaNode) obj);
ICubridNode parentNode = delNode.getParent();
parentNode.removeChild(delNode);
treeViewer.remove(delNode);
}
}
Aggregations