use of org.codice.ddf.admin.configurator.Configurator in project admin-console-beta by connexta.
the class DeleteLdapConfiguration method performFunction.
@Override
public ListField<LdapConfigurationField> performFunction() {
Configurator configurator = configuratorFactory.getConfigurator();
configurator.deleteManagedService(pid.getValue());
OperationReport report = configurator.commit("LDAP Configuration deleted for servicePid: {}", pid.getValue());
// TODO: tbatie - 4/3/17 - Add error reporting here
return serviceCommons.getLdapConfigurations(configuratorFactory);
}
use of org.codice.ddf.admin.configurator.Configurator in project admin-console-beta by connexta.
the class SaveLdapConfiguration method performFunction.
@Override
public ListField<LdapConfigurationField> performFunction() {
Configurator configurator = configuratorFactory.getConfigurator();
if (config.settingsField().useCase().equals(LOGIN) || config.settingsField().useCase().equals(LOGIN_AND_ATTRIBUTE_STORE)) {
Map<String, Object> ldapLoginServiceProps = serviceCommons.ldapConfigurationToLdapLoginService(config);
configurator.startFeature(LdapLoginServiceProperties.LDAP_LOGIN_FEATURE);
configurator.createManagedService(LdapLoginServiceProperties.LDAP_LOGIN_MANAGED_SERVICE_FACTORY_PID, ldapLoginServiceProps);
}
if (config.settingsField().useCase().equals(ATTRIBUTE_STORE) || config.settingsField().useCase().equals(LOGIN_AND_ATTRIBUTE_STORE)) {
Path newAttributeMappingPath = Paths.get(System.getProperty("ddf.home"), "etc", "ws-security", "ldapAttributeMap-" + UUID.randomUUID().toString() + ".props");
Map<String, Object> ldapClaimsServiceProps = serviceCommons.ldapConfigToLdapClaimsHandlerService(config);
configurator.createPropertyFile(newAttributeMappingPath, config.settingsField().attributeMap());
configurator.startFeature(LdapClaimsHandlerServiceProperties.LDAP_CLAIMS_HANDLER_FEATURE);
configurator.createManagedService(LdapClaimsHandlerServiceProperties.LDAP_CLAIMS_HANDLER_MANAGED_SERVICE_FACTORY_PID, ldapClaimsServiceProps);
}
OperationReport report = configurator.commit("LDAP Configuration saved with details: {}", config.toString());
// TODO: tbatie - 4/3/17 - Handle error messages
return serviceCommons.getLdapConfigurations(configuratorFactory);
}
use of org.codice.ddf.admin.configurator.Configurator 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