summaryrefslogtreecommitdiffstats
path: root/base/ca
diff options
context:
space:
mode:
authorFraser Tweedale <ftweedal@redhat.com>2014-07-17 00:24:06 -0400
committerFraser Tweedale <frase@frase.id.au>2015-04-07 22:38:10 -0400
commit4785f08b9fa14e2abd60533542d763bdea8082a0 (patch)
tree94ed0549d16ef39e71b8f6d4349055de98ad44b8 /base/ca
parent1b44dcbdac86f5545431be4f47e6d98a743225b8 (diff)
downloadpki-4785f08b9fa14e2abd60533542d763bdea8082a0.tar.gz
pki-4785f08b9fa14e2abd60533542d763bdea8082a0.tar.xz
pki-4785f08b9fa14e2abd60533542d763bdea8082a0.zip
Add LDAPProfileSubsystem to store profiles in LDAP
Add the LDAPProfileSubsystem as another IProfileSubsystem implementation that can be used instead of ProfileSubsystem (which stores profiles on the file system) to store files in LDAP so that changes can be replicated. Extract common behaviour in to new AbstractProfileSubsystem superclass. Also address the minor issue #1220.
Diffstat (limited to 'base/ca')
-rw-r--r--base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java16
1 files changed, 4 insertions, 12 deletions
diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
index 3b2f8a50e..d3f08b270 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
@@ -18,7 +18,6 @@
package org.dogtagpki.server.ca.rest;
-import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.security.Principal;
@@ -244,7 +243,7 @@ public class ProfileService extends PKIService implements ProfileResource {
data.setAuthenticatorId(profile.getAuthenticatorId());
data.setAuthzAcl(profile.getAuthzAcl());
- data.setClassId(cs.getString(profileId + ".class_id"));
+ data.setClassId(ps.getProfileClassId(profileId));
data.setDescription(profile.getDescription(getLocale(headers)));
data.setEnabled(ps.isProfileEnable(profileId));
data.setEnabledBy(ps.getProfileEnableBy(profileId));
@@ -472,18 +471,13 @@ public class ProfileService extends PKIService implements ProfileResource {
auditParams.put("description", data.getDescription());
auditParams.put("visible", Boolean.toString(data.isVisible()));
- String config = CMS.getConfigStore().getString("instanceRoot") + "/ca/profiles/ca/" +
- profileId + ".cfg";
- File configFile = new File(config);
- configFile.createNewFile();
IPluginInfo info = registry.getPluginInfo("profile", data.getClassId());
- profile = ps.createProfile(profileId, data.getClassId(), info.getClassName(), config);
+ profile = ps.createProfile(profileId, data.getClassId(), info.getClassName());
profile.setName(getLocale(headers), data.getName());
profile.setDescription(getLocale(headers), data.getDescription());
profile.setVisible(data.isVisible());
profile.getConfigStore().commit(false);
- ps.createProfileConfig(profileId, data.getClassId(), config);
if (profile instanceof IProfileEx) {
// populates profile specific plugins such as
@@ -504,7 +498,7 @@ public class ProfileService extends PKIService implements ProfileResource {
return createCreatedResponse(profileData, profileData.getLink().getHref());
- } catch (EBaseException | IOException e) {
+ } catch (EBaseException e) {
CMS.debug("createProfile: error in creating profile: " + e);
e.printStackTrace();
@@ -983,9 +977,7 @@ public class ProfileService extends PKIService implements ProfileResource {
"`. Profile must be disabled first.");
}
- String configFile = CMS.getConfigStore().getString("profile." + profileId + ".config");
-
- ps.deleteProfile(profileId, configFile);
+ ps.deleteProfile(profileId);
auditProfileChange(
ScopeDef.SC_PROFILE_RULES,