>From e22d0e99aa33bccc3e4041f5ed501fedf0dcae49 Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Wed, 12 Apr 2017 02:28:31 +0200
Subject: [PATCH] Added audit event constants for TPS.

Change-Id: Id7845ebf2a14cebe25189a8363cee759030a16cb
---
 .../dogtagpki/server/ca/rest/AuthorityService.java |  7 +--
 .../com/netscape/certsrv/logging/AuditEvent.java   | 51 ++++++++++++++++++++++
 .../cms/servlet/base/SubsystemService.java         |  3 +-
 .../server/tps/processor/TPSEnrollProcessor.java   | 24 +++++-----
 .../server/tps/processor/TPSPinResetProcessor.java |  5 ++-
 .../server/tps/processor/TPSProcessor.java         | 27 ++++++------
 .../server/tps/rest/AuthenticatorService.java      |  3 +-
 .../server/tps/rest/ConnectorService.java          |  3 +-
 .../server/tps/rest/ProfileMappingService.java     |  3 +-
 .../dogtagpki/server/tps/rest/ProfileService.java  |  3 +-
 .../dogtagpki/server/tps/rest/TokenService.java    |  5 ++-
 11 files changed, 95 insertions(+), 39 deletions(-)

diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java b/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java
index 215d0fa150759e8709c24b08fed0b7abac167311..7ba95963aa9607b2812d4ed09bcec0fa595258f5 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java
@@ -55,6 +55,7 @@ import com.netscape.certsrv.ca.ICertificateAuthority;
 import com.netscape.certsrv.ca.IssuerUnavailableException;
 import com.netscape.certsrv.common.OpDef;
 import com.netscape.certsrv.common.ScopeDef;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cmsutil.util.Utils;
@@ -70,10 +71,6 @@ public class AuthorityService extends SubsystemService implements AuthorityResou
         hostCA = (ICertificateAuthority) CMS.getSubsystem("ca");
     }
 
