>From d2838897eb2ef43f538a1c57e6195292237aa28c Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Wed, 12 Apr 2017 02:46:49 +0200
Subject: [PATCH] Reorganized audit event constants for KRA.

Change-Id: Ic4a79b0c73812c7b89daca3c804e6a88c738536a
---
 .../com/netscape/certsrv/logging/AuditEvent.java   | 28 ++++++++++++++++++++++
 .../src/com/netscape/kra/AsymKeyGenService.java    |  5 ++--
 .../com/netscape/kra/SecurityDataProcessor.java    | 12 +++-------
 .../kra/src/com/netscape/kra/SymKeyGenService.java |  6 ++---
 .../server/kra/rest/KeyRequestService.java         | 26 +++++---------------
 .../org/dogtagpki/server/kra/rest/KeyService.java  | 10 +++-----
 .../servlet/csadmin/SecurityDomainProcessor.java   |  8 +++----
 .../cms/servlet/csadmin/UpdateDomainXML.java       |  7 +++---
 .../cms/servlet/csadmin/UpdateNumberRange.java     |  9 ++++---
 .../com/netscape/cmscore/session/SessionTimer.java |  6 ++---
 10 files changed, 56 insertions(+), 61 deletions(-)

diff --git a/base/common/src/com/netscape/certsrv/logging/AuditEvent.java b/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
index abe16b6c2275263c6096f19413800ed7ee233aac..dc632c3d940a3d0cf2a44cef5b30228aec2caad4 100644
--- a/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
+++ b/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
@@ -35,6 +35,34 @@ import com.netscape.certsrv.base.MessageFormatter;
  */
 public class AuditEvent implements IBundleLogEvent {
 
+    public final static String SECURITY_DOMAIN_UPDATE =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE_1";
+    public final static String CONFIG_SERIAL_NUMBER =
+            "LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER_1";
+
+    public final static String SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED_6";
+    public static final String SECURITY_DATA_ARCHIVAL_REQUEST =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_4";
+    public final static String SECURITY_DATA_RECOVERY_REQUEST_PROCESSED =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_PROCESSED_5";
+    public static final String SECURITY_DATA_RECOVERY_REQUEST =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_4";
+    public static final String SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE_4";
+    public final static String SECURITY_DATA_RETRIEVE_KEY =
+            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RETRIEVE_KEY_5";
+    public final static String KEY_STATUS_CHANGE =
+            "LOGGING_SIGNED_AUDIT_KEY_STATUS_CHANGE_6";
+    public final static String SYMKEY_GENERATION_REQUEST_PROCESSED =
+            "LOGGING_SIGNED_AUDIT_SYMKEY_GEN_REQUEST_PROCESSED_6";
+    public static final String SYMKEY_GENERATION_REQUEST =
+            "LOGGING_SIGNED_AUDIT_SYMKEY_GENERATION_REQUEST_4";
+    public static final String ASYMKEY_GENERATION_REQUEST =
+            "LOGGING_SIGNED_AUDIT_ASYMKEY_GENERATION_REQUEST_4";
+    public final static String ASYMKEY_GENERATION_REQUEST_PROCESSED =
+            "LOGGING_SIGNED_AUDIT_ASYMKEY_GEN_REQUEST_PROCESSED_6";
+
     public final static String TOKEN_CERT_ENROLLMENT =
             "LOGGING_SIGNED_AUDIT_TOKEN_CERT_ENROLLMENT_9";
     public final static String TOKEN_CERT_RENEWAL =
diff --git a/base/kra/src/com/netscape/kra/AsymKeyGenService.java b/base/kra/src/com/netscape/kra/AsymKeyGenService.java
index a731fb1552a9030c03f2627bae1d0ad0515a57a5..75e340cd32c6b228fb7546772ada2c94f95e295f 100644
--- a/base/kra/src/com/netscape/kra/AsymKeyGenService.java
+++ b/base/kra/src/com/netscape/kra/AsymKeyGenService.java
@@ -35,6 +35,7 @@ import com.netscape.certsrv.dbs.keydb.IKeyRepository;
 import com.netscape.certsrv.key.AsymKeyGenerationRequest;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.IService;
@@ -63,8 +64,6 @@ public class AsymKeyGenService implements IService {
     private IKeyRecoveryAuthority kra = null;
     private IStorageKeyUnit storageUnit = null;
     private ILogger signedAuditLogger = CMS.getSignedAuditLogger();
-    private final static String LOGGING_SIGNED_AUDIT_ASYMKEY_GEN_REQUEST_PROCESSED =
-            "LOGGING_SIGNED_AUDIT_ASYMKEY_GEN_REQUEST_PROCESSED_6";
 
     public AsymKeyGenService(IKeyRecoveryAuthority kra) {
         this.kra = kra;
@@ -233,7 +232,7 @@ public class AsymKeyGenService implements IService {
             String clientKeyID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_ASYMKEY_GEN_REQUEST_PROCESSED,
+                AuditEvent.ASYMKEY_GENERATION_REQUEST_PROCESSED,
                 subjectID,
                 status,
                 requestID.toString(),
diff --git a/base/kra/src/com/netscape/kra/SecurityDataProcessor.java b/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
index 3475eaef9d71b8f28427c4288f87e63552d2c050..78d64c53ea98430d2ef3bd382a938364ce74acf6 100644
--- a/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
+++ b/base/kra/src/com/netscape/kra/SecurityDataProcessor.java
@@ -38,6 +38,7 @@ import com.netscape.certsrv.dbs.keydb.IKeyRepository;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.kra.EKRAException;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.profile.IEnrollProfile;
 import com.netscape.certsrv.request.IRequest;
@@ -65,13 +66,6 @@ public class SecurityDataProcessor {
     private static boolean allowEncDecrypt_archival = false;
     private static boolean allowEncDecrypt_recovery = false;
 
-    private final static String LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED_6";
-
-    private final static String LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_PROCESSED =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_PROCESSED_5";
-
-
     public SecurityDataProcessor(IKeyRecoveryAuthority kra) {
         this.kra = kra;
         transportUnit = kra.getTransportKeyUnit();
@@ -779,7 +773,7 @@ public class SecurityDataProcessor {
     private void auditRecoveryRequestProcessed(String subjectID, String status, RequestId requestID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_PROCESSED,
+                AuditEvent.SECURITY_DATA_RECOVERY_REQUEST_PROCESSED,
                 subjectID,
                 status,
                 requestID.toString(),
@@ -791,7 +785,7 @@ public class SecurityDataProcessor {
     private void auditArchivalRequestProcessed(String subjectID, String status, RequestId requestID, String clientKeyID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED,
+                AuditEvent.SECURITY_DATA_ARCHIVAL_REQUEST_PROCESSED,
                 subjectID,
                 status,
                 requestID.toString(),
diff --git a/base/kra/src/com/netscape/kra/SymKeyGenService.java b/base/kra/src/com/netscape/kra/SymKeyGenService.java
index 9c50eb377d75a77d3b4dcd00a5a9224ecce4bf50..f700a79054c8351f4a40fb05d5733dc55685837c 100644
--- a/base/kra/src/com/netscape/kra/SymKeyGenService.java
+++ b/base/kra/src/com/netscape/kra/SymKeyGenService.java
@@ -34,6 +34,7 @@ import com.netscape.certsrv.dbs.keydb.IKeyRepository;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.SymKeyGenerationRequest;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.IService;
@@ -60,9 +61,6 @@ public class SymKeyGenService implements IService {
     private IStorageKeyUnit mStorageUnit = null;
     private ILogger signedAuditLogger = CMS.getSignedAuditLogger();
 
-    private final static String LOGGING_SIGNED_AUDIT_SYMKEY_GEN_REQUEST_PROCESSED =
-            "LOGGING_SIGNED_AUDIT_SYMKEY_GEN_REQUEST_PROCESSED_6";
-
     public SymKeyGenService(IKeyRecoveryAuthority kra) {
         mKRA = kra;
         mStorageUnit = kra.getStorageKeyUnit();
@@ -252,7 +250,7 @@ public class SymKeyGenService implements IService {
     private void auditSymKeyGenRequestProcessed(String subjectID, String status, RequestId requestID, String clientKeyID,
             String keyID, String reason) {
         String auditMessage = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SYMKEY_GEN_REQUEST_PROCESSED,
+                AuditEvent.SYMKEY_GENERATION_REQUEST_PROCESSED,
                 subjectID,
                 status,
                 requestID.toString(),
diff --git a/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java b/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java
index e0c4ca95dcb814372d24432d1d265d0b77ac16c6..38f7e93d55208d2cbfd32e89e313a288bfac2762 100644
--- a/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java
+++ b/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java
@@ -48,6 +48,7 @@ import com.netscape.certsrv.key.KeyRequestInfoCollection;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.KeyRequestResponse;
 import com.netscape.certsrv.key.SymKeyGenerationRequest;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestNotFoundException;
@@ -62,21 +63,6 @@ import com.netscape.cmsutil.ldap.LDAPUtil;
  */
 public class KeyRequestService extends SubsystemService implements KeyRequestResource {
 
-    private static final String LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST_4";
-
-    private static final String LOGGING_SIGNED_AUDIT_SYMKEY_GENERATION_REQUEST =
-            "LOGGING_SIGNED_AUDIT_SYMKEY_GENERATION_REQUEST_4";
-
-    private static final String LOGGING_SIGNED_AUDIT_ASYMKEY_GENERATION_REQUEST =
-            "LOGGING_SIGNED_AUDIT_ASYMKEY_GENERATION_REQUEST_4";
-
-    private static final String LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_4";
-
-    private static final String LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE_4";
-
     public static final int DEFAULT_START = 0;
     public static final int DEFAULT_PAGESIZE = 20;
     public static final int DEFAULT_MAXRESULTS = 100;
@@ -349,7 +335,7 @@ public class KeyRequestService extends SubsystemService implements KeyRequestRes
 
     public void auditRecoveryRequestChange(RequestId requestId, String status, String operation) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE,
+                AuditEvent.SECURITY_DATA_RECOVERY_REQUEST_STATE_CHANGE,
                 getRequestor(),
                 status,
                 requestId.toString(),
@@ -359,7 +345,7 @@ public class KeyRequestService extends SubsystemService implements KeyRequestRes
 
     public void auditRecoveryRequestMade(RequestId requestId, String status, KeyId dataId) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_RECOVERY_REQUEST,
+                AuditEvent.SECURITY_DATA_RECOVERY_REQUEST,
                 getRequestor(),
                 status,
                 requestId != null? requestId.toString(): "null",
@@ -369,7 +355,7 @@ public class KeyRequestService extends SubsystemService implements KeyRequestRes
 
     public void auditArchivalRequestMade(RequestId requestId, String status, String clientKeyID) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_ARCHIVAL_REQUEST,
+                AuditEvent.SECURITY_DATA_ARCHIVAL_REQUEST,
                 getRequestor(),
                 status,
                 requestId != null? requestId.toString(): "null",
@@ -379,7 +365,7 @@ public class KeyRequestService extends SubsystemService implements KeyRequestRes
 
     public void auditSymKeyGenRequestMade(RequestId requestId, String status, String clientKeyID) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SYMKEY_GENERATION_REQUEST,
+                AuditEvent.SYMKEY_GENERATION_REQUEST,
                 getRequestor(),
                 status,
                 requestId != null ? requestId.toString() : "null",
@@ -389,7 +375,7 @@ public class KeyRequestService extends SubsystemService implements KeyRequestRes
 
     public void auditAsymKeyGenRequestMade(RequestId requestId, String status, String clientKeyID) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_ASYMKEY_GENERATION_REQUEST,
+                AuditEvent.ASYMKEY_GENERATION_REQUEST,
                 getRequestor(),
                 status,
                 requestId != null ? requestId.toString() : "null",
diff --git a/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java b/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java
index e15b2635e23e20beaa672fb083891425e10c2731..7a21971c272efb3b6b243b0eb281e919b9ae8c9f 100644
--- a/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java
+++ b/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java
@@ -60,6 +60,7 @@ import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyResource;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
 import com.netscape.certsrv.kra.IKeyService;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.IRequestQueue;
@@ -77,11 +78,6 @@ import com.netscape.cmsutil.util.Utils;
  */
 public class KeyService extends SubsystemService implements KeyResource {
 
-    private final static String LOGGING_SIGNED_AUDIT_SECURITY_DATA_RETRIEVE_KEY =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DATA_RETRIEVE_KEY_5";
-    private final static String LOGGING_SIGNED_AUDIT_KEY_STATUS_CHANGE =
-            "LOGGING_SIGNED_AUDIT_KEY_STATUS_CHANGE_6";
-
     public static final int DEFAULT_MAXRESULTS = 100;
     public static final int DEFAULT_MAXTIME = 10;
     public static final String ATTR_SERIALNO = "serialNumber";
@@ -606,7 +602,7 @@ public class KeyService extends SubsystemService implements KeyResource {
 
     public void auditRetrieveKey(String status, String reason) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_SECURITY_DATA_RETRIEVE_KEY,
+                AuditEvent.SECURITY_DATA_RETRIEVE_KEY,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 requestId != null ? requestId.toString(): "null",
@@ -628,7 +624,7 @@ public class KeyService extends SubsystemService implements KeyResource {
     public void auditKeyStatusChange(String status, String keyID, String oldKeyStatus,
             String newKeyStatus, String info) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_KEY_STATUS_CHANGE,
+                AuditEvent.KEY_STATUS_CHANGE,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 keyID,
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
index 3a2b694e56c8fabe02c22a36fefb81e46f891654..69e76fcb98ea62ce38e5150a2834f92eaa375f07 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/SecurityDomainProcessor.java
@@ -43,6 +43,7 @@ import com.netscape.certsrv.base.ISecurityDomainSessionTable;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.base.UnauthorizedException;
 import com.netscape.certsrv.ldap.ILdapConnFactory;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.system.DomainInfo;
 import com.netscape.certsrv.system.InstallToken;
@@ -64,9 +65,6 @@ import netscape.ldap.LDAPSearchResults;
  */
 public class SecurityDomainProcessor extends CAProcessor {
 
-    public final static String LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE_1";
-
     public final static String[] TYPES = { "CA", "KRA", "OCSP", "TKS", "RA", "TPS" };
 
     Random random = new Random();
@@ -128,7 +126,7 @@ public class SecurityDomainProcessor extends CAProcessor {
 
         if (status == ISecurityDomainSessionTable.SUCCESS) {
             message = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE,
+                               AuditEvent.SECURITY_DOMAIN_UPDATE,
                                user,
                                ILogger.SUCCESS,
                                auditParams);
@@ -136,7 +134,7 @@ public class SecurityDomainProcessor extends CAProcessor {
 
         } else {
             message = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE,
+                               AuditEvent.SECURITY_DOMAIN_UPDATE,
                                user,
                                ILogger.FAILURE,
                                auditParams);
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateDomainXML.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateDomainXML.java
index 1a23823b2efe3cf8144f0f1a6da9f59e84aaf67b..bed43573bba884c04f465cd85baf812dccd3c793 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateDomainXML.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateDomainXML.java
@@ -47,6 +47,7 @@ import com.netscape.certsrv.authorization.EAuthzAccessDenied;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.ldap.ILdapConnFactory;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.cms.servlet.base.CMSServlet;
 import com.netscape.cms.servlet.base.UserInfo;
@@ -62,8 +63,6 @@ public class UpdateDomainXML extends CMSServlet {
     private static final long serialVersionUID = 4059169588555717548L;
     private final static String SUCCESS = "0";
     private final static String FAILED = "1";
-    private final static String LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE_1";
     private final static String LOGGING_SIGNED_AUDIT_CONFIG_ROLE =
             "LOGGING_SIGNED_AUDIT_CONFIG_ROLE_3";
 
@@ -501,14 +500,14 @@ public class UpdateDomainXML extends CMSServlet {
 
         if (status.equals(SUCCESS)) {
             auditMessage = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE,
+                               AuditEvent.SECURITY_DOMAIN_UPDATE,
                                auditSubjectID,
                                ILogger.SUCCESS,
                                auditParams);
         } else {
             // what if already exists or already deleted
             auditMessage = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE,
+                               AuditEvent.SECURITY_DOMAIN_UPDATE,
                                auditSubjectID,
                                ILogger.FAILURE,
                                auditParams);
diff --git a/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java b/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
index e068bd4941ca244ed46e606874cb3a999cd5141b..2586da210a5f5efc9bb95e6698008b1e2b160920 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/csadmin/UpdateNumberRange.java
@@ -37,6 +37,7 @@ import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.ca.ICertificateAuthority;
 import com.netscape.certsrv.dbs.repository.IRepository;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.cms.servlet.base.CMSServlet;
 import com.netscape.cms.servlet.base.UserInfo;
@@ -52,8 +53,6 @@ public class UpdateNumberRange extends CMSServlet {
     private static final long serialVersionUID = -1584171713024263331L;
     private final static String SUCCESS = "0";
     private final static String AUTH_FAILURE = "2";
-    private final static String LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER =
-            "LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER_1";
 
     public UpdateNumberRange() {
         super();
@@ -208,7 +207,7 @@ public class UpdateNumberRange extends CMSServlet {
                 CMS.debug("UpdateNumberRange::process() - " +
                            "beginNum is null!");
                 auditMessage = CMS.getLogMessage(
-                                   LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER,
+                                   AuditEvent.CONFIG_SERIAL_NUMBER,
                                    auditSubjectID,
                                    ILogger.FAILURE,
                                    auditParams);
@@ -240,7 +239,7 @@ public class UpdateNumberRange extends CMSServlet {
                           "+endNumber;;" + endNum.toString(radix);
 
             auditMessage = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER,
+                               AuditEvent.CONFIG_SERIAL_NUMBER,
                                auditSubjectID,
                                ILogger.SUCCESS,
                                auditParams);
@@ -251,7 +250,7 @@ public class UpdateNumberRange extends CMSServlet {
             CMS.debug(e);
 
             auditMessage = CMS.getLogMessage(
-                               LOGGING_SIGNED_AUDIT_CONFIG_SERIAL_NUMBER,
+                               AuditEvent.CONFIG_SERIAL_NUMBER,
                                auditSubjectID,
                                ILogger.FAILURE,
                                auditParams);
diff --git a/base/server/cmscore/src/com/netscape/cmscore/session/SessionTimer.java b/base/server/cmscore/src/com/netscape/cmscore/session/SessionTimer.java
index 0f79fc485daec98af99a2d9f76dd3baadc260672..c6db13190fb8339bc5931a2e0a5bf28be4172707 100644
--- a/base/server/cmscore/src/com/netscape/cmscore/session/SessionTimer.java
+++ b/base/server/cmscore/src/com/netscape/cmscore/session/SessionTimer.java
@@ -23,14 +23,12 @@ import java.util.TimerTask;
 
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.ISecurityDomainSessionTable;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 
 public class SessionTimer extends TimerTask {
     private ISecurityDomainSessionTable m_sessiontable = null;
     private ILogger mSignedAuditLogger = CMS.getSignedAuditLogger();
-    private final static String LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE =
-            "LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE_1";
-
     public SessionTimer(ISecurityDomainSessionTable table) {
         super();
         m_sessiontable = table;
@@ -61,7 +59,7 @@ public class SessionTimer extends TimerTask {
                 // audit message
                 String auditParams = "operation;;expire_token+token;;" + sessionId;
                 String auditMessage = CMS.getLogMessage(
-                                         LOGGING_SIGNED_AUDIT_SECURITY_DOMAIN_UPDATE,
+                                         AuditEvent.SECURITY_DOMAIN_UPDATE,
                                          "system",
                                          ILogger.SUCCESS,
                                          auditParams);
-- 
2.9.3

