use of com.cubrid.cubridmanager.core.cubrid.dbspace.task.AddVolumeDbTask in project cubrid-manager by CUBRID.
the class AddVolumeDialog method performTask.
/**
* perform the task
*
* @param addVolumeDbInfo AddVolumeDbInfo
*/
private void performTask(AddVolumeDbInfo addVolumeDbInfo) {
// Checks the path
String sPathText = pathText.getText().trim();
ServerInfo serverInfo = selection.getServer().getServerInfo();
CheckDirTask checkDirTask = new CheckDirTask(serverInfo);
checkDirTask.setDirectory(new String[] { sPathText });
CubridDatabase database = selection.getDatabase();
AddVolumeDbTask addVolumeTask = new AddVolumeDbTask(database.getServer().getServerInfo());
addVolumeTask.setDbname(database.getName());
addVolumeTask.setVolname(addVolumeDbInfo.getVolname());
addVolumeTask.setPurpose(addVolumeDbInfo.getPurpose());
addVolumeTask.setPath(addVolumeDbInfo.getPath());
addVolumeTask.setNumberofpages(addVolumeDbInfo.getNumberofpage());
addVolumeTask.setSizeNeedMb(addVolumeDbInfo.getSize_need_mb());
// Gets the database space info
DbSpaceInfoList dbSpaceInfo = new DbSpaceInfoList();
final CommonQueryTask<DbSpaceInfoList> dbSpaceInfoTask = new CommonQueryTask<DbSpaceInfoList>(database.getServer().getServerInfo(), CommonSendMsg.getCommonDatabaseSendMsg(), dbSpaceInfo);
dbSpaceInfoTask.setDbName(database.getLabel());
JobFamily jobFamily = new JobFamily();
String serverName = selection.getServer().getName();
String dbName = selection.getDatabase().getName();
jobFamily.setServerName(serverName);
jobFamily.setDbName(dbName);
jobName = Messages.msgAddVolRearJobName + " - " + dbName + "@" + serverName;
TaskJobExecutor taskExec = new CommonTaskJobExec(this);
taskExec.addTask(checkDirTask);
taskExec.addTask(addVolumeTask);
taskExec.addTask(dbSpaceInfoTask);
taskExec.schedule(dbName, jobFamily, true, Job.SHORT);
}
Aggregations