-    private final static String LOGGING_SIGNED_AUDIT_AUTHORITY_CONFIG =
-            "LOGGING_SIGNED_AUDIT_AUTHORITY_CONFIG_3";
-
-
     @Override
     public Response listCAs() {
         List<AuthorityData> results = new ArrayList<>();
@@ -373,7 +370,7 @@ public class AuthorityService extends SubsystemService implements AuthorityResou
             String status, String op, String id,
             Map<String, String> params) {
         String msg = CMS.getLogMessage(
-                LOGGING_SIGNED_AUDIT_AUTHORITY_CONFIG,
+                AuditEvent.AUTHORITY_CONFIG,
                 auditor.getSubjectID(),
                 status,
                 auditor.getParamString(ScopeDef.SC_AUTHORITY, op, id, params));
diff --git a/base/common/src/com/netscape/certsrv/logging/AuditEvent.java b/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
index b409a1274b73113ba302767b57c76a233f30b915..abe16b6c2275263c6096f19413800ed7ee233aac 100644
--- a/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
+++ b/base/common/src/com/netscape/certsrv/logging/AuditEvent.java
@@ -35,6 +35,57 @@ import com.netscape.certsrv.base.MessageFormatter;
  */
 public class AuditEvent implements IBundleLogEvent {
 
+    public final static String TOKEN_CERT_ENROLLMENT =
+            "LOGGING_SIGNED_AUDIT_TOKEN_CERT_ENROLLMENT_9";
+    public final static String TOKEN_CERT_RENEWAL =
+            "LOGGING_SIGNED_AUDIT_TOKEN_CERT_RENEWAL_9";
+    public final static String TOKEN_CERT_RETRIEVAL =
+            "LOGGING_SIGNED_AUDIT_TOKEN_CERT_RETRIEVAL_9";
+    public final static String TOKEN_KEY_RECOVERY =
+            "LOGGING_SIGNED_AUDIT_TOKEN_KEY_RECOVERY_10";
+    public final static String TOKEN_CERT_STATUS_CHANGE_REQUEST =
+            "LOGGING_SIGNED_AUDIT_TOKEN_CERT_STATUS_CHANGE_REQUEST_10";
+    public final static String TOKEN_PIN_RESET_SUCCESS =
+            "LOGGING_SIGNED_AUDIT_TOKEN_PIN_RESET_SUCCESS_6";
+    public final static String TOKEN_PIN_RESET_FAILURE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_PIN_RESET_FAILURE_6";
+    public final static String TOKEN_OP_REQUEST =
+            "LOGGING_SIGNED_AUDIT_TOKEN_OP_REQUEST_6";
+    public final static String TOKEN_FORMAT_SUCCESS =
+            "LOGGING_SIGNED_AUDIT_TOKEN_FORMAT_SUCCESS_9";
+    public final static String TOKEN_FORMAT_FAILURE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_FORMAT_FAILURE_9";
+    public final static String TOKEN_APPLET_UPGRADE_SUCCESS =
+            "LOGGING_SIGNED_AUDIT_TOKEN_APPLET_UPGRADE_SUCCESS_9";
+    public final static String TOKEN_APPLET_UPGRADE_FAILURE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_APPLET_UPGRADE_FAILURE_9";
+    public final static String TOKEN_KEY_CHANGEOVER_REQUIRED =
+            "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_REQUIRED_10";
+    public final static String TOKEN_KEY_CHANGEOVER_SUCCESS =
+            "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_SUCCESS_10";
+    public final static String TOKEN_KEY_CHANGEOVER_FAILURE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_FAILURE_10";
+    public final static String TOKEN_AUTH_FAILURE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_AUTH_FAILURE_9";
+    public final static String TOKEN_AUTH_SUCCESS =
+            "LOGGING_SIGNED_AUDIT_TOKEN_AUTH_SUCCESS_9";
+    public final static String CONFIG_TOKEN_GENERAL =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_GENERAL_5";
+    public final static String CONFIG_TOKEN_PROFILE =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_PROFILE_6";
+    public final static String CONFIG_TOKEN_MAPPING_RESOLVER =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_MAPPING_RESOLVER_6";
+    public final static String CONFIG_TOKEN_AUTHENTICATOR =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_AUTHENTICATOR_6";
+    public final static String CONFIG_TOKEN_CONNECTOR =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_CONNECTOR_6";
+    public final static String CONFIG_TOKEN_RECORD =
+            "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_RECORD_6";
+    public final static String TOKEN_STATE_CHANGE =
+            "LOGGING_SIGNED_AUDIT_TOKEN_STATE_CHANGE_8";
+    public final static String AUTHORITY_CONFIG =
+            "LOGGING_SIGNED_AUDIT_AUTHORITY_CONFIG_3";
+
     public final static String ACCESS_SESSION_ESTABLISH_FAILURE =
             "LOGGING_SIGNED_AUDIT_ACCESS_SESSION_ESTABLISH_FAILURE";
     public final static String ACCESS_SESSION_ESTABLISH_SUCCESS =
diff --git a/base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java b/base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java
index 48c985c7615001be51e12ac2f0b46821b84872eb..30d6b9cdc4a1eda034d6c9f09a194da72448b2b6 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java
@@ -28,6 +28,7 @@ import javax.ws.rs.core.HttpHeaders;
 
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.authorization.IAuthzSubsystem;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.IAuditor;
 import com.netscape.certsrv.logging.ILogger;
 
@@ -94,7 +95,7 @@ public class SubsystemService extends PKIService {
     public void auditConfigTokenGeneral(String status, String service, Map<String, String> params, String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_GENERAL_5",
+                AuditEvent.CONFIG_TOKEN_GENERAL,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
index 672f53d835ded981bca5c557465541b6cdd95a63..118bf505a60770e102f069bf2c8eb9b12696f29c 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSEnrollProcessor.java
@@ -15,12 +15,6 @@ import java.util.Map;
 import java.util.Random;
 import java.util.zip.DataFormatException;
 
-import netscape.security.provider.RSAPublicKey;
-//import org.mozilla.jss.pkcs11.PK11ECPublicKey;
-import netscape.security.util.BigInt;
-import netscape.security.x509.RevocationReason;
-import netscape.security.x509.X509CertImpl;
-
 import org.dogtagpki.server.tps.TPSSession;
 import org.dogtagpki.server.tps.TPSSubsystem;
 import org.dogtagpki.server.tps.TPSTokenPolicy;
@@ -59,15 +53,21 @@ import org.mozilla.jss.pkcs11.PK11PubKey;
 import org.mozilla.jss.pkcs11.PK11RSAPublicKey;
 import org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo;
 
-import sun.security.pkcs11.wrapper.PKCS11Constants;
-
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.EPropertyNotFound;
 import com.netscape.certsrv.base.IConfigStore;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.tps.token.TokenStatus;
 import com.netscape.cmsutil.util.Utils;
 
+import netscape.security.provider.RSAPublicKey;
+//import org.mozilla.jss.pkcs11.PK11ECPublicKey;
+import netscape.security.util.BigInt;
+import netscape.security.x509.RevocationReason;
+import netscape.security.x509.X509CertImpl;
+import sun.security.pkcs11.wrapper.PKCS11Constants;
+
 public class TPSEnrollProcessor extends TPSProcessor {
 
     public TPSEnrollProcessor(TPSSession session) {
@@ -3683,13 +3683,13 @@ public class TPSEnrollProcessor extends TPSProcessor {
         String auditType = "";
         switch (op) {
         case "retrieval":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_CERT_RETRIEVAL_9";
+            auditType = AuditEvent.TOKEN_CERT_RETRIEVAL;
             break;
         case "renewal":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_CERT_RENEWAL_9";
+            auditType = AuditEvent.TOKEN_CERT_RENEWAL;
             break;
         default:
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_CERT_ENROLLMENT_9";
+            auditType = AuditEvent.TOKEN_CERT_ENROLLMENT;
         }
 
         String auditMessage = CMS.getLogMessage(
@@ -3719,7 +3719,7 @@ public class TPSEnrollProcessor extends TPSProcessor {
             serialNum = serial.toString();
 
         String auditMessage = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_TOKEN_KEY_RECOVERY_10",
+                AuditEvent.TOKEN_KEY_RECOVERY,
                 (session != null) ? session.getIpAddress() : null,
                 subjectID,
                 aInfo.getCUIDhexStringPlain(),
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
index fe3f80151fd95d457c12932d0fe066808dd9df72..b309657ae1c3f5e3c4879d1d4311e0c74d6ab98b 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSPinResetProcessor.java
@@ -33,6 +33,7 @@ import org.dogtagpki.tps.msg.BeginOpMsg;
 import org.dogtagpki.tps.msg.EndOpMsg.TPSStatus;
 
 import com.netscape.certsrv.apps.CMS;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.tps.token.TokenStatus;
 
 public class TPSPinResetProcessor extends TPSProcessor {
@@ -197,10 +198,10 @@ public class TPSPinResetProcessor extends TPSProcessor {
         String auditType = "";
         switch (status) {
         case "success":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_PIN_RESET_SUCCESS_6";
+            auditType = AuditEvent.TOKEN_PIN_RESET_SUCCESS;
             break;
         default:
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_PIN_RESET_FAILURE_6";
+            auditType = AuditEvent.TOKEN_PIN_RESET_FAILURE;
         }
 
         String auditMessage = CMS.getLogMessage(
diff --git a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
index 7d17f36b72b7ff1e208d4017769c016f2bef4339..910a26371d385d0d6bde6bd838780c5ee6334c4f 100644
--- a/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
+++ b/base/tps/src/org/dogtagpki/server/tps/processor/TPSProcessor.java
@@ -33,8 +33,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-import netscape.security.x509.RevocationReason;
-
 import org.dogtagpki.server.tps.TPSSession;
 import org.dogtagpki.server.tps.TPSSubsystem;
 import org.dogtagpki.server.tps.authentication.AuthUIParameter;
@@ -95,12 +93,15 @@ import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.EPropertyNotFound;
 import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.token.TokenStatus;
 import com.netscape.cms.servlet.tks.SecureChannelProtocol;
 import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.symkey.SessionKey;
 
+import netscape.security.x509.RevocationReason;
+
 public class TPSProcessor {
 
     public static final int RESULT_NO_ERROR = 0;
@@ -4054,9 +4055,9 @@ public class TPSProcessor {
             String status,
             String authMgrId) {
 
-        String auditType = "LOGGING_SIGNED_AUDIT_TOKEN_AUTH_FAILURE_9";
+        String auditType = AuditEvent.TOKEN_AUTH_FAILURE;
         if (status.equals("success"))
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_AUTH_SUCCESS_9";
+            auditType = AuditEvent.TOKEN_AUTH_SUCCESS;
 
         String auditMessage = CMS.getLogMessage(
                 auditType,
@@ -4078,7 +4079,7 @@ public class TPSProcessor {
     protected void auditOpRequest(String op, AppletInfo aInfo,
             String status,
             String info) {
-        String auditType = "LOGGING_SIGNED_AUDIT_TOKEN_OP_REQUEST_6";
+        String auditType = AuditEvent.TOKEN_OP_REQUEST;
 
         String auditMessage = CMS.getLogMessage(
                 auditType,
@@ -4100,10 +4101,10 @@ public class TPSProcessor {
         String auditType = "";
         switch (status) {
         case "success":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_FORMAT_SUCCESS_9";
+            auditType = AuditEvent.TOKEN_FORMAT_SUCCESS;
             break;
         default:
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_FORMAT_FAILURE_9";
+            auditType = AuditEvent.TOKEN_FORMAT_FAILURE;
         }
 
         String auditMessage = CMS.getLogMessage(
@@ -4129,10 +4130,10 @@ public class TPSProcessor {
         String auditType = "";
         switch (status) {
         case "success":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_APPLET_UPGRADE_SUCCESS_9";
+            auditType = AuditEvent.TOKEN_APPLET_UPGRADE_SUCCESS;
             break;
         default:
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_APPLET_UPGRADE_FAILURE_9";
+            auditType = AuditEvent.TOKEN_APPLET_UPGRADE_FAILURE;
         }
 
         String auditMessage = CMS.getLogMessage(
@@ -4154,7 +4155,7 @@ public class TPSProcessor {
             String newKeyVersion,
             String info) {
 
-        String auditType = "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_REQUIRED_10";
+        String auditType = AuditEvent.TOKEN_KEY_CHANGEOVER_REQUIRED;
 
         String auditMessage = CMS.getLogMessage(
                 auditType,
@@ -4180,10 +4181,10 @@ public class TPSProcessor {
         String auditType = "";
         switch (status) {
         case "success":
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_SUCCESS_10";
+            auditType = AuditEvent.TOKEN_KEY_CHANGEOVER_SUCCESS;
             break;
         default:
-            auditType = "LOGGING_SIGNED_AUDIT_TOKEN_KEY_CHANGEOVER_FAILURE_10";
+            auditType = AuditEvent.TOKEN_KEY_CHANGEOVER_FAILURE;
         }
 
         String auditMessage = CMS.getLogMessage(
@@ -4212,7 +4213,7 @@ public class TPSProcessor {
             String caConnId,
             String info) {
 
-        String auditType = "LOGGING_SIGNED_AUDIT_TOKEN_CERT_STATUS_CHANGE_REQUEST_10";
+        String auditType = AuditEvent.TOKEN_CERT_STATUS_CHANGE_REQUEST;
         /*
          * requestType is "revoke", "on-hold", or "off-hold"
          */
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java b/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java
index 50453ee3b1bdc7f2dbf01250480c228a90e19e26..6efe4cbb9383c5888817ae573a136536d4656e04 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java
@@ -39,6 +39,7 @@ import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ForbiddenException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorCollection;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorData;
@@ -474,7 +475,7 @@ public class AuthenticatorService extends SubsystemService implements Authentica
             Map<String, String> params, String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_AUTHENTICATOR_6",
+                AuditEvent.CONFIG_TOKEN_AUTHENTICATOR,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java b/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java
index 01bc1323c644283c655157a24ca23308d35c2e8a..3e1e5df2e7373f32ce0e50a5134be07cee592149 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java
@@ -39,6 +39,7 @@ import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ForbiddenException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.connector.ConnectorCollection;
 import com.netscape.certsrv.tps.connector.ConnectorData;
@@ -471,7 +472,7 @@ public class ConnectorService extends SubsystemService implements ConnectorResou
             String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_CONNECTOR_6",
+                AuditEvent.CONFIG_TOKEN_CONNECTOR,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java
index 2c070c086904ef27237e93570fd3f6481baf7103..9bbb616868d5e4ad181af3d6684b08f8c5200cfd 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java
@@ -39,6 +39,7 @@ import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ForbiddenException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.profile.ProfileMappingCollection;
 import com.netscape.certsrv.tps.profile.ProfileMappingData;
@@ -448,7 +449,7 @@ public class ProfileMappingService extends SubsystemService implements ProfileMa
     public void auditMappingResolverChange(String status, String service, String resolverID, Map<String, String> params,
             String info) {
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_MAPPING_RESOLVER_6",
+                AuditEvent.CONFIG_TOKEN_MAPPING_RESOLVER,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java
index 8058caf6a92b256198b05151996744ebd5cc14ae..43e14bea053627ca6aed72569cb3d61c4860c952 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java
@@ -39,6 +39,7 @@ import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ForbiddenException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.common.Constants;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.profile.ProfileCollection;
 import com.netscape.certsrv.tps.profile.ProfileData;
@@ -470,7 +471,7 @@ public class ProfileService extends SubsystemService implements ProfileResource
             String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_PROFILE_6",
+                AuditEvent.CONFIG_TOKEN_PROFILE,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
diff --git a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
index f3d0d80ef03daff73812533e21fd80aeadfc1a0a..73d0a647f973acf50039c615c67378c74623f18d 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
@@ -44,6 +44,7 @@ import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.dbs.EDBException;
 import com.netscape.certsrv.dbs.IDBVirtualList;
 import com.netscape.certsrv.ldap.LDAPExceptionConverter;
+import com.netscape.certsrv.logging.AuditEvent;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.token.TokenCollection;
 import com.netscape.certsrv.tps.token.TokenData;
@@ -814,7 +815,7 @@ public class TokenService extends SubsystemService implements TokenResource {
             String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_RECORD_6",
+                AuditEvent.CONFIG_TOKEN_RECORD,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 service,
@@ -832,7 +833,7 @@ public class TokenService extends SubsystemService implements TokenResource {
             String newReason, Map<String, String> params, String info) {
 
         String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_TOKEN_STATE_CHANGE_8",
+                AuditEvent.TOKEN_STATE_CHANGE,
                 servletRequest.getUserPrincipal().getName(),
                 status,
                 oldState.toString(),
-- 
2.9.3

