From 8a6935ba8587ece5e5fcf8b65448c1b57d5ac463 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Tue, 22 Apr 2014 14:22:51 -0400 Subject: Refactored SystemConfigService (part 12). Subsystem-specific configuration codes have been moved from the SystemConfigService into the subsystem-specific installer. Ticket #890 --- .../server/kra/rest/KRAInstallerService.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'base/kra/src') 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); + } + } } -- cgit