summaryrefslogtreecommitdiffstats
path: root/base/kra/src
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2014-04-22 14:22:51 -0400
committerEndi S. Dewata <edewata@redhat.com>2014-04-25 19:03:35 -0400
commit8a6935ba8587ece5e5fcf8b65448c1b57d5ac463 (patch)
tree76df51348828d3f8c2f33a70a4eec2fd498ac44d /base/kra/src
parent5baa286e2104dee77bdc54ac1ad0bb73dfa1b769 (diff)
downloadpki-8a6935ba8587ece5e5fcf8b65448c1b57d5ac463.tar.gz
pki-8a6935ba8587ece5e5fcf8b65448c1b57d5ac463.tar.xz
pki-8a6935ba8587ece5e5fcf8b65448c1b57d5ac463.zip
Refactored SystemConfigService (part 12).
Subsystem-specific configuration codes have been moved from the SystemConfigService into the subsystem-specific installer. Ticket #890
Diffstat (limited to 'base/kra/src')
-rw-r--r--base/kra/src/org/dogtagpki/server/kra/rest/KRAInstallerService.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/base/kra/src/org/dogtagpki/server/kra/rest/KRAInstallerService.java b/base/kra/src/org/dogtagpki/server/kra/rest/KRAInstallerService.java
index 755a61e35..e2587237a 100644
--- a/base/kra/src/org/dogtagpki/server/kra/rest/KRAInstallerService.java
+++ b/base/kra/src/org/dogtagpki/server/kra/rest/KRAInstallerService.java
@@ -19,7 +19,11 @@ package org.dogtagpki.server.kra.rest;
import org.dogtagpki.server.rest.SystemConfigService;
+import com.netscape.certsrv.apps.CMS;
import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.PKIException;
+import com.netscape.certsrv.system.ConfigurationRequest;
+import com.netscape.cms.servlet.csadmin.ConfigurationUtils;
/**
* @author alee
@@ -29,4 +33,34 @@ public class KRAInstallerService extends SystemConfigService {
public KRAInstallerService() throws EBaseException {
}
+
+ @Override
+ public void finalizeConfiguration(ConfigurationRequest request) {
+
+ super.finalizeConfiguration(request);
+
+ try {
+ String ca_host = cs.getString("preop.ca.hostname", "");
+
+ // need to push connector information to the CA
+ if (!request.getStandAlone() && !ca_host.equals("")) {
+ ConfigurationUtils.updateConnectorInfo(CMS.getAgentHost(), CMS.getAgentPort());
+ ConfigurationUtils.setupClientAuthUser();
+ }
+
+ } catch (Exception e) {
+ CMS.debug(e);
+ throw new PKIException("Errors in pushing KRA connector information to the CA: " + e);
+ }
+
+ try {
+ if (!request.getIsClone().equals("true")) {
+ ConfigurationUtils.updateNextRanges();
+ }
+
+ } catch (Exception e) {
+ CMS.debug(e);
+ throw new PKIException("Errors in updating next serial number ranges in DB: " + e);
+ }
+ }
}