use of com.cubrid.cubridmanager.core.common.task.SetCMConfParameterTask in project cubrid-manager by CUBRID.
the class UnifyHostConfigUtil method saveCubridCMConf.
/**
* save cubrid broker conf
* @param monitor
* @param brokerConfMap
* @param editorInput
* @return failed server
*/
public List<String> saveCubridCMConf(IProgressMonitor monitor, LinkedHashMap<String, CubridCMConfConfig> cubridCMConfMap, CubridServer[] cubridServers) {
List<String> failedServer = new ArrayList<String>();
for (Entry<String, CubridCMConfConfig> entry : cubridCMConfMap.entrySet()) {
CubridCMConfConfig cubridCMConfConfig = entry.getValue();
String serverName = entry.getKey();
String contents = parseCubridCMConfConfigToDocumnetString(cubridCMConfConfig);
CubridServer cubridServer = getCubridServer(serverName, cubridServers);
if (cubridServer != null) {
monitor.subTask(Messages.bind(Messages.unifyHostConfigEditorSavingDataMsg2, "cm.conf", serverName));
String[] lines = contents.split(System.getProperty("line.separator"));
SetCMConfParameterTask task = new SetCMConfParameterTask(cubridServer.getServerInfo());
task.setConfContents(Arrays.asList(lines));
task.execute();
if (!task.isSuccess()) {
failedServer.add(cubridServer.getName());
}
task.finish();
monitor.worked(1);
}
}
return failedServer;
}
use of com.cubrid.cubridmanager.core.common.task.SetCMConfParameterTask in project cubrid-manager by CUBRID.
the class SetBrokerConfParameterTest method testSetContent.
public void testSetContent() throws Exception {
SetCMConfParameterTask task = new SetCMConfParameterTask(serverInfo);
List<String> list = new ArrayList<String>();
list.add("abc");
list.add("def");
task.setConfContents(list);
}
use of com.cubrid.cubridmanager.core.common.task.SetCMConfParameterTask in project cubrid-manager by CUBRID.
the class ManagerServerPropertyPage method perform.
/**
*
* Perform task and set parameter to cm.conf
*
* @param confParaMap the conf parameters map
*/
private void perform(Map<String, String> confParaMap) {
CommonTaskExec taskExcutor = new CommonTaskExec(Messages.setCMParameterTaskName);
SetCMConfParameterTask task = new SetCMConfParameterTask(node.getServer().getServerInfo());
task.setConfParameters(confParaMap);
taskExcutor.addTask(task);
new ExecTaskWithProgress(taskExcutor).exec(true, true);
if (taskExcutor.isSuccess()) {
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.msgChangeCMParaSuccess);
}
}
use of com.cubrid.cubridmanager.core.common.task.SetCMConfParameterTask in project cubrid-manager by CUBRID.
the class ConfigParaHelp method performImportCmConf.
/**
* Perform the import task for cm.conf
*
* @param serverInfo the CubridServer
* @param confParamList the List<String>
*/
public static void performImportCmConf(ServerInfo serverInfo, List<String> confParamList) {
CommonTaskExec taskExcutor = new CommonTaskExec(Messages.setCMParameterTaskName);
SetCMConfParameterTask task = new SetCMConfParameterTask(serverInfo);
task.setConfContents(confParamList);
taskExcutor.addTask(task);
new ExecTaskWithProgress(taskExcutor).busyCursorWhile();
if (taskExcutor.isSuccess()) {
CommonUITool.openInformationBox(Messages.titleSuccess, Messages.msgChangeCMParaSuccess);
}
}
Aggregations