use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetBackupPlanListTask in project cubrid-manager by CUBRID.
the class OpenJobAutomationInfoPartProgress method run.
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (getBackupPlanInfo) {
final GetBackupPlanListTask getBackupPlanInfoListTask = new GetBackupPlanListTask(database.getServer().getServerInfo());
getBackupPlanInfoListTask.setDbName(database.getLabel());
getBackupPlanInfoListTask.execute();
if (getBackupPlanInfoListTask.isSuccess()) {
backupPlanInfoList = getBackupPlanInfoListTask.getBackupPlanInfoList();
} else {
backupPlanInfoList = new ArrayList<BackupPlanInfo>();
}
}
if (getQueryPlanInfo) {
final GetQueryPlanListTask getQueryPlanListTask = new GetQueryPlanListTask(database.getServer().getServerInfo());
getQueryPlanListTask.setDbName(database.getLabel());
getQueryPlanListTask.execute();
if (getQueryPlanListTask.isSuccess()) {
queryPlanInfoList = getQueryPlanListTask.getQueryPlanInfoList();
} else {
queryPlanInfoList = new ArrayList<QueryPlanInfo>();
}
}
success = true;
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetBackupPlanListTask in project cubrid-manager by CUBRID.
the class CubridBackupPlanFolderLoader method load.
/**
*
* Load children object for parent
*
* @param parent the parent node
* @param monitor the IProgressMonitor object
*/
public void load(ICubridNode parent, final IProgressMonitor monitor) {
synchronized (this) {
if (isLoaded()) {
return;
}
CubridDatabase database = ((ISchemaNode) parent).getDatabase();
DatabaseInfo databaseInfo = database.getDatabaseInfo();
final GetBackupPlanListTask task = new GetBackupPlanListTask(parent.getServer().getServerInfo());
task.setDbName(database.getLabel());
monitorCancel(monitor, new ITask[] { task });
task.execute();
final String errorMsg = task.getErrorMsg();
if (!monitor.isCanceled() && errorMsg != null && errorMsg.trim().length() > 0) {
parent.removeAllChild();
openErrorBox(errorMsg);
setLoaded(true);
return;
}
if (monitor.isCanceled()) {
setLoaded(true);
return;
}
parent.removeAllChild();
List<BackupPlanInfo> backupPlanInfoList = task.getBackupPlanInfoList();
if (backupPlanInfoList != null && !backupPlanInfoList.isEmpty()) {
for (BackupPlanInfo backupPlanInfo : backupPlanInfoList) {
String id = parent.getId() + NODE_SEPARATOR + backupPlanInfo.getBackupid();
ICubridNode backupPlanInfoNode = new DefaultSchemaNode(id, backupPlanInfo.getBackupid(), "icons/navigator/auto_backup_item.png");
backupPlanInfoNode.setContainer(false);
backupPlanInfoNode.setType(CubridNodeType.BACKUP_PLAN);
backupPlanInfoNode.setModelObj(backupPlanInfo);
parent.addChild(backupPlanInfoNode);
}
}
databaseInfo.setBackupPlanInfoList(backupPlanInfoList);
Collections.sort(parent.getChildren());
setLoaded(true);
CubridNodeManager.getInstance().fireCubridNodeChanged(new CubridNodeChangedEvent((ICubridNode) parent, CubridNodeChangedEventType.CONTAINER_NODE_REFRESH));
}
}
Aggregations