use of org.codice.ddf.admin.configurator.OperationReport in project admin-console-beta by connexta.
the class SaveContextPolices method performFunction.
@Override
public ListField<ContextPolicyBin> performFunction() {
Configurator configurator = configuratorFactory.getConfigurator();
configurator.updateConfigFile(POLICY_MANAGER_PID, new PolicyManagerServiceProperties().contextPoliciesToPolicyManagerProps(contextPolicies.getList()), true);
OperationReport configReport = configurator.commit("Web Context Policy saved with details: {}", contextPolicies.toString());
if (configReport.containsFailedResults()) {
addResultMessage(failedPersistError());
}
return containsErrorMsgs() ? null : contextPolicies;
}
use of org.codice.ddf.admin.configurator.OperationReport in project admin-console-beta by connexta.
the class SaveWhitelistContexts method performFunction.
@Override
public ListField<ContextPath> performFunction() {
Configurator configurator = configuratorFactory.getConfigurator();
configurator.updateConfigFile(PolicyManagerServiceProperties.POLICY_MANAGER_PID, new PolicyManagerServiceProperties().whiteListToPolicyManagerProps(contexts), true);
OperationReport configReport = configurator.commit("Whitelist Contexts saved with details: {}", contexts.toString());
if (configReport.containsFailedResults()) {
addResultMessage(failedPersistError());
}
return configReport.containsFailedResults() ? null : contexts;
}
use of org.codice.ddf.admin.configurator.OperationReport in project admin-console-beta by connexta.
the class InstallEmbeddedLdap method performFunction.
@Override
public BooleanField performFunction() {
// TODO: tbatie - 4/4/17 - This should return back the setup config
Configurator configurator = configuratorFactory.getConfigurator();
switch(useCase.getValue()) {
case LOGIN:
configurator.startFeature(EMBEDDED_LDAP_FEATURE);
configurator.startFeature(LDAP_LOGIN_FEATURE);
configurator.startFeature(DEFAULT_EMBEDDED_LDAP_LOGIN_CONFIG_FEATURE);
break;
case ATTRIBUTE_STORE:
configurator.startFeature(EMBEDDED_LDAP_FEATURE);
configurator.startFeature(LDAP_CLAIMS_HANDLER_FEATURE);
configurator.startFeature(DEFAULT_EMBEDDED_LDAP_CLAIMS_HANDLER_CONFIG_FEATURE);
break;
case LOGIN_AND_ATTRIBUTE_STORE:
configurator.startFeature(EMBEDDED_LDAP_FEATURE);
configurator.startFeature(LDAP_LOGIN_FEATURE);
configurator.startFeature(LDAP_CLAIMS_HANDLER_FEATURE);
configurator.startFeature(ALL_DEFAULT_EMBEDDED_LDAP_CONFIG_FEATURE);
break;
default:
LOGGER.debug("Unrecognized LDAP use case \"{}\". No commits will be made. ", useCase.getValue());
// TODO: tbatie - 4/4/17 - change this to specify the arg that was unknown
addResultMessage(new ErrorMessage("FAILED_PERSIST"));
return new BooleanField(false);
}
OperationReport report = configurator.commit();
if (report.containsFailedResults()) {
addResultMessage(new ErrorMessage("CANNOT_INSTALL"));
return new BooleanField(false);
}
return new BooleanField(true);
}
use of org.codice.ddf.admin.configurator.OperationReport 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.OperationReport 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);
}
Aggregations