>From 18a56c60c2ff3f897b03904fefeee3ea941f0cdf Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Mon, 30 Jan 2017 22:32:15 +0100
Subject: [PATCH] Refactored PKIService class.

The subsystem-based methods and fields in PKIService class have
been moved into a new SubsystemService class to allow creating
more generic non-subsystem-based services.

The classes that use these methods and fields have been updated
accordingly.
---
 .../dogtagpki/server/ca/rest/AuthorityService.java |   4 +-
 .../dogtagpki/server/ca/rest/ProfileService.java   |   6 +-
 .../server/kra/rest/KeyRequestService.java         |   4 +-
 .../org/dogtagpki/server/kra/rest/KeyService.java  |   4 +-
 .../com/netscape/cms/servlet/base/PKIService.java  |  86 -----------------
 .../cms/servlet/base/SubsystemService.java         | 105 +++++++++++++++++++++
 .../org/dogtagpki/server/rest/AuditService.java    |   4 +-
 .../org/dogtagpki/server/rest/GroupService.java    |   4 +-
 .../src/org/dogtagpki/server/rest/UserService.java |   4 +-
 .../dogtagpki/server/tps/config/ConfigService.java |   4 +-
 .../server/tps/rest/AuthenticatorService.java      |   4 +-
 .../server/tps/rest/ConnectorService.java          |   4 +-
 .../server/tps/rest/ProfileMappingService.java     |   4 +-
 .../dogtagpki/server/tps/rest/ProfileService.java  |   4 +-
 .../dogtagpki/server/tps/rest/TokenService.java    |   4 +-
 15 files changed, 132 insertions(+), 113 deletions(-)
 create mode 100644 base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java

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 18542d3794f2f1ba3975c634ee726f6d94ebba5b..c734fbf4645aabf2b068b56ead3a0d0a04e8d639 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/AuthorityService.java
@@ -61,13 +61,13 @@ import com.netscape.certsrv.ca.IssuerUnavailableException;
 import com.netscape.certsrv.common.OpDef;
 import com.netscape.certsrv.common.ScopeDef;
 import com.netscape.certsrv.logging.ILogger;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cmsutil.util.Utils;
 
 /**
  * @author ftweedal
  */
