summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-09-21 15:40:34 -0400
committerAde Lee <alee@redhat.com>2012-09-21 15:42:42 -0400
commit11e05d322df8ab09673cd9d4918ec39a8cb82999 (patch)
tree6c3f36300bfb0ff37647c462a0b4bdc055a2ccf2 /base
parentf5b8ea5b087f642a0208c228dce6f700cd7d91c1 (diff)
downloadpki-11e05d322df8ab09673cd9d4918ec39a8cb82999.tar.gz
pki-11e05d322df8ab09673cd9d4918ec39a8cb82999.tar.xz
pki-11e05d322df8ab09673cd9d4918ec39a8cb82999.zip
Use getStatus servlet to provide startup status
Ticket 314
Diffstat (limited to 'base')
-rw-r--r--base/common/src/com/netscape/cms/servlet/csadmin/GetStatus.java2
-rw-r--r--base/common/src/com/netscape/cmscore/apps/CMSEngine.java6
2 files changed, 8 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/GetStatus.java b/base/common/src/com/netscape/cms/servlet/csadmin/GetStatus.java
index 998a4b162..a648b04d5 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/GetStatus.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/GetStatus.java
@@ -66,6 +66,7 @@ public class GetStatus extends CMSServlet {
String state = config.getString("cs.state", "");
String type = config.getString("cs.type", "");
+ String status = config.getString("cs.status", "unknown");
try {
XMLObject xmlObj = null;
@@ -76,6 +77,7 @@ public class GetStatus extends CMSServlet {
xmlObj.addItemToContainer(root, "State", state);
xmlObj.addItemToContainer(root, "Type", type);
+ xmlObj.addItemToContainer(root, "Status", status);
byte[] cb = xmlObj.toByteArray();
outputResult(httpResp, "application/xml", cb);
diff --git a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
index 132de912f..7be68d36f 100644
--- a/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
+++ b/base/common/src/com/netscape/cmscore/apps/CMSEngine.java
@@ -342,6 +342,10 @@ public class CMSEngine implements ICMSEngine {
mOwner = owner;
mConfig = config;
int state = mConfig.getInteger("cs.state");
+
+ mConfig.putString("cs.status", "starting");
+ mConfig.commit(false);
+
// my default is 1 day
String flush_timeout = config.getString("securitydomain.flushinterval", "86400000");
String secdomain_source = config.getString("securitydomain.source", "memory");
@@ -415,6 +419,8 @@ public class CMSEngine implements ICMSEngine {
mSDTimer.schedule(timertask, 5, (new Long(secdomain_check_interval)).longValue());
}
+ mConfig.putString("cs.status", "running");
+ mConfig.commit(false);
}
/**