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/ca/rest/CAInstallerService.java | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'base/ca') diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/CAInstallerService.java b/base/ca/src/org/dogtagpki/server/ca/rest/CAInstallerService.java index 7a1aa5a12..cc3c46585 100644 --- a/base/ca/src/org/dogtagpki/server/ca/rest/CAInstallerService.java +++ b/base/ca/src/org/dogtagpki/server/ca/rest/CAInstallerService.java @@ -19,7 +19,11 @@ package org.dogtagpki.server.ca.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,36 @@ public class CAInstallerService extends SystemConfigService { public CAInstallerService() throws EBaseException { } + + @Override + public void finalizeConfiguration(ConfigurationRequest request) { + + super.finalizeConfiguration(request); + + 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); + } + + try { + if (request.getIsClone().equals("true") && ConfigurationUtils.isSDHostDomainMaster(cs)) { + // cloning a domain master CA, the clone is also master of its domain + cs.putString("securitydomain.host", CMS.getEEHost()); + cs.putString("securitydomain.httpport", CMS.getEENonSSLPort()); + cs.putString("securitydomain.httpsadminport", CMS.getAdminPort()); + cs.putString("securitydomain.httpsagentport", CMS.getAgentPort()); + cs.putString("securitydomain.httpseeport", CMS.getEESSLPort()); + cs.putString("securitydomain.select", "new"); + } + + } catch (Exception e) { + CMS.debug(e); + throw new PKIException("Errors in determining if security domain host is a master CA"); + } + } } -- cgit