summaryrefslogtreecommitdiffstats
path: root/base/server/cms/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 18:58:09 -0400
commit7528c80cc37e550fc52f274f625f93f8f03bf99d (patch)
tree14761ec907a4f46cfe5f87b7b6946465731420f8 /base/server/cms/src
parentd47ae3541cd7624456a8795a946c971413d68c14 (diff)
downloadpki-7528c80cc37e550fc52f274f625f93f8f03bf99d.tar.gz
pki-7528c80cc37e550fc52f274f625f93f8f03bf99d.tar.xz
pki-7528c80cc37e550fc52f274f625f93f8f03bf99d.zip
Refactored SystemConfigService (part 7).
The OCSP-specific codes to finalize the configuration have been moved into separate methods. Ticket #890
Diffstat (limited to 'base/server/cms/src')
-rw-r--r--base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java46
1 files changed, 24 insertions, 22 deletions
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
index e24a43886..e75a172cd 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/SystemConfigService.java
@@ -238,32 +238,12 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
throw new PKIException("Error while updating security domain: " + e);
}
- // need to push connector information to the CA
- String ca_host="";
- try {
- ca_host = cs.getString("preop.ca.hostname", "");
- } catch (EBaseException e) {
- e.printStackTrace();
- }
-
if (csType.equals("KRA")) {
finalizeKRAConfiguration(data);
}
- // import the CA certificate into the OCSP
- // configure the CRL Publishing to OCSP in CA
- try {
- if (csType.equals("OCSP") && (!ca_host.equals(""))) {
- CMS.reinit(IOCSPAuthority.ID);
- ConfigurationUtils.importCACertToOCSP();
- if (!data.getStandAlone()) {
- ConfigurationUtils.updateOCSPConfig();
- ConfigurationUtils.setupClientAuthUser();
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- throw new PKIException("Errors in configuring CA publishing to OCSP: " + e);
+ if (csType.equals("OCSP")) {
+ finalizeOCSPConfiguration(data);
}
if (csType.equals("CA")) {
@@ -716,6 +696,28 @@ public class SystemConfigService extends PKIService implements SystemConfigResou
}
}
+ public void finalizeOCSPConfiguration(ConfigurationRequest request) {
+ try {
+ String ca_host = cs.getString("preop.ca.hostname", "");
+
+ // import the CA certificate into the OCSP
+ // configure the CRL Publishing to OCSP in CA
+ if (!ca_host.equals("")) {
+ CMS.reinit(IOCSPAuthority.ID);
+ ConfigurationUtils.importCACertToOCSP();
+
+ if (!request.getStandAlone()) {
+ ConfigurationUtils.updateOCSPConfig();
+ ConfigurationUtils.setupClientAuthUser();
+ }
+ }
+
+ } catch (Exception e) {
+ CMS.debug(e);
+ throw new PKIException("Errors in configuring CA publishing to OCSP: " + e);
+ }
+ }
+
public void configureAdministrator(ConfigurationRequest data, ConfigurationResponse response) {
if (!data.getIsClone().equals("true")) {
try {