use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.
the class CubridWorkbenchContrItem method connectHost.
/**
* Connect host
*
* @param serverInfo ServerInfo
* @param showErrMsg boolean
* @return boolean
*/
public static boolean connectHost(ServerInfo serverInfo, boolean showErrMsg) {
String password = serverInfo == null ? null : serverInfo.getUserPassword();
if (password == null || password.trim().length() == 0) {
return false;
}
Map<String, String> jdbcVersionMap = CubridJdbcManager.getInstance().getLoadedJdbc();
if (jdbcVersionMap == null || jdbcVersionMap.get(serverInfo.getJdbcDriverVersion()) == null) {
return false;
}
TaskExecutor taskExcutor = new ConnectHostExecutor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), serverInfo, showErrMsg);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
boolean isConnected = taskExcutor.isSuccess();
if (isConnected) {
// if preference use dashboard, when connect successful,open host dashboard
if (GeneralPreference.isUseHostDashboard() && serverInfo.isConnected()) {
openHostDashboard(serverInfo);
}
// if (serverInfo.isCheckCertStatus()
// && CertStatus.DEFAULT.equals(serverInfo.getCertStatus())) {
// GenCertDialog dialog = new GenCertDialog(
// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), serverInfo);
// dialog.open();
// }
}
return isConnected;
}
use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.
the class ShardParameterPropertyPage method performOk.
/**
* Save the page content
*
* @return <code>true</code> if it saved successfully;<code>false</code>
* otherwise
*/
public boolean performOk() {
shardParameterPanel.save();
ShardsTaskFactory taskFactory = new ShardsTaskFactory(this.serverInfo, this.shards);
taskFactory.addUpdateFile(this.shard, oldShardName);
CommonTaskExec taskExec = new CommonTaskExec(Messages.msgOperating);
taskExec.setTask(taskFactory.generateTasks());
new ExecTaskWithProgress(taskExec).exec();
if (taskExec.isSuccess()) {
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.restartShardBrokerMsg);
return true;
} else {
CommonUITool.openErrorBox(Messages.msgOperationFailed);
return false;
}
}
use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.
the class ConfigParaHelp method performGetHAConf.
/**
* Perform the task of get ha.conf
*
* @param serverInfo the CubridServer
* @return the List<String>
*/
public static List<String> performGetHAConf(ServerInfo serverInfo) {
List<String> confContent = new ArrayList<String>();
CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getHaConfTaskRunning);
GetHAConfParameterTask getHAConfParameterTask = new GetHAConfParameterTask(serverInfo);
taskExcutor.addTask(getHAConfParameterTask);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
if (taskExcutor.isSuccess()) {
confContent = getHAConfParameterTask.getConfContents();
}
return confContent;
}
use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.
the class ConfigParaHelp method performGetCmConf.
/**
* Perform the task of get cm.conf
*
* @param serverInfo the CubridServer
* @return the List<String>
*/
public static List<String> performGetCmConf(ServerInfo serverInfo) {
List<String> confContent = new ArrayList<String>();
CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getCmConfTaskRunning);
GetCMConfParameterTask getCMConfParameterTask = new GetCMConfParameterTask(serverInfo);
taskExcutor.addTask(getCMConfParameterTask);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
if (taskExcutor.isSuccess()) {
confContent = getCMConfParameterTask.getConfContents();
}
return confContent;
}
use of com.cubrid.common.ui.spi.progress.ExecTaskWithProgress in project cubrid-manager by CUBRID.
the class ConfigParaHelp method performGetCubridConf.
/**
* Perform the task of get cubrid.conf
*
* @param serverInfo the CubridServer
* @return the List<String>
*/
public static List<String> performGetCubridConf(ServerInfo serverInfo) {
List<String> confContent = new ArrayList<String>();
CommonTaskExec taskExcutor = new CommonTaskExec(com.cubrid.cubridmanager.ui.host.Messages.getCubridConfTaskRunning);
GetCubridConfParameterTask getCubridConfParameterTask = new GetCubridConfParameterTask(serverInfo);
taskExcutor.addTask(getCubridConfParameterTask);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
if (taskExcutor.isSuccess()) {
confContent = getCubridConfParameterTask.getConfContents();
}
return confContent;
}
Aggregations