summaryrefslogtreecommitdiffstats
path: root/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2016-04-15 14:36:00 -0400
committerAde Lee <alee@redhat.com>2016-04-15 15:06:13 -0400
commit0c5fb1e398510391187054a465c6460042bfc0b2 (patch)
tree4bd9e90039b0732d3f25f2760b59a7047a89baf9 /base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
parent88e963d55bdf4cb9799ef665a72f8855fc00c4da (diff)
downloadpki-0c5fb1e398510391187054a465c6460042bfc0b2.tar.gz
pki-0c5fb1e398510391187054a465c6460042bfc0b2.tar.xz
pki-0c5fb1e398510391187054a465c6460042bfc0b2.zip
Add script to enable USN plugin
New authority monitor code requires the USN plugin to be enabled in the database to ensure that the entryUSN attribute is added to authority entries. In the case where this plugin was disabled, accessing this attribute resulted in a null pointer exception whch prevented server startup. The code has been changed so as not to throw a null pointer exception on startup if the entryusn is not present, and also to call an LDIF to enable the plugin when a subsystem is configured through pkispawn.
Diffstat (limited to 'base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java')
-rw-r--r--base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index e2b014f35..8c353f0c7 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -1283,6 +1283,23 @@ public class ConfigurationUtils {
}
}
+ public static void enableUSNPlugin() throws IOException, EBaseException {
+ IConfigStore cs = CMS.getConfigStore();
+
+ IConfigStore dbCfg = cs.getSubStore("internaldb");
+ ILdapConnFactory dbFactory = CMS.getLdapBoundConnFactory("ConfigurationUtils");
+ dbFactory.init(dbCfg);
+ LDAPConnection conn = dbFactory.getConn();
+ try {
+ importLDIFS("preop.internaldb.usn.ldif", conn);
+ } catch (Exception e) {
+ CMS.debug("Failed to enable USNPlugin: " + e);
+ throw new EBaseException("Failed to enable USN plugin: " + e, e);
+ } finally {
+ releaseConnection(conn);
+ }
+ }
+
public static void populateDB() throws IOException, EBaseException {
IConfigStore cs = CMS.getConfigStore();