summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java')
-rw-r--r--pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java55
1 files changed, 26 insertions, 29 deletions
diff --git a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
index 4f3862594..b5f829f77 100644
--- a/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
+++ b/pki/base/common/src/com/netscape/cmscore/profile/ProfileSubsystem.java
@@ -17,7 +17,6 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.cmscore.profile;
-
import java.io.File;
import java.util.Enumeration;
import java.util.Hashtable;
@@ -34,7 +33,6 @@ import com.netscape.certsrv.profile.IProfileSubsystem;
import com.netscape.certsrv.registry.IPluginInfo;
import com.netscape.certsrv.registry.IPluginRegistry;
-
public class ProfileSubsystem implements IProfileSubsystem {
private static final String PROP_LIST = "list";
private static final String PROP_CLASS_ID = "class_id";
@@ -54,7 +52,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Retrieves the name of this subsystem.
*/
public String getId() {
- return null;
+ return null;
}
/**
@@ -67,16 +65,16 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Initializes this subsystem with the given configuration
* store.
* <P>
- *
+ *
* @param owner owner of this subsystem
* @param config configuration store
* @exception EBaseException failed to initialize
*/
public void init(ISubsystem owner, IConfigStore config)
- throws EBaseException {
+ throws EBaseException {
CMS.debug("ProfileSubsystem: start init");
IPluginRegistry registry = (IPluginRegistry)
- CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY);
+ CMS.getSubsystem(CMS.SUBSYSTEM_REGISTRY);
mConfig = config;
mOwner = owner;
@@ -100,7 +98,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
String configPath = subStore.getString(PROP_CONFIG);
CMS.debug("Start Profile Creation - " + id + " " + classid + " " + info.getClassName());
- IProfile profile = createProfile(id, classid, info.getClassName(),
+ IProfile profile = createProfile(id, classid, info.getClassName(),
configPath);
CMS.debug("Done Profile Creation - " + id);
@@ -112,15 +110,15 @@ public class ProfileSubsystem implements IProfileSubsystem {
String id = (String) ee.nextElement();
CMS.debug("Registered Confirmation - " + id);
- }
+ }
}
/**
* Creates a profile instance.
*/
- public IProfile createProfile(String id, String classid, String className,
- String configPath)
- throws EProfileException {
+ public IProfile createProfile(String id, String classid, String className,
+ String configPath)
+ throws EProfileException {
IProfile profile = null;
try {
@@ -143,11 +141,11 @@ public class ProfileSubsystem implements IProfileSubsystem {
}
public void deleteProfile(String id, String configPath) throws EProfileException {
-
+
if (isProfileEnable(id)) {
throw new EProfileException("CMS_PROFILE_DELETE_ENABLEPROFILE");
}
-
+
String ids = "";
try {
ids = mConfig.getString(PROP_LIST, "");
@@ -166,7 +164,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
}
if (!list.equals(""))
list = list.substring(0, list.length() - 1);
-
+
mConfig.putString(PROP_LIST, list);
mConfig.removeSubStore(id);
File file1 = new File(configPath);
@@ -181,13 +179,13 @@ public class ProfileSubsystem implements IProfileSubsystem {
}
}
- public void createProfileConfig(String id, String classId,
- String configPath)
- throws EProfileException {
+ public void createProfileConfig(String id, String classId,
+ String configPath)
+ throws EProfileException {
try {
if (mProfiles.size() > 0) {
- mConfig.putString(PROP_LIST,
- mConfig.getString(PROP_LIST) + "," + id);
+ mConfig.putString(PROP_LIST,
+ mConfig.getString(PROP_LIST) + "," + id);
} else {
mConfig.putString(PROP_LIST, id);
}
@@ -222,7 +220,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
/**
* Returns the root configuration storage of this system.
* <P>
- *
+ *
* @return configuration store of this subsystem
*/
public IConfigStore getConfigStore() {
@@ -233,7 +231,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Adds a profile.
*/
public void addProfile(String id, IProfile profile)
- throws EProfileException {
+ throws EProfileException {
}
public boolean isProfileEnable(String id) {
@@ -267,7 +265,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Enables a profile for execution.
*/
public void enableProfile(String id, String enableBy)
- throws EProfileException {
+ throws EProfileException {
IProfile profile = (IProfile) mProfiles.get(id);
profile.getConfigStore().putString(PROP_ENABLE, "true");
@@ -282,7 +280,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Disables a profile for execution.
*/
public void disableProfile(String id)
- throws EProfileException {
+ throws EProfileException {
IProfile profile = (IProfile) mProfiles.get(id);
profile.getConfigStore().putString(PROP_ENABLE, "false");
@@ -296,7 +294,7 @@ public class ProfileSubsystem implements IProfileSubsystem {
* Retrieves a profile by id.
*/
public IProfile getProfile(String id)
- throws EProfileException {
+ throws EProfileException {
return (IProfile) mProfiles.get(id);
}
@@ -314,15 +312,14 @@ public class ProfileSubsystem implements IProfileSubsystem {
/**
* Checks if owner id should be enforced during profile approval.
- *
+ *
* @return true if approval should be checked
*/
- public boolean checkOwner()
- {
+ public boolean checkOwner() {
try {
- return mConfig.getBoolean(PROP_CHECK_OWNER, false);
+ return mConfig.getBoolean(PROP_CHECK_OWNER, false);
} catch (EBaseException e) {
- return false;
+ return false;
}
}
}