Search in sources :

Example 1 with BackupPlanInfo

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());
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo)

Example 2 with BackupPlanInfo

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);
    }
}
Also used : DeleteBackupPlanAction(com.cubrid.cubridmanager.ui.cubrid.jobauto.action.DeleteBackupPlanAction) ISchemaNode(com.cubrid.common.ui.spi.model.ISchemaNode) TableItem(org.eclipse.swt.widgets.TableItem) ArrayList(java.util.ArrayList) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo) HashSet(java.util.HashSet)

Example 3 with BackupPlanInfo

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;
}
Also used : GetQueryPlanListTask(com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetQueryPlanListTask) QueryPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo) GetBackupPlanListTask(com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetBackupPlanListTask)

Example 4 with BackupPlanInfo

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);
}
Also used : BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo)

Example 5 with BackupPlanInfo

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());
}
Also used : DbUserInfo(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo) HashMap(java.util.HashMap) DbSpaceInfoList(com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfoList) ArrayList(java.util.ArrayList) DbSpaceInfo(com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfo) DbUserInfoList(com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfoList) QueryPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo) BackupPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo) SchemaInfo(com.cubrid.common.core.common.model.SchemaInfo)

Aggregations

BackupPlanInfo (com.cubrid.cubridmanager.core.cubrid.jobauto.model.BackupPlanInfo)10 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)5 DefaultSchemaNode (com.cubrid.common.ui.spi.model.DefaultSchemaNode)3 ArrayList (java.util.ArrayList)3 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)2 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)2 QueryPlanInfo (com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo)2 GetBackupPlanListTask (com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetBackupPlanListTask)2 TableItem (org.eclipse.swt.widgets.TableItem)2 SchemaInfo (com.cubrid.common.core.common.model.SchemaInfo)1 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)1 TreeNode (com.cubrid.cubridmanager.core.common.socket.TreeNode)1 DatabaseInfo (com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo)1 DbSpaceInfo (com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfo)1 DbSpaceInfoList (com.cubrid.cubridmanager.core.cubrid.dbspace.model.DbSpaceInfoList)1 GetQueryPlanListTask (com.cubrid.cubridmanager.core.cubrid.jobauto.task.GetQueryPlanListTask)1 DbUserInfo (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfo)1 DbUserInfoList (com.cubrid.cubridmanager.core.cubrid.user.model.DbUserInfoList)1 DeleteBackupPlanAction (com.cubrid.cubridmanager.ui.cubrid.jobauto.action.DeleteBackupPlanAction)1 EditBackupPlanAction (com.cubrid.cubridmanager.ui.cubrid.jobauto.action.EditBackupPlanAction)1