use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo in project cubrid-manager by CUBRID.
the class EditBackupPlanDialog method initPara.
/**
* Initials the backupPlanInfo,database and childrenLabel
*
* @param selection the selection to set
*/
public void initPara(DefaultSchemaNode selection) {
childrenLabel = new ArrayList<String>();
ICubridNode[] childrenNode = null;
database = selection.getDatabase();
if (operation == AddEditType.EDIT) {
backupPlanInfo = (BackupPlanInfo) selection.getAdapter(BackupPlanInfo.class);
childrenNode = selection.getParent().getChildren(new NullProgressMonitor());
} else {
backupPlanInfo = new BackupPlanInfo();
String dbPath = database.getDatabaseInfo().getDbDir();
dbPath = FileUtil.changeSeparatorByOS(dbPath, database.getServer().getServerInfo().getServerOsInfo());
defaultPath = dbPath + selection.getServer().getServerInfo().getPathSeparator() + "backup";
childrenNode = selection.getChildren(new NullProgressMonitor());
}
for (ICubridNode childNode : childrenNode) {
childrenLabel.add(childNode.getLabel());
}
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method deleteBackupPlan.
public void deleteBackupPlan() {
TableItem[] items = backupPlanInfoTable.getTable().getSelection();
if (items.length > 0) {
List<ISchemaNode> selectNodeList = new ArrayList<ISchemaNode>();
for (TableItem item : items) {
BackupPlanInfo backupPlanInfo = (BackupPlanInfo) item.getData();
Set<String> typeSet = new HashSet<String>();
typeSet.add(CubridNodeType.BACKUP_PLAN);
ICubridNode backupPlanNode = CommonUITool.findNode(database, typeSet, backupPlanInfo.getBackupid());
selectNodeList.add((ISchemaNode) backupPlanNode);
}
if (selectNodeList.size() > 0) {
DeleteBackupPlanAction action = (DeleteBackupPlanAction) ActionManager.getInstance().getAction(DeleteBackupPlanAction.ID);
ISchemaNode[] nodeArr = new ISchemaNode[selectNodeList.size()];
action.run(selectNodeList.toArray(nodeArr));
refreshBackupPlan();
}
} else {
CommonUITool.openWarningBox(Messages.errJobAutoNoSelection);
}
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo 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.model.BackupPlanInfo in project cubrid-manager by CUBRID.
the class DatabaseInfoTest method testAddBackupPlanInfo.
/**
* Test method for
* {@link com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo#addBackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo)}
* .
*/
public void testAddBackupPlanInfo() {
bean.addBackupPlanInfo(new BackupPlanInfo());
bean.setBackupPlanInfoList(null);
bean.addBackupPlanInfo(new BackupPlanInfo());
bean.addBackupPlanInfo(new BackupPlanInfo());
BackupPlanInfo a = new BackupPlanInfo();
a.setDbname("dbname");
bean.addBackupPlanInfo(a);
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo in project cubrid-manager by CUBRID.
the class DatabaseModelTest method testModelDatabaseInfo.
@SuppressWarnings({ "unchecked", "rawtypes" })
public void testModelDatabaseInfo() {
DatabaseInfo bean = new DatabaseInfo(testDbName, serverInfo);
bean.setDbName("dbName");
assertEquals(bean.getDbName(), "dbName");
bean.setLogined(true);
assertTrue(bean.isLogined());
bean.setDbDir("dbDir");
assertEquals(bean.getDbDir(), "dbDir");
bean.setRunningType(DbRunningType.CS);
assertEquals(bean.getRunningType(), DbRunningType.CS);
DbUserInfoList dbUserInfoList = new DbUserInfoList();
bean.setDbUserInfoList(dbUserInfoList);
assertTrue(bean.getDbUserInfoList() != null);
DbUserInfo dbUserInfo = new DbUserInfo();
bean.addDbUserInfo(dbUserInfo);
bean.removeDbUserInfo(dbUserInfo);
bean.setAuthLoginedDbUserInfo(dbUserInfo);
assertEquals(bean.getAuthLoginedDbUserInfo(), dbUserInfo);
bean.setBrokerPort("brokerPort");
assertEquals(bean.getBrokerPort(), "brokerPort");
bean.setTriggerList(new ArrayList());
assertEquals(bean.getTriggerList() != null, true);
bean.setUserTableInfoList(new ArrayList());
assertEquals(bean.getUserTableInfoList() != null, true);
bean.setUserViewInfoList(new ArrayList());
assertEquals(bean.getUserViewInfoList() != null, true);
bean.setSysTableInfoList(new ArrayList());
assertEquals(bean.getSysTableInfoList() != null, true);
bean.setSysViewInfoList(new ArrayList());
assertEquals(bean.getSysViewInfoList() != null, true);
bean.setPartitionedTableMap(new HashMap());
assertEquals(bean.getPartitionedTableMap() != null, true);
bean.setBackupPlanInfoList(new ArrayList());
assertEquals(bean.getBackupPlanInfoList() != null, true);
bean.setQueryPlanInfoList(new ArrayList());
assertEquals(bean.getQueryPlanInfoList() != null, true);
bean.setDbSpaceInfoList(new DbSpaceInfoList());
assertEquals(bean.getDbSpaceInfoList() != null, true);
bean.setDbUserInfoList(new DbUserInfoList());
assertEquals(bean.getDbUserInfoList() != null, true);
bean.setSpProcedureInfoList(new ArrayList());
assertEquals(bean.getSpProcedureInfoList() != null, true);
bean.setSpFunctionInfoList(new ArrayList());
assertEquals(bean.getSpFunctionInfoList() != null, true);
bean.setSerialInfoList(new ArrayList());
assertEquals(bean.getSerialInfoList() != null, true);
bean.setServerInfo(serverInfo);
assertEquals(bean.getServerInfo() != null, true);
bean.clear();
bean.setLogined(true);
assertEquals(bean.isLogined(), true);
bean.addDbUserInfo(new DbUserInfo());
bean.removeDbUserInfo(new DbUserInfo());
bean.getClassInfoList();
bean.addPartitionedTableList("dbname", null);
bean.addBackupPlanInfo(new BackupPlanInfo());
bean.removeBackupPlanInfo(new BackupPlanInfo());
bean.removeAllBackupPlanInfo();
bean.addQueryPlanInfo(new QueryPlanInfo());
bean.removeQueryPlanInfo(new QueryPlanInfo());
bean.removeAllQueryPlanInfo();
bean.addSpaceInfo(new DbSpaceInfo());
bean.removeSpaceInfo(new DbSpaceInfo());
bean.getSpInfoList();
bean.getSchemaInfo("tableName");
bean.putSchemaInfo(new SchemaInfo());
bean.clearSchemas();
bean.getErrorMessage();
bean.setDbUserInfoList(null);
assertEquals(bean.getDbUserInfoList(), null);
bean.addDbUserInfo(new DbUserInfo());
bean.removeDbUserInfo(new DbUserInfo());
}
Aggregations