use of org.codice.ddf.admin.configurator.OperationReport in project admin-console-beta by connexta.
the class ServiceCommons method updateService.
public static ReportImpl updateService(PidField servicePid, Map<String, Object> newConfig, ConfiguratorFactory configuratorFactory) {
ReportImpl report = new ReportImpl();
report.addMessages(serviceConfigurationExists(servicePid, configuratorFactory));
if (report.containsErrorMsgs()) {
return report;
}
String pid = servicePid.getValue();
Configurator configurator = configuratorFactory.getConfigurator();
configurator.updateConfigFile(pid, newConfig, true);
OperationReport operationReport = configurator.commit("Updated config with pid [{}] and new service properties [{}]", pid, newConfig.toString());
if (operationReport.containsFailedResults()) {
return report.addResultMessage(failedUpdateError());
}
return report;
}
Aggregations