From 6e6e54fde33a79168148d09742a3eb1ee599c48c Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Sat, 11 Aug 2012 04:53:30 -0500
Subject: [PATCH] Cleaned up REST client class names.

The REST client classes have been renamed for better clarity
and consistency.

Ticket #259
---
 .../test/{CARestClient.java => CAClient.java}      |  6 +-
 .../src/com/netscape/cms/servlet/test/CATest.java  | 10 ++--
 .../cms/servlet/test/ConfigurationTest.java        |  6 +-
 .../src/com/netscape/cms/client/cert/CertCLI.java  |  4 +-
 .../cert/{CertRestClient.java => CertClient.java}  |  6 +-
 .../com/netscape/cms/client/group/GroupCLI.java    |  4 +-
 .../{GroupRestClient.java => GroupClient.java}     |  6 +-
 .../src/com/netscape/cms/client/user/UserCLI.java  |  4 +-
 .../user/{UserRestClient.java => UserClient.java}  |  6 +-
 .../csadmin/ConfigurationErrorInterceptor.java     | 65 ----------------------
 .../cms/servlet/csadmin/ConfigurationUtils.java    |  2 +-
 .../csadmin/{CMSRestClient.java => PKIClient.java} |  6 +-
 ...orInterceptor.java => PKIErrorInterceptor.java} |  2 +-
 ...tionRESTClient.java => SystemConfigClient.java} |  4 +-
 base/deploy/src/scriptlets/pkijython.py            |  4 +-
 .../test/{DRMRestClient.java => DRMClient.java}    |  6 +-
 .../src/com/netscape/cms/servlet/test/DRMTest.java |  4 +-
 17 files changed, 40 insertions(+), 105 deletions(-)
 rename base/ca/functional/src/com/netscape/cms/servlet/test/{CARestClient.java => CAClient.java} (96%)
 rename base/common/src/com/netscape/cms/client/cert/{CertRestClient.java => CertClient.java} (94%)
 rename base/common/src/com/netscape/cms/client/group/{GroupRestClient.java => GroupClient.java} (94%)
 rename base/common/src/com/netscape/cms/client/user/{UserRestClient.java => UserClient.java} (94%)
 delete mode 100644 base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationErrorInterceptor.java
 rename base/common/src/com/netscape/cms/servlet/csadmin/{CMSRestClient.java => PKIClient.java} (98%)
 rename base/common/src/com/netscape/cms/servlet/csadmin/{CMSErrorInterceptor.java => PKIErrorInterceptor.java} (97%)
 rename base/common/src/com/netscape/cms/servlet/csadmin/{ConfigurationRESTClient.java => SystemConfigClient.java} (91%)
 rename base/kra/functional/src/com/netscape/cms/servlet/test/{DRMRestClient.java => DRMClient.java} (96%)

diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java
similarity index 96%
rename from base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java
rename to base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java
index 24ce212775b235b8079d7c7339d305e52051c82a..cc6aa19d5c8076b4d194680d5a29827792a57c9e 100644
--- a/base/ca/functional/src/com/netscape/cms/servlet/test/CARestClient.java
+++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CAClient.java
@@ -27,7 +27,7 @@ import com.netscape.cms.servlet.cert.CertResource;
 import com.netscape.cms.servlet.cert.model.CertDataInfos;
 import com.netscape.cms.servlet.cert.model.CertSearchData;
 import com.netscape.cms.servlet.cert.model.CertificateData;
-import com.netscape.cms.servlet.csadmin.CMSRestClient;
+import com.netscape.cms.servlet.csadmin.PKIClient;
 import com.netscape.cms.servlet.profile.ProfileResource;
 import com.netscape.cms.servlet.profile.model.ProfileData;
 import com.netscape.cms.servlet.profile.model.ProfileDataInfos;
@@ -37,13 +37,13 @@ import com.netscape.cms.servlet.request.model.CertRequestInfo;
 import com.netscape.cms.servlet.request.model.CertRequestInfos;
 import com.netscape.cms.servlet.request.model.EnrollmentRequestData;
 
-public class CARestClient extends CMSRestClient {
+public class CAClient extends PKIClient {
 
     private CertResource certClient;
     private CertRequestResource certRequestClient;
     private ProfileResource profileClient;
 
-    public CARestClient(ClientConfig config) throws URISyntaxException {
+    public CAClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         certRequestClient = createProxy(CertRequestResource.class);
diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
index 8fa4b9bb4fb9c3762e63f6500bbe1f24d433a8fb..185f01f2459c67daffa90fee7f0d7d69fb124891 100644
--- a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
+++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
@@ -148,13 +148,13 @@ public class CATest {
             log("Exception in logging into token:" + e.toString());
         }
 
-        CARestClient client;
+        CAClient client;
         try {
             ClientConfig config = new ClientConfig();
             config.setServerURI(protocol + "://" + host + ":" + port + "/ca");
             config.setCertNickname(clientCertNickname);
 
-            client = new CARestClient(config);
+            client = new CAClient(config);
         } catch (Exception e) {
             e.printStackTrace();
             return;
@@ -275,7 +275,7 @@ public class CATest {
 
     }
 
-    private static void enrollAndApproveCertRequest(CARestClient client, EnrollmentRequestData data) {
+    private static void enrollAndApproveCertRequest(CAClient client, EnrollmentRequestData data) {
         CertRequestInfos reqInfo = null;
         try {
             reqInfo = client.enrollCertificate(data);
@@ -295,7 +295,7 @@ public class CATest {
         }
     }
 
-    private static void enrollCertRequest(CARestClient client, EnrollmentRequestData data) {
+    private static void enrollCertRequest(CAClient client, EnrollmentRequestData data) {
         CertRequestInfos reqInfo = null;
         try {
             reqInfo = client.enrollCertificate(data);
@@ -560,7 +560,7 @@ public class CATest {
 
     private static void usage(Options options) {
         HelpFormatter formatter = new HelpFormatter();
-        formatter.printHelp("CARestClient Test:", options);
+        formatter.printHelp("CAClient Test:", options);
         System.exit(1);
     }
 
diff --git a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
index 67b67fca0604ea40cc2a06bad5174f354eab50b2..dfa79c650ee07459440d8e099a84592125f269f1 100644
--- a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
+++ b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
@@ -57,7 +57,7 @@ import org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo;
 import org.mozilla.jss.util.Password;
 
 import com.netscape.cms.client.cli.ClientConfig;
-import com.netscape.cms.servlet.csadmin.ConfigurationRESTClient;
+import com.netscape.cms.servlet.csadmin.SystemConfigClient;
 import com.netscape.cms.servlet.csadmin.model.CertData;
 import com.netscape.cms.servlet.csadmin.model.ConfigurationData;
 import com.netscape.cms.servlet.csadmin.model.ConfigurationResponseData;
@@ -184,12 +184,12 @@ public class ConfigurationTest {
             System.out.println("Exception in logging into token:" + e.toString());
         }
 
-        ConfigurationRESTClient client = null;
+        SystemConfigClient client = null;
         try {
             ClientConfig config = new ClientConfig();
             config.setServerURI(protocol + "://" + host + ":" + port + "/" + cstype);
 
-            client = new ConfigurationRESTClient(config);
+            client = new SystemConfigClient(config);
         } catch (URISyntaxException e1) {
             e1.printStackTrace();
             System.exit(1);
diff --git a/base/common/src/com/netscape/cms/client/cert/CertCLI.java b/base/common/src/com/netscape/cms/client/cert/CertCLI.java
index 70ad9021e75223fcfd7cccbb36b2ecb7f539c15c..2f7ab668e4d3412774f4a05d185a8c0bd4d034ad 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertCLI.java
+++ b/base/common/src/com/netscape/cms/client/cert/CertCLI.java
@@ -35,7 +35,7 @@ import com.netscape.cms.servlet.request.model.CertRequestInfo;
 public class CertCLI extends CLI {
 
     public MainCLI parent;
-    public CertRestClient client;
+    public CertClient client;
 
     public CertCLI(MainCLI parent) {
         super("cert", "Certificate management commands");
@@ -75,7 +75,7 @@ public class CertCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
-        client = new CertRestClient(parent.config);
+        client = new CertClient(parent.config);
         client.setVerbose(verbose);
 
         if (args.length == 0) {
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRestClient.java b/base/common/src/com/netscape/cms/client/cert/CertClient.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/cert/CertRestClient.java
rename to base/common/src/com/netscape/cms/client/cert/CertClient.java
index 7c8b9f3e42ba0d40d5261eaaf480ea93c3f8f09f..b8fdde703ea0e861af586f2db45ba2054b0dd715 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertRestClient.java
+++ b/base/common/src/com/netscape/cms/client/cert/CertClient.java
@@ -28,7 +28,7 @@ import com.netscape.cms.servlet.cert.model.CertRevokeRequest;
 import com.netscape.cms.servlet.cert.model.CertSearchData;
 import com.netscape.cms.servlet.cert.model.CertUnrevokeRequest;
 import com.netscape.cms.servlet.cert.model.CertificateData;
-import com.netscape.cms.servlet.csadmin.CMSRestClient;
+import com.netscape.cms.servlet.csadmin.PKIClient;
 import com.netscape.cms.servlet.request.CertRequestResource;
 import com.netscape.cms.servlet.request.model.AgentEnrollmentRequestData;
 import com.netscape.cms.servlet.request.model.CertRequestInfo;
@@ -38,12 +38,12 @@ import com.netscape.cms.servlet.request.model.EnrollmentRequestData;
 /**
  * @author Endi S. Dewata
  */
-public class CertRestClient extends CMSRestClient {
+public class CertClient extends PKIClient {
 
     public CertResource certClient;
     public CertRequestResource certRequestResource;
 
-    public CertRestClient(ClientConfig config) throws URISyntaxException {
+    public CertClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         certClient = createProxy(CertResource.class);
diff --git a/base/common/src/com/netscape/cms/client/group/GroupCLI.java b/base/common/src/com/netscape/cms/client/group/GroupCLI.java
index fefc1b0c99fa139060fbedc852818586eac8b5c4..b106c6fc114c4cebcb5e62e9b765f309a3de7208 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupCLI.java
+++ b/base/common/src/com/netscape/cms/client/group/GroupCLI.java
@@ -34,7 +34,7 @@ import com.netscape.cms.client.cli.MainCLI;
 public class GroupCLI extends CLI {
 
     public MainCLI parent;
-    public GroupRestClient client;
+    public GroupClient client;
 
     public GroupCLI(MainCLI parent) {
         super("group", "Group management commands");
@@ -74,7 +74,7 @@ public class GroupCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
-        client = new GroupRestClient(parent.config);
+        client = new GroupClient(parent.config);
         client.setVerbose(verbose);
 
         if (args.length == 0) {
diff --git a/base/common/src/com/netscape/cms/client/group/GroupRestClient.java b/base/common/src/com/netscape/cms/client/group/GroupClient.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/group/GroupRestClient.java
rename to base/common/src/com/netscape/cms/client/group/GroupClient.java
index 1b98035ea77d69a1de54e3b5337875e95fc37f56..410c1ad3db7bebdab937a89613b0e2cd74097d86 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupRestClient.java
+++ b/base/common/src/com/netscape/cms/client/group/GroupClient.java
@@ -28,17 +28,17 @@ import com.netscape.certsrv.group.GroupMemberData;
 import com.netscape.certsrv.group.GroupMemberResource;
 import com.netscape.certsrv.group.GroupResource;
 import com.netscape.cms.client.cli.ClientConfig;
-import com.netscape.cms.servlet.csadmin.CMSRestClient;
+import com.netscape.cms.servlet.csadmin.PKIClient;
 
 /**
  * @author Endi S. Dewata
  */
-public class GroupRestClient extends CMSRestClient {
+public class GroupClient extends PKIClient {
 
     public GroupResource groupClient;
     public GroupMemberResource groupMemberClient;
 
-    public GroupRestClient(ClientConfig config) throws URISyntaxException {
+    public GroupClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         groupClient = createProxy(GroupResource.class);
diff --git a/base/common/src/com/netscape/cms/client/user/UserCLI.java b/base/common/src/com/netscape/cms/client/user/UserCLI.java
index a5104135bba85493b22d0bc9321206ea20ffbafa..cc9bc8aa539efca07d25bedec700cff485c5f598 100644
--- a/base/common/src/com/netscape/cms/client/user/UserCLI.java
+++ b/base/common/src/com/netscape/cms/client/user/UserCLI.java
@@ -34,7 +34,7 @@ import com.netscape.cms.client.cli.MainCLI;
 public class UserCLI extends CLI {
 
     public MainCLI parent;
-    public UserRestClient client;
+    public UserClient client;
 
     public UserCLI(MainCLI parent) {
         super("user", "User management commands");
@@ -75,7 +75,7 @@ public class UserCLI extends CLI {
 
     public void execute(String[] args) throws Exception {
 
-        client = new UserRestClient(parent.config);
+        client = new UserClient(parent.config);
         client.setVerbose(verbose);
 
         if (args.length == 0) {
diff --git a/base/common/src/com/netscape/cms/client/user/UserRestClient.java b/base/common/src/com/netscape/cms/client/user/UserClient.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/user/UserRestClient.java
rename to base/common/src/com/netscape/cms/client/user/UserClient.java
index 54c1e3fa138af5c69cdc1e6c38b36a2b0562dee3..ea2991ac85da519e7606c4d974c0370c5e255d65 100644
--- a/base/common/src/com/netscape/cms/client/user/UserRestClient.java
+++ b/base/common/src/com/netscape/cms/client/user/UserClient.java
@@ -28,17 +28,17 @@ import com.netscape.certsrv.user.UserCollection;
 import com.netscape.certsrv.user.UserData;
 import com.netscape.certsrv.user.UserResource;
 import com.netscape.cms.client.cli.ClientConfig;
-import com.netscape.cms.servlet.csadmin.CMSRestClient;
+import com.netscape.cms.servlet.csadmin.PKIClient;
 
 /**
  * @author Endi S. Dewata
  */
-public class UserRestClient extends CMSRestClient {
+public class UserClient extends PKIClient {
 
     public UserResource userClient;
     public UserCertResource userCertClient;
 
-    public UserRestClient(ClientConfig config) throws URISyntaxException {
+    public UserClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         userClient = createProxy(UserResource.class);
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationErrorInterceptor.java b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationErrorInterceptor.java
deleted file mode 100644
index 63af4101a07427ab4a5aa4ebfb61fd04451068a4..0000000000000000000000000000000000000000
--- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationErrorInterceptor.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// --- 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) 2012 Red Hat, Inc.
-// All rights reserved.
-// --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.servlet.csadmin;
-
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-
-import org.jboss.resteasy.client.ClientResponse;
-import org.jboss.resteasy.client.core.ClientErrorInterceptor;
-
-import com.netscape.cms.servlet.base.CMSException;
-
-/**
- * @author alee
- *
- */
-public class ConfigurationErrorInterceptor implements ClientErrorInterceptor {
-
-    public void handle(ClientResponse<?> response) {
-
-        // handle HTTP code 4xx and 5xx
-        int code = response.getResponseStatus().getStatusCode();
-        if (code < 400) return;
-
-        MultivaluedMap<String, String> headers = response.getHeaders();
-        String contentType = headers.getFirst("Content-Type");
-
-        // handle XML content only
-        System.out.println("Content-type: "+contentType);
-        if (!contentType.startsWith(MediaType.APPLICATION_XML)) return;
-
-        CMSException exception;
-
-        try {
-            // Requires RESTEasy 2.3.2
-            // https://issues.jboss.org/browse/RESTEASY-652
-            CMSException.Data data = response.getEntity(CMSException.Data.class);
-
-            Class<?> clazz = Class.forName(data.className);
-            exception = (CMSException) clazz.getConstructor(CMSException.Data.class).newInstance(data);
-
-        } catch (Exception e) {
-            e.printStackTrace();
-            return;
-        }
-
-        throw exception;
-    }
-
-}
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index 50c7853df5d753159ddd56a266a112e9beb85251..be66f5cf7f7fde7ea6c13cfc14bd97457f199c8b 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -299,7 +299,7 @@ public class ConfigurationUtils {
         ClientConfig config = new ClientConfig();
         config.setServerURI("https://" + sdhost + ":" + sdport + "/ca");
 
-        ConfigurationRESTClient client = new ConfigurationRESTClient(config);
+        SystemConfigClient client = new SystemConfigClient(config);
 
         InstallToken token = client.getInstallToken(data);
 
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/CMSRestClient.java b/base/common/src/com/netscape/cms/servlet/csadmin/PKIClient.java
similarity index 98%
rename from base/common/src/com/netscape/cms/servlet/csadmin/CMSRestClient.java
rename to base/common/src/com/netscape/cms/servlet/csadmin/PKIClient.java
index 9d7f2f9ac075b5ec10b1f1fb0e62c4c905014cb0..647056bd141b3e0961bcc81fa05ce2ebbadc9bc4 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/CMSRestClient.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/PKIClient.java
@@ -52,7 +52,7 @@ import org.mozilla.jss.ssl.SSLSocket;
 
 import com.netscape.cms.client.cli.ClientConfig;
 
-public abstract class CMSRestClient {
+public abstract class PKIClient {
 
     protected boolean verbose;
 
@@ -62,7 +62,7 @@ public abstract class CMSRestClient {
     protected ClientErrorHandler errorHandler;
     protected ClientExecutor executor;
 
-    public CMSRestClient(ClientConfig config) {
+    public PKIClient(ClientConfig config) {
         this.config = config;
 
         DefaultHttpClient httpClient = new DefaultHttpClient();
@@ -147,7 +147,7 @@ public abstract class CMSRestClient {
 
         executor = new ApacheHttpClient4Executor(httpClient);
         providerFactory = ResteasyProviderFactory.getInstance();
-        providerFactory.addClientErrorInterceptor(new CMSErrorInterceptor());
+        providerFactory.addClientErrorInterceptor(new PKIErrorInterceptor());
         errorHandler = new ClientErrorHandler(providerFactory.getClientErrorInterceptors());
     }
 
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/CMSErrorInterceptor.java b/base/common/src/com/netscape/cms/servlet/csadmin/PKIErrorInterceptor.java
similarity index 97%
rename from base/common/src/com/netscape/cms/servlet/csadmin/CMSErrorInterceptor.java
rename to base/common/src/com/netscape/cms/servlet/csadmin/PKIErrorInterceptor.java
index 8704223910797ec6055f02292872994a41bcfa25..166c02eb949610b373fe6ded294474eca2054e1b 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/CMSErrorInterceptor.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/PKIErrorInterceptor.java
@@ -25,7 +25,7 @@ import org.jboss.resteasy.client.core.ClientErrorInterceptor;
 
 import com.netscape.cms.servlet.base.CMSException;
 
-public class CMSErrorInterceptor implements ClientErrorInterceptor {
+public class PKIErrorInterceptor implements ClientErrorInterceptor {
 
     public void handle(ClientResponse<?> response) {
 
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationRESTClient.java b/base/common/src/com/netscape/cms/servlet/csadmin/SystemConfigClient.java
similarity index 91%
rename from base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationRESTClient.java
rename to base/common/src/com/netscape/cms/servlet/csadmin/SystemConfigClient.java
index 7fe8af2f334caeeb63b04a26690194261d9d1e54..6167b0521678dfb56fa00577d21218e3c5c8453d 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationRESTClient.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/SystemConfigClient.java
@@ -30,11 +30,11 @@ import com.netscape.cms.servlet.csadmin.model.InstallTokenRequest;
  * @author alee
  *
  */
-public class ConfigurationRESTClient extends CMSRestClient {
+public class SystemConfigClient extends PKIClient {
 
     private SystemConfigurationResource configClient;
 
-    public ConfigurationRESTClient(ClientConfig config) throws URISyntaxException {
+    public SystemConfigClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         configClient = createProxy(SystemConfigurationResource.class);
diff --git a/base/deploy/src/scriptlets/pkijython.py b/base/deploy/src/scriptlets/pkijython.py
index e08b4901e55b93344298a123c5f7a80bdf5b3af2..48ff9670f693ae465e2434c83e172e1b01456298 100644
--- a/base/deploy/src/scriptlets/pkijython.py
+++ b/base/deploy/src/scriptlets/pkijython.py
@@ -140,7 +140,7 @@ from org.mozilla.jss.util import Password
 
 
 # PKI Java Imports
-from com.netscape.cms.servlet.csadmin import ConfigurationRESTClient
+from com.netscape.cms.servlet.csadmin import SystemConfigClient
 from com.netscape.cms.servlet.csadmin.model import CertData
 from com.netscape.cms.servlet.csadmin.model import ConfigurationData
 from com.netscape.cms.servlet.csadmin.model import ConfigurationResponseData
@@ -262,7 +262,7 @@ class rest_client:
                        log.PKI_JYTHON_INITIALIZING_REST_CLIENT,
                        client_config.serverURI)
             if not pki_dry_run_flag:
-                self.client = ConfigurationRESTClient(client_config)
+                self.client = SystemConfigClient(client_config)
             return self.client
         except URISyntaxException, e:
             e.printStackTrace()
diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMRestClient.java b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMClient.java
similarity index 96%
rename from base/kra/functional/src/com/netscape/cms/servlet/test/DRMRestClient.java
rename to base/kra/functional/src/com/netscape/cms/servlet/test/DRMClient.java
index 372b8aea6c7b2bbd2b047bead5344233f7673f00..0f12eada2f4382cac02159d31cfcda4bdd14b2e8 100644
--- a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMRestClient.java
+++ b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMClient.java
@@ -11,7 +11,7 @@ import com.netscape.certsrv.request.RequestId;
 import com.netscape.cms.client.cli.ClientConfig;
 import com.netscape.cms.servlet.admin.SystemCertificateResource;
 import com.netscape.cms.servlet.cert.model.CertificateData;
-import com.netscape.cms.servlet.csadmin.CMSRestClient;
+import com.netscape.cms.servlet.csadmin.PKIClient;
 import com.netscape.cms.servlet.key.KeyResource;
 import com.netscape.cms.servlet.key.model.KeyData;
 import com.netscape.cms.servlet.key.model.KeyDataInfo;
@@ -23,13 +23,13 @@ import com.netscape.cms.servlet.request.model.KeyRequestInfos;
 import com.netscape.cms.servlet.request.model.RecoveryRequestData;
 import com.netscape.cmsutil.util.Utils;
 
-public class DRMRestClient  extends CMSRestClient {
+public class DRMClient  extends PKIClient {
 
     private KeyResource keyClient;
     private KeyRequestResource keyRequestClient;
     private SystemCertificateResource systemCertClient;
 
-    public DRMRestClient(ClientConfig config) throws URISyntaxException {
+    public DRMClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
         systemCertClient = createProxy(SystemCertificateResource.class);
diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
index 62cdfe992014b28eb5f2b871677cdfb63f3ef314..9954ba94f74e708974fc98bb1c4776ac2ed4a80f 100644
--- a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
+++ b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
@@ -194,13 +194,13 @@ public class DRMTest {
         // Set base URI and get client
 
 
-        DRMRestClient client;
+        DRMClient client;
         try {
             ClientConfig config = new ClientConfig();
             config.setServerURI(protocol + "://" + host + ":" + port + "/kra");
             config.setCertNickname(clientCertNickname);
 
-            client = new DRMRestClient(config);
+            client = new DRMClient(config);
 
         } catch (Exception e) {
             e.printStackTrace();
-- 
1.7.11.2

