diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-23 09:32:24 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-10-23 15:25:42 -0500 |
commit | 8687740539fcf21a63b362320482e8161f5e9781 (patch) | |
tree | 959c73479d93d59185f73f0316125247571862c1 /base/ca | |
parent | 7ec6c918b20fc6feea531c2bd6cea48d62b06e36 (diff) | |
download | pki-8687740539fcf21a63b362320482e8161f5e9781.tar.gz pki-8687740539fcf21a63b362320482e8161f5e9781.tar.xz pki-8687740539fcf21a63b362320482e8161f5e9781.zip |
Added conditions for security domain REST service.
The CertificateAuthorityApplication has been modified to deploy
the REST service for security domain only if the server has been
configured with a new security domain.
Ticket #309
Diffstat (limited to 'base/ca')
-rw-r--r-- | base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java b/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java index dc23042a2..42fd439de 100644 --- a/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java +++ b/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java @@ -50,14 +50,31 @@ public class CertificateAuthorityApplication extends Application { classes.add(SystemCertService.class); // security domain + IConfigStore cs = CMS.getConfigStore(); + + // check server state + int state; try { - IConfigStore cs = CMS.getConfigStore(); - String select = cs.getString("securitydomain.select"); + state = cs.getInteger("cs.state"); + } catch (EBaseException e) { + CMS.debug(e); + throw new RuntimeException(e); + } + + // if server is configured, check security domain selection + if (state == 1) { + String select; + try { + select = cs.getString("securitydomain.select"); + } catch (EBaseException e) { + CMS.debug(e); + throw new RuntimeException(e); + } + + // if it's a new security domain, register the service if ("new".equals(select)) { classes.add(SecurityDomainService.class); } - } catch (EBaseException e) { - CMS.debug(e); } // exception mapper |