From 8687740539fcf21a63b362320482e8161f5e9781 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 23 Oct 2012 09:32:24 -0500 Subject: 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 --- .../ca/CertificateAuthorityApplication.java | 25 ++++++++++++++++++---- 1 file 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 -- cgit