-public class AuthorityService extends PKIService implements AuthorityResource {
+public class AuthorityService extends SubsystemService implements AuthorityResource {
 
     ICertificateAuthority hostCA;
 
diff --git a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
index 41d009b9d38003f054f45c2dd8070de8f46065f3..ba648a463b8f3af0de9221daa461b9376d99d5b2 100644
--- a/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
+++ b/base/ca/src/org/dogtagpki/server/ca/rest/ProfileService.java
@@ -78,17 +78,17 @@ import com.netscape.certsrv.profile.ProfileResource;
 import com.netscape.certsrv.property.EPropertyException;
 import com.netscape.certsrv.registry.IPluginInfo;
 import com.netscape.certsrv.registry.IPluginRegistry;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cms.servlet.profile.PolicyConstraintFactory;
 import com.netscape.cms.servlet.profile.PolicyDefaultFactory;
-import com.netscape.cmscore.base.SimpleProperties;
 import com.netscape.cmscore.base.PropConfigStore;
+import com.netscape.cmscore.base.SimpleProperties;
 
 /**
  * @author alee
  *
  */
-public class ProfileService extends PKIService implements ProfileResource {
+public class ProfileService extends SubsystemService implements ProfileResource {
 
     @Context
     private UriInfo uriInfo;
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 f6918509a0107b6f917e66538c49a4e30c23c978..4138b38963e4abb53b218a3ec6744543de630699 100644
--- a/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java
+++ b/base/kra/src/org/dogtagpki/server/kra/rest/KeyRequestService.java
@@ -57,7 +57,7 @@ import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestNotFoundException;
 import com.netscape.cms.realm.PKIPrincipal;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cms.servlet.key.KeyRequestDAO;
 import com.netscape.cmsutil.ldap.LDAPUtil;
 
@@ -65,7 +65,7 @@ import com.netscape.cmsutil.ldap.LDAPUtil;
  * @author alee
  *
  */
-public class KeyRequestService extends PKIService implements KeyRequestResource {
+public class KeyRequestService extends SubsystemService implements KeyRequestResource {
 
     @Context
     private UriInfo uriInfo;
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 d2c24c888c3a8835fe69cb087c6986887bf1ef41..a8b895fecac9e2281d7afa775b49c5a11f888b29 100644
--- a/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java
+++ b/base/kra/src/org/dogtagpki/server/kra/rest/KeyService.java
@@ -71,7 +71,7 @@ import com.netscape.certsrv.request.IRequestQueue;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestStatus;
 import com.netscape.cms.realm.PKIPrincipal;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cms.servlet.key.KeyRequestDAO;
 import com.netscape.cmsutil.ldap.LDAPUtil;
 import com.netscape.cmsutil.util.Utils;
@@ -80,7 +80,7 @@ import com.netscape.cmsutil.util.Utils;
  * @author alee
  *
  */
-public class KeyService extends PKIService implements KeyResource {
+public class KeyService extends SubsystemService implements KeyResource {
 
     @Context
     private UriInfo uriInfo;
diff --git a/base/server/cms/src/com/netscape/cms/servlet/base/PKIService.java b/base/server/cms/src/com/netscape/cms/servlet/base/PKIService.java
index d8d9cee5d58c48484ed10a66e21b861cfb91af98..3ed4b91b7b42e077e2581e2bb362422c6107ff4a 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/base/PKIService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/base/PKIService.java
@@ -17,17 +17,13 @@
 // --- END COPYRIGHT BLOCK ---
 package com.netscape.cms.servlet.base;
 
-import java.io.File;
 import java.lang.reflect.Method;
 import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.ResourceBundle;
 
 import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
@@ -42,11 +38,7 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.ResponseBuilder;
 import javax.ws.rs.core.UriInfo;
 
-import com.netscape.certsrv.apps.CMS;
-import com.netscape.certsrv.authorization.IAuthzSubsystem;
 import com.netscape.certsrv.base.PKIException;
-import com.netscape.certsrv.logging.IAuditor;
-import com.netscape.certsrv.logging.ILogger;
 
 /**
  * Base class for CMS RESTful resources
@@ -86,45 +78,10 @@ public class PKIService {
     @Context
     protected ServletContext servletContext;
 
-    protected IAuthzSubsystem authz = (IAuthzSubsystem) CMS.getSubsystem(CMS.SUBSYSTEM_AUTHZ);
-
-    public ILogger logger = CMS.getLogger();
-    public IAuditor auditor = CMS.getAuditor();
-
     public String getInstanceDir() {
         return System.getProperty("catalina.base");
     }
 
-    public String getSubsystemName() {
-        // get web application path: /<subsystem>
-        String path = servletContext.getContextPath();
-
-        // get subsystem name by removing the / prefix from the path
-        return path.startsWith("/") ? path.substring(1) : path;
-    }
-
-    public String getSubsystemConfDir() {
-        return getInstanceDir() + File.separator + getSubsystemName() + File.separator + "conf";
-    }
-
-    public String getSharedSubsystemConfDir() {
-        return File.separator + "usr" + File.separator + "share" + File.separator + "pki" +
-                File.separator + getSubsystemName() + File.separator + "conf";
-    }
-
-    public ResourceBundle getResourceBundle(String name) throws Exception {
-
-        // Look in <instance>/<subsystem>/conf first,
-        // then fallback to /usr/share/pki/<subsystem>/conf.
-        URL[] urls = {
-                new File(getSubsystemConfDir()).toURI().toURL(),
-                new File(getSharedSubsystemConfDir()).toURI().toURL()
-        };
-
-        ClassLoader loader = new URLClassLoader(urls);
-        return ResourceBundle.getBundle(name, servletRequest.getLocale(), loader);
-    }
-
     public static MediaType resolveFormat(MediaType format) {
 
         if (format == null) return null;
@@ -234,49 +191,6 @@ public class PKIService {
         return locales.get(0);
     }
 
-    public String getUserMessage(String messageId, HttpHeaders headers, String... params) {
-        return CMS.getUserMessage(getLocale(headers), messageId, params);
-    }
-
-    public void log(int source, int level, String message) {
-
-        if (logger == null) return;
-
-        logger.log(ILogger.EV_SYSTEM,
-                null,
-                source,
-                level,
-                getClass().getSimpleName() + ": " + message);
-    }
-
-    public void audit(String message, String scope, String type, String id, Map<String, String> params, String status) {
-
-        if (auditor == null) return;
-
-        String auditMessage = CMS.getLogMessage(
-                message,
-                auditor.getSubjectID(),
-                status,
-                auditor.getParamString(scope, type, id, params));
-
-        auditor.log(auditMessage);
-    }
-
-    public void auditConfigTokenGeneral(String status, String service, Map<String, String> params, String info) {
-        CMS.debug("PKIService.auditConfigTokenGeneral begins");
-
-        String msg = CMS.getLogMessage(
-                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_GENERAL_5",
-                servletRequest.getUserPrincipal().getName(),
-                status,
-                service,
-                auditor.getParamString(null, params),
-                info);
-        auditor.log(msg);
-
-        CMS.debug("PKIService.auditConfigTokenGeneral ends");
-    }
-
     /**
      * Get the values of the fields annotated with @FormParam.
      */
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
new file mode 100644
index 0000000000000000000000000000000000000000..48c985c7615001be51e12ac2f0b46821b84872eb
--- /dev/null
+++ b/base/server/cms/src/com/netscape/cms/servlet/base/SubsystemService.java
@@ -0,0 +1,105 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2017 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+
+package com.netscape.cms.servlet.base;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import javax.ws.rs.core.HttpHeaders;
+
+import com.netscape.certsrv.apps.CMS;
+import com.netscape.certsrv.authorization.IAuthzSubsystem;
+import com.netscape.certsrv.logging.IAuditor;
+import com.netscape.certsrv.logging.ILogger;
+
+public class SubsystemService extends PKIService {
+
+    protected IAuthzSubsystem authz = (IAuthzSubsystem) CMS.getSubsystem(CMS.SUBSYSTEM_AUTHZ);
+    protected IAuditor auditor = CMS.getAuditor();
+    protected ILogger logger = CMS.getLogger();
+
+    public String getSubsystemName() {
+        // get web application path: /<subsystem>
+        String path = servletContext.getContextPath();
+
+        // get subsystem name by removing the / prefix from the path
+        return path.startsWith("/") ? path.substring(1) : path;
+    }
+
+    public String getSubsystemConfDir() {
+        return getInstanceDir() + File.separator + getSubsystemName() + File.separator + "conf";
+    }
+
+    public String getSharedSubsystemConfDir() {
+        return File.separator + "usr" + File.separator + "share" + File.separator + "pki" +
+                File.separator + getSubsystemName() + File.separator + "conf";
+    }
+
+    public ResourceBundle getResourceBundle(String name) throws Exception {
+
+        // Look in <instance>/<subsystem>/conf first,
+        // then fallback to /usr/share/pki/<subsystem>/conf.
+        URL[] urls = {
+                new File(getSubsystemConfDir()).toURI().toURL(),
+                new File(getSharedSubsystemConfDir()).toURI().toURL()
+        };
+
+        ClassLoader loader = new URLClassLoader(urls);
+        return ResourceBundle.getBundle(name, servletRequest.getLocale(), loader);
+    }
+
+    public String getUserMessage(String messageId, HttpHeaders headers, String... params) {
+        return CMS.getUserMessage(getLocale(headers), messageId, params);
+    }
+
+    public void log(int source, int level, String message) {
+
+        logger.log(ILogger.EV_SYSTEM,
+                null,
+                source,
+                level,
+                getClass().getSimpleName() + ": " + message);
+    }
+
+    public void audit(String message, String scope, String type, String id, Map<String, String> params, String status) {
+
+        String auditMessage = CMS.getLogMessage(
+                message,
+                auditor.getSubjectID(),
+                status,
+                auditor.getParamString(scope, type, id, params));
+
+        auditor.log(auditMessage);
+    }
+
+    public void auditConfigTokenGeneral(String status, String service, Map<String, String> params, String info) {
+
+        String msg = CMS.getLogMessage(
+                "LOGGING_SIGNED_AUDIT_CONFIG_TOKEN_GENERAL_5",
+                servletRequest.getUserPrincipal().getName(),
+                status,
+                service,
+                auditor.getParamString(null, params),
+                info);
+        auditor.log(msg);
+    }
+}
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/AuditService.java b/base/server/cms/src/org/dogtagpki/server/rest/AuditService.java
index 273625e81776ab8a8cd024f503f5e45ade94612a..76a5396c2650dc3a3fca445b02e09155471e8752 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/AuditService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/AuditService.java
@@ -44,12 +44,12 @@ import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.logging.AuditConfig;
 import com.netscape.certsrv.logging.AuditResource;
 import com.netscape.certsrv.logging.ILogger;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class AuditService extends PKIService implements AuditResource {
+public class AuditService extends SubsystemService implements AuditResource {
 
     @Context
     private UriInfo uriInfo;
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/GroupService.java b/base/server/cms/src/org/dogtagpki/server/rest/GroupService.java
index 991a8b155813c1cf5ca4ee27c448b77c9e5c150e..9d127c8db2287cc2b412e6b5b00b25b402628e43 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/GroupService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/GroupService.java
@@ -51,12 +51,12 @@ import com.netscape.certsrv.usrgrp.IGroup;
 import com.netscape.certsrv.usrgrp.IGroupConstants;
 import com.netscape.certsrv.usrgrp.IUGSubsystem;
 import com.netscape.cms.servlet.admin.GroupMemberProcessor;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class GroupService extends PKIService implements GroupResource {
+public class GroupService extends SubsystemService implements GroupResource {
 
     @Context
     private UriInfo uriInfo;
diff --git a/base/server/cms/src/org/dogtagpki/server/rest/UserService.java b/base/server/cms/src/org/dogtagpki/server/rest/UserService.java
index 1f8e9fa3143866bf018df78f43f7611741c5d8fc..529c472194f14fb2d7ddc33eab1eb57315901844 100644
--- a/base/server/cms/src/org/dogtagpki/server/rest/UserService.java
+++ b/base/server/cms/src/org/dogtagpki/server/rest/UserService.java
@@ -72,7 +72,7 @@ import com.netscape.certsrv.usrgrp.IGroup;
 import com.netscape.certsrv.usrgrp.IUGSubsystem;
 import com.netscape.certsrv.usrgrp.IUser;
 import com.netscape.cms.servlet.admin.GroupMemberProcessor;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 import com.netscape.cmsutil.util.Cert;
 import com.netscape.cmsutil.util.Utils;
 
@@ -82,7 +82,7 @@ import netscape.security.x509.X509CertImpl;
 /**
  * @author Endi S. Dewata
  */
-public class UserService extends PKIService implements UserResource {
+public class UserService extends SubsystemService implements UserResource {
 
     @Context
     private UriInfo uriInfo;
diff --git a/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java b/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java
index 9e1caaa86bea83d1f57a1c9150dcfae0898b6d38..8309a2f322186e70b5fabeca72c7937e3d5668db 100644
--- a/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/config/ConfigService.java
@@ -38,12 +38,12 @@ import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.config.ConfigData;
 import com.netscape.certsrv.tps.config.ConfigResource;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class ConfigService extends PKIService implements ConfigResource {
+public class ConfigService extends SubsystemService implements ConfigResource {
 
     @Context
     private UriInfo uriInfo;
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 65c1593449e590c60a408bd90515a43dad47b772..424cd1490f04e96ef61c811a5e925c6a36612f20 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/AuthenticatorService.java
@@ -48,12 +48,12 @@ import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorCollection;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorData;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorResource;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class AuthenticatorService extends PKIService implements AuthenticatorResource {
+public class AuthenticatorService extends SubsystemService implements AuthenticatorResource {
 
     @Context
     private UriInfo uriInfo;
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 769f00f5704a1e9189b97990fe9e7aecfe96fe19..c789f14721afe3ac2dd99b314bb6ecc03309f743 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ConnectorService.java
@@ -48,12 +48,12 @@ import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.connector.ConnectorCollection;
 import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.certsrv.tps.connector.ConnectorResource;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class ConnectorService extends PKIService implements ConnectorResource {
+public class ConnectorService extends SubsystemService implements ConnectorResource {
 
     @Context
     private UriInfo uriInfo;
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 84c171f57e6e0126928730daadc898c26369f561..eca180358e38dbfdad706cdcfe4fe2fb683b67b2 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileMappingService.java
@@ -48,12 +48,12 @@ import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.profile.ProfileMappingCollection;
 import com.netscape.certsrv.tps.profile.ProfileMappingData;
 import com.netscape.certsrv.tps.profile.ProfileMappingResource;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class ProfileMappingService extends PKIService implements ProfileMappingResource {
+public class ProfileMappingService extends SubsystemService implements ProfileMappingResource {
 
     @Context
     private UriInfo uriInfo;
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 bbcbfae32157d20bc6d0d21d2c1a725172c66aad..b7691343e8c0767adf7a1d3af6ee7c5cd9178078 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/ProfileService.java
@@ -48,12 +48,12 @@ import com.netscape.certsrv.logging.ILogger;
 import com.netscape.certsrv.tps.profile.ProfileCollection;
 import com.netscape.certsrv.tps.profile.ProfileData;
 import com.netscape.certsrv.tps.profile.ProfileResource;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 /**
  * @author Endi S. Dewata
  */
-public class ProfileService extends PKIService implements ProfileResource {
+public class ProfileService extends SubsystemService implements ProfileResource {
 
     @Context
     private UriInfo uriInfo;
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 920c5026bf044c206d43398d41ece7ab9967856b..a624e2aeb9611a782ba830073c41f1dc4a20d161 100644
--- a/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
+++ b/base/tps/src/org/dogtagpki/server/tps/rest/TokenService.java
@@ -55,14 +55,14 @@ import com.netscape.certsrv.tps.token.TokenData;
 import com.netscape.certsrv.tps.token.TokenData.TokenStatusData;
 import com.netscape.certsrv.tps.token.TokenResource;
 import com.netscape.certsrv.tps.token.TokenStatus;
-import com.netscape.cms.servlet.base.PKIService;
+import com.netscape.cms.servlet.base.SubsystemService;
 
 import netscape.ldap.LDAPException;
 
 /**
  * @author Endi S. Dewata
  */
-public class TokenService extends PKIService implements TokenResource {
+public class TokenService extends SubsystemService implements TokenResource {
 
     @Context
     private UriInfo uriInfo;
-- 
2.5.5

