use of com.cubrid.common.ui.spi.persist.BrokerConfPersistUtil in project cubrid-manager by CUBRID.
the class UnifyHostConfigUtil method saveBrokerConf.
/**
* save cubrid broker conf
* @param monitor
* @param brokerConfMap
* @param editorInput
* @return failed server
*/
public List<String> saveBrokerConf(IProgressMonitor monitor, LinkedHashMap<String, BrokerConfig> brokerConfMap, CubridServer[] cubridServers) {
List<String> failedServer = new ArrayList<String>();
BrokerConfPersistUtil cubridBrokerConfUtil = new BrokerConfPersistUtil();
for (Entry<String, BrokerConfig> entry : brokerConfMap.entrySet()) {
BrokerConfig cubridBrokerConfig = entry.getValue();
String serverName = entry.getKey();
String contents = cubridBrokerConfUtil.readBrokerConfig(cubridBrokerConfig);
CubridServer cubridServer = getCubridServer(serverName, cubridServers);
if (cubridServer != null) {
monitor.subTask(Messages.bind(Messages.unifyHostConfigEditorSavingDataMsg2, "broker.conf", serverName));
String[] lines = contents.split(System.getProperty("line.separator"));
SetBrokerConfParameterTask task = new SetBrokerConfParameterTask(cubridServer.getServerInfo());
task.setConfContents(Arrays.asList(lines));
task.execute();
if (!task.isSuccess()) {
failedServer.add(cubridServer.getName());
}
task.finish();
monitor.worked(1);
}
}
return failedServer;
}
Aggregations