use of org.codice.ddf.admin.configurator.Configurator 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.Configurator 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.Configurator in project admin-console-beta by connexta.
the class ServiceCommons method createManagedService.
public static ReportImpl createManagedService(Map<String, Object> serviceProps, String factoryPid, ConfiguratorFactory configuratorFactory) {
ReportImpl report = new ReportImpl();
Configurator configurator = configuratorFactory.getConfigurator();
configurator.createManagedService(factoryPid, serviceProps);
if (configurator.commit("Service saved with details [{}]", serviceProps.toString()).containsFailedResults()) {
report.addResultMessage(failedPersistError());
}
return report;
}
use of org.codice.ddf.admin.configurator.Configurator in project admin-console-beta by connexta.
the class ServiceCommons method deleteService.
public static ReportImpl deleteService(PidField servicePid, ConfiguratorFactory configuratorFactory) {
ReportImpl report = new ReportImpl();
Configurator configurator = configuratorFactory.getConfigurator();
configurator.deleteManagedService(servicePid.getValue());
if (configurator.commit("Deleted source with pid [{}].", servicePid.getValue()).containsFailedResults()) {
report.addResultMessage(failedDeleteError());
}
return report;
}
use of org.codice.ddf.admin.configurator.Configurator 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);
}
Aggregations