use of org.codice.ddf.admin.api.report.Report in project admin-console-beta by connexta.
the class SecurityValidation method validateStsClaimsExist.
public static Report validateStsClaimsExist(List<StringField> claimArgs, ServiceActions serviceActions, StsServiceProperties stsServiceProps) {
Report report = Reports.emptyReport();
List<String> supportedClaims = stsServiceProps.getConfiguredStsClaims(serviceActions);
claimArgs.stream().filter(claimArg -> !supportedClaims.contains(claimArg.getValue())).forEach(claimArg -> report.addErrorMessage(invalidClaimType(claimArg.getPath())));
return report;
}
use of org.codice.ddf.admin.api.report.Report in project admin-console-beta by connexta.
the class ServiceCommons method updateService.
public Report<Void> updateService(PidField servicePid, Map<String, Object> newConfig) {
Report report = serviceConfigurationExists(servicePid);
if (report.containsErrorMessages()) {
return report;
}
String pid = servicePid.getValue();
Configurator configurator = configuratorSuite.getConfiguratorFactory().getConfigurator();
configurator.add(configuratorSuite.getServiceActions().build(pid, newConfig, true));
OperationReport operationReport = configurator.commit("Updated config with pid [{}]", pid);
if (operationReport.containsFailedResults()) {
report.addErrorMessage(failedPersistError());
}
return report;
}
Aggregations