From d95bd26d1ada26af90831bca073aaffa179742dc Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Mon, 5 May 2014 22:52:29 -0400
Subject: [PATCH] Renamed TPS connection to TPS connector (part 3).

The TPS connection client library has been renamed to TPS connector.

Ticket #977
---
 .../src/com/netscape/certsrv/tps/TPSClient.java    |  4 +-
 .../ConnectionResource.java                        | 16 +++---
 .../ConnectorClient.java}                          | 40 +++++++-------
 .../ConnectorCollection.java}                      |  8 +--
 .../ConnectorData.java}                            | 22 ++++----
 .../cmstools/tps/connector/ConnectorAddCLI.java    | 12 ++---
 .../cmstools/tps/connector/ConnectorCLI.java       | 18 +++----
 .../cmstools/tps/connector/ConnectorFindCLI.java   | 14 ++---
 .../cmstools/tps/connector/ConnectorModifyCLI.java | 12 ++---
 .../cmstools/tps/connector/ConnectorRemoveCLI.java |  2 +-
 .../cmstools/tps/connector/ConnectorShowCLI.java   |  8 +--
 .../server/tps/rest/ConnectionService.java         | 62 +++++++++++-----------
 12 files changed, 109 insertions(+), 109 deletions(-)
 rename base/common/src/com/netscape/certsrv/tps/{connection => connector}/ConnectionResource.java (83%)
 rename base/common/src/com/netscape/certsrv/tps/{connection/ConnectionClient.java => connector/ConnectorClient.java} (50%)
 rename base/common/src/com/netscape/certsrv/tps/{connection/ConnectionCollection.java => connector/ConnectorCollection.java} (83%)
 rename base/common/src/com/netscape/certsrv/tps/{connection/ConnectionData.java => connector/ConnectorData.java} (90%)

diff --git a/base/common/src/com/netscape/certsrv/tps/TPSClient.java b/base/common/src/com/netscape/certsrv/tps/TPSClient.java
index 7f65784c9e648d553384b6ae8220e02f3cfd0f7b..da0022520c90ee6e265fe19b554d15cc602bcca4 100644
--- a/base/common/src/com/netscape/certsrv/tps/TPSClient.java
+++ b/base/common/src/com/netscape/certsrv/tps/TPSClient.java
@@ -28,7 +28,7 @@ import com.netscape.certsrv.selftests.SelfTestClient;
 import com.netscape.certsrv.tps.authenticator.AuthenticatorClient;
 import com.netscape.certsrv.tps.cert.TPSCertClient;
 import com.netscape.certsrv.tps.config.ConfigClient;
-import com.netscape.certsrv.tps.connection.ConnectionClient;
+import com.netscape.certsrv.tps.connector.ConnectorClient;
 import com.netscape.certsrv.tps.profile.ProfileClient;
 import com.netscape.certsrv.tps.profile.ProfileMappingClient;
 import com.netscape.certsrv.tps.token.TokenClient;
@@ -50,7 +50,7 @@ public class TPSClient extends SubsystemClient {
         addClient(new AuthenticatorClient(client, name));
         addClient(new TPSCertClient(client, name));
         addClient(new ConfigClient(client, name));
-        addClient(new ConnectionClient(client, name));
+        addClient(new ConnectorClient(client, name));
         addClient(new GroupClient(client, name));
         addClient(new ProfileClient(client, name));
         addClient(new ProfileMappingClient(client, name));
diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java
similarity index 83%
rename from base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java
rename to base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java
index 216e3793b267f2c10322baea62e5545737260d1d..1fb9fa33c8e201b8bb3a63294c777ef708265d28 100644
--- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionResource.java
+++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectionResource.java
@@ -15,7 +15,7 @@
 // (C) 2013 Red Hat, Inc.
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
-package com.netscape.certsrv.tps.connection;
+package com.netscape.certsrv.tps.connector;
 
 import javax.ws.rs.DELETE;
 import javax.ws.rs.GET;
@@ -41,7 +41,7 @@ import com.netscape.certsrv.base.PATCH;
 public interface ConnectionResource {
 
     @GET
-    @ClientResponseType(entityType=ConnectionCollection.class)
+    @ClientResponseType(entityType=ConnectorCollection.class)
     public Response findConnections(
             @QueryParam("filter") String filter,
             @QueryParam("start") Integer start,
@@ -49,26 +49,26 @@ public interface ConnectionResource {
 
     @GET
     @Path("{connectionID}")
-    @ClientResponseType(entityType=ConnectionData.class)
+    @ClientResponseType(entityType=ConnectorData.class)
     public Response getConnection(@PathParam("connectionID") String connectionID);
 
     @POST
     @ACLMapping("connections.add")
-    @ClientResponseType(entityType=ConnectionData.class)
-    public Response addConnection(ConnectionData connectionData);
+    @ClientResponseType(entityType=ConnectorData.class)
+    public Response addConnection(ConnectorData connectorData);
 
     @PATCH
     @Path("{connectionID}")
     @ACLMapping("connections.modify")
-    @ClientResponseType(entityType=ConnectionData.class)
+    @ClientResponseType(entityType=ConnectorData.class)
     public Response updateConnection(
             @PathParam("connectionID") String connectionID,
-            ConnectionData connectionData);
+            ConnectorData connectorData);
 
     @POST
     @Path("{connectionID}")
     @ACLMapping("connections.approve")
-    @ClientResponseType(entityType=ConnectionData.class)
+    @ClientResponseType(entityType=ConnectorData.class)
     public Response changeConnectionStatus(
             @PathParam("connectionID") String connectionID,
             @QueryParam("action") String action);
diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java
similarity index 50%
rename from base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java
rename to base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java
index aaf9e639992b966b28eb310ae75f160d31726dfc..4a86f1eae2f60dc58374bc80fe7b06b775b5a11a 100644
--- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionClient.java
+++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorClient.java
@@ -15,7 +15,7 @@
 //(C) 2013 Red Hat, Inc.
 //All rights reserved.
 //--- END COPYRIGHT BLOCK ---
-package com.netscape.certsrv.tps.connection;
+package com.netscape.certsrv.tps.connector;
 
 import java.net.URISyntaxException;
 
@@ -27,12 +27,12 @@ import com.netscape.certsrv.client.PKIClient;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionClient extends Client {
+public class ConnectorClient extends Client {
 
     public ConnectionResource resource;
 
-    public ConnectionClient(PKIClient client, String subsystem) throws URISyntaxException {
-        super(client, subsystem, "connection");
+    public ConnectorClient(PKIClient client, String subsystem) throws URISyntaxException {
+        super(client, subsystem, "connector");
         init();
     }
 
@@ -40,33 +40,33 @@ public class ConnectionClient extends Client {
         resource = createProxy(ConnectionResource.class);
     }
 
-    public ConnectionCollection findConnections(String filter, Integer start, Integer size) {
+    public ConnectorCollection findConnectors(String filter, Integer start, Integer size) {
         Response response = resource.findConnections(filter, start, size);
-        return client.getEntity(response, ConnectionCollection.class);
+        return client.getEntity(response, ConnectorCollection.class);
     }
 
-    public ConnectionData getConnection(String connectionID) {
-        Response response = resource.getConnection(connectionID);
-        return client.getEntity(response, ConnectionData.class);
+    public ConnectorData getConnector(String connectorID) {
+        Response response = resource.getConnection(connectorID);
+        return client.getEntity(response, ConnectorData.class);
     }
 
-    public ConnectionData addConnection(ConnectionData connectionData) {
-        Response response = resource.addConnection(connectionData);
-        return client.getEntity(response, ConnectionData.class);
+    public ConnectorData addConnector(ConnectorData connectorData) {
+        Response response = resource.addConnection(connectorData);
+        return client.getEntity(response, ConnectorData.class);
     }
 
-    public ConnectionData updateConnection(String connectionID, ConnectionData connectionData) {
-        Response response = resource.updateConnection(connectionID, connectionData);
-        return client.getEntity(response, ConnectionData.class);
+    public ConnectorData updateConnector(String connectorID, ConnectorData connectorData) {
+        Response response = resource.updateConnection(connectorID, connectorData);
+        return client.getEntity(response, ConnectorData.class);
     }
 
-    public ConnectionData changeConnectionStatus(String connectionID, String action) {
-        Response response = resource.changeConnectionStatus(connectionID, action);
-        return client.getEntity(response, ConnectionData.class);
+    public ConnectorData changeConnectorStatus(String connectorID, String action) {
+        Response response = resource.changeConnectionStatus(connectorID, action);
+        return client.getEntity(response, ConnectorData.class);
     }
 
-    public void removeConnection(String connectionID) {
-        Response response = resource.removeConnection(connectionID);
+    public void removeConnector(String connectorID) {
+        Response response = resource.removeConnection(connectorID);
         client.getEntity(response, Void.class);
     }
 }
diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionCollection.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorCollection.java
similarity index 83%
rename from base/common/src/com/netscape/certsrv/tps/connection/ConnectionCollection.java
rename to base/common/src/com/netscape/certsrv/tps/connector/ConnectorCollection.java
index 9d94ee08bb5553f0716b5c029b85a3017af04a72..64f301c766d3c452e96790ad98a950f177603713 100644
--- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionCollection.java
+++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorCollection.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.certsrv.tps.connection;
+package com.netscape.certsrv.tps.connector;
 
 import java.util.Collection;
 
@@ -28,11 +28,11 @@ import com.netscape.certsrv.base.DataCollection;
 /**
  * @author Endi S. Dewata
  */
-@XmlRootElement(name="Connections")
-public class ConnectionCollection extends DataCollection<ConnectionData> {
+@XmlRootElement(name="Connectors")
+public class ConnectorCollection extends DataCollection<ConnectorData> {
 
     @XmlElementRef
-    public Collection<ConnectionData> getEntries() {
+    public Collection<ConnectorData> getEntries() {
         return super.getEntries();
     }
 }
diff --git a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionData.java b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorData.java
similarity index 90%
rename from base/common/src/com/netscape/certsrv/tps/connection/ConnectionData.java
rename to base/common/src/com/netscape/certsrv/tps/connector/ConnectorData.java
index 0d1224d3c7e58408bf31c619c4e0bfb8b86be481..3e86f600036687e39848c23379af38565e5dd1a4 100644
--- a/base/common/src/com/netscape/certsrv/tps/connection/ConnectionData.java
+++ b/base/common/src/com/netscape/certsrv/tps/connector/ConnectorData.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.certsrv.tps.connection;
+package com.netscape.certsrv.tps.connector;
 
 import java.io.StringReader;
 import java.io.StringWriter;
@@ -42,18 +42,18 @@ import org.jboss.resteasy.plugins.providers.atom.Link;
 /**
  * @author Endi S. Dewata
  */
-@XmlRootElement(name="Connection")
+@XmlRootElement(name="Connector")
 @XmlAccessorType(XmlAccessType.NONE)
-public class ConnectionData {
+public class ConnectorData {
 
     public static Marshaller marshaller;
     public static Unmarshaller unmarshaller;
 
     static {
         try {
-            marshaller = JAXBContext.newInstance(ConnectionData.class).createMarshaller();
+            marshaller = JAXBContext.newInstance(ConnectorData.class).createMarshaller();
             marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
-            unmarshaller = JAXBContext.newInstance(ConnectionData.class).createUnmarshaller();
+            unmarshaller = JAXBContext.newInstance(ConnectorData.class).createUnmarshaller();
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -157,7 +157,7 @@ public class ConnectionData {
             return false;
         if (getClass() != obj.getClass())
             return false;
-        ConnectionData other = (ConnectionData) obj;
+        ConnectorData other = (ConnectorData) obj;
         if (id == null) {
             if (other.id != null)
                 return false;
@@ -192,9 +192,9 @@ public class ConnectionData {
         }
     }
 
-    public static ConnectionData valueOf(String string) throws Exception {
+    public static ConnectorData valueOf(String string) throws Exception {
         try {
-            return (ConnectionData)unmarshaller.unmarshal(new StringReader(string));
+            return (ConnectorData)unmarshaller.unmarshal(new StringReader(string));
         } catch (Exception e) {
             return null;
         }
@@ -202,8 +202,8 @@ public class ConnectionData {
 
     public static void main(String args[]) throws Exception {
 
-        ConnectionData before = new ConnectionData();
-        before.setID("connection1");
+        ConnectorData before = new ConnectorData();
+        before.setID("connector1");
         before.setStatus("ENABLED");
 
         Map<String, String> properties = new LinkedHashMap<String, String>();
@@ -214,7 +214,7 @@ public class ConnectionData {
         String string = before.toString();
         System.out.println(string);
 
-        ConnectionData after = ConnectionData.valueOf(string);
+        ConnectorData after = ConnectorData.valueOf(string);
         System.out.println(before.equals(after));
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
index 72653dac357ed2962b19a58ef51667b000fd7596..acc55f4c97e83f6921c7f42147d0bc72ae2bd2f6 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
@@ -27,7 +27,7 @@ import java.util.Arrays;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
-import com.netscape.certsrv.tps.connection.ConnectionData;
+import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -85,7 +85,7 @@ public class ConnectorAddCLI extends CLI {
 
         String input = cmd.getOptionValue("input");
 
-        ConnectionData connectionData;
+        ConnectorData connectorData;
 
         try (BufferedReader in = new BufferedReader(new FileReader(input));
             StringWriter sw = new StringWriter();
@@ -96,13 +96,13 @@ public class ConnectorAddCLI extends CLI {
                 out.println(line);
             }
 
-            connectionData = ConnectionData.valueOf(sw.toString());
+            connectorData = ConnectorData.valueOf(sw.toString());
         }
 
-        connectionData = connectorCLI.connectionClient.addConnection(connectionData);
+        connectorData = connectorCLI.connectorClient.addConnector(connectorData);
 
-        MainCLI.printMessage("Added connector \"" + connectionData.getID() + "\"");
+        MainCLI.printMessage("Added connector \"" + connectorData.getID() + "\"");
 
-        ConnectorCLI.printConnectionData(connectionData, true);
+        ConnectorCLI.printConnectorData(connectorData, true);
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
index 73422f12e2846a1c7ae9381853f68229823a9d14..6b2653825d9696a4731240d0a639ee46146e08f0 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
@@ -23,8 +23,8 @@ import java.util.Map;
 
 import org.jboss.resteasy.plugins.providers.atom.Link;
 
-import com.netscape.certsrv.tps.connection.ConnectionClient;
-import com.netscape.certsrv.tps.connection.ConnectionData;
+import com.netscape.certsrv.tps.connector.ConnectorData;
+import com.netscape.certsrv.tps.connector.ConnectorClient;
 import com.netscape.cmstools.cli.CLI;
 
 /**
@@ -32,7 +32,7 @@ import com.netscape.cmstools.cli.CLI;
  */
 public class ConnectorCLI extends CLI {
 
-    public ConnectionClient connectionClient;
+    public ConnectorClient connectorClient;
 
     public ConnectorCLI(CLI parent) {
         super("connector", "Connector management commands", parent);
@@ -47,18 +47,18 @@ public class ConnectorCLI extends CLI {
     public void execute(String[] args) throws Exception {
 
         client = parent.getClient();
-        connectionClient = (ConnectionClient)parent.getClient("connection");
+        connectorClient = (ConnectorClient)parent.getClient("connector");
 
         super.execute(args);
     }
 
-    public static void printConnectionData(ConnectionData connectionData, boolean showProperties) throws IOException {
-        System.out.println("  Connector ID: " + connectionData.getID());
-        if (connectionData.getStatus() != null) System.out.println("  Status: " + connectionData.getStatus());
+    public static void printConnectorData(ConnectorData connectorData, boolean showProperties) throws IOException {
+        System.out.println("  Connector ID: " + connectorData.getID());
+        if (connectorData.getStatus() != null) System.out.println("  Status: " + connectorData.getStatus());
 
         if (showProperties) {
             System.out.println("  Properties:");
-            Map<String, String> properties = connectionData.getProperties();
+            Map<String, String> properties = connectorData.getProperties();
             if (properties != null) {
                 for (String name : properties.keySet()) {
                     String value = properties.get(name);
@@ -67,7 +67,7 @@ public class ConnectorCLI extends CLI {
             }
         }
 
-        Link link = connectionData.getLink();
+        Link link = connectorData.getLink();
         if (verbose && link != null) {
             System.out.println("  Link: " + link.getHref());
         }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
index cc93fbb943fba57a5c85d95dbbf4d23100bfb6e9..8e1e39f2009caa8a802e7411b9a988576c35c46b 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
@@ -24,8 +24,8 @@ import java.util.Collection;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
-import com.netscape.certsrv.tps.connection.ConnectionCollection;
-import com.netscape.certsrv.tps.connection.ConnectionData;
+import com.netscape.certsrv.tps.connector.ConnectorCollection;
+import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -85,15 +85,15 @@ public class ConnectorFindCLI extends CLI {
         s = cmd.getOptionValue("size");
         Integer size = s == null ? null : Integer.valueOf(s);
 
-        ConnectionCollection result = connectorCLI.connectionClient.findConnections(filter, start, size);
+        ConnectorCollection result = connectorCLI.connectorClient.findConnectors(filter, start, size);
 
         MainCLI.printMessage(result.getTotal() + " entries matched");
         if (result.getTotal() == 0) return;
 
-        Collection<ConnectionData> connections = result.getEntries();
+        Collection<ConnectorData> connectors = result.getEntries();
         boolean first = true;
 
-        for (ConnectionData connectionData : connections) {
+        for (ConnectorData connectorData : connectors) {
 
             if (first) {
                 first = false;
@@ -101,9 +101,9 @@ public class ConnectorFindCLI extends CLI {
                 System.out.println();
             }
 
-            ConnectorCLI.printConnectionData(connectionData, false);
+            ConnectorCLI.printConnectorData(connectorData, false);
         }
 
-        MainCLI.printMessage("Number of entries returned " + connections.size());
+        MainCLI.printMessage("Number of entries returned " + connectors.size());
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
index f92e7c153365c8b3d4d55195aaa14737625c0d2f..8180934dc4a8e60a6d5274bb9a6524e975d7caf1 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
@@ -27,7 +27,7 @@ import java.util.Arrays;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
-import com.netscape.certsrv.tps.connection.ConnectionData;
+import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -90,7 +90,7 @@ public class ConnectorModifyCLI extends CLI {
         String action = cmd.getOptionValue("action", "update");
         String input = cmd.getOptionValue("input");
 
-        ConnectionData connectionData;
+        ConnectorData connectorData;
 
         if (action.equals("update")) {
 
@@ -110,17 +110,17 @@ public class ConnectorModifyCLI extends CLI {
                     out.println(line);
                 }
 
-                connectionData = ConnectionData.valueOf(sw.toString());
+                connectorData = ConnectorData.valueOf(sw.toString());
             }
 
-            connectionData = connectorCLI.connectionClient.updateConnection(connectorID, connectionData);
+            connectorData = connectorCLI.connectorClient.updateConnector(connectorID, connectorData);
 
         } else { // other actions
-            connectionData = connectorCLI.connectionClient.changeConnectionStatus(connectorID, action);
+            connectorData = connectorCLI.connectorClient.changeConnectorStatus(connectorID, action);
         }
 
         MainCLI.printMessage("Modified connector \"" + connectorID + "\"");
 
-        ConnectorCLI.printConnectionData(connectionData, true);
+        ConnectorCLI.printConnectorData(connectorData, true);
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
index d8c9b2a718d2f20f1284512acfd4b2a960b27801..97df9523059506cc9b5bc3d824b4ef4510f3466a 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
@@ -70,7 +70,7 @@ public class ConnectorRemoveCLI extends CLI {
 
         String connectorID = args[0];
 
-        connectorCLI.connectionClient.removeConnection(connectorID);
+        connectorCLI.connectorClient.removeConnector(connectorID);
 
         MainCLI.printMessage("Deleted connector \"" + connectorID + "\"");
     }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
index 57eac7d33db32777b74054a0376ca8a8e4526c84..dacccf2e28d61357ef129bba38a93922e9c098a5 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
@@ -25,7 +25,7 @@ import java.util.Arrays;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
-import com.netscape.certsrv.tps.connection.ConnectionData;
+import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -83,15 +83,15 @@ public class ConnectorShowCLI extends CLI {
         String connectorID = args[0];
         String output = cmd.getOptionValue("output");
 
-        ConnectionData connectionData = connectorCLI.connectionClient.getConnection(connectorID);
+        ConnectorData connectorData = connectorCLI.connectorClient.getConnector(connectorID);
 
         if (output == null) {
             MainCLI.printMessage("Connector \"" + connectorID + "\"");
-            ConnectorCLI.printConnectionData(connectionData, true);
+            ConnectorCLI.printConnectorData(connectorData, true);
 
         } else {
             try (PrintWriter out = new PrintWriter(new FileWriter(output))) {
-                out.println(connectionData);
+                out.println(connectorData);
             }
             MainCLI.printMessage("Stored connector \"" + connectorID + "\" into " + output);
         }
diff --git a/base/tps-tomcat/src/org/dogtagpki/server/tps/rest/ConnectionService.java b/base/tps-tomcat/src/org/dogtagpki/server/tps/rest/ConnectionService.java
index daa9fb003bc11a05ad05fc9293012aedbe38bfd1..bafa7e22caf19c66d6a7ae3f73d09d4d67e10573 100644
--- a/base/tps-tomcat/src/org/dogtagpki/server/tps/rest/ConnectionService.java
+++ b/base/tps-tomcat/src/org/dogtagpki/server/tps/rest/ConnectionService.java
@@ -41,9 +41,9 @@ import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.ForbiddenException;
 import com.netscape.certsrv.base.PKIException;
-import com.netscape.certsrv.tps.connection.ConnectionCollection;
-import com.netscape.certsrv.tps.connection.ConnectionData;
-import com.netscape.certsrv.tps.connection.ConnectionResource;
+import com.netscape.certsrv.tps.connector.ConnectionResource;
+import com.netscape.certsrv.tps.connector.ConnectorCollection;
+import com.netscape.certsrv.tps.connector.ConnectorData;
 import com.netscape.cms.servlet.base.PKIService;
 
 /**
@@ -69,28 +69,28 @@ public class ConnectionService extends PKIService implements ConnectionResource
         CMS.debug("ConnectionService.<init>()");
     }
 
-    public ConnectionData createConnectionData(ConnectionRecord connectionRecord) throws UnsupportedEncodingException {
+    public ConnectorData createConnectorData(ConnectionRecord connectionRecord) throws UnsupportedEncodingException {
 
         String connectionID = connectionRecord.getID();
 
-        ConnectionData connectionData = new ConnectionData();
-        connectionData.setID(connectionID);
-        connectionData.setStatus(connectionRecord.getStatus());
-        connectionData.setProperties(connectionRecord.getProperties());
+        ConnectorData connectorData = new ConnectorData();
+        connectorData.setID(connectionID);
+        connectorData.setStatus(connectionRecord.getStatus());
+        connectorData.setProperties(connectionRecord.getProperties());
 
         connectionID = URLEncoder.encode(connectionID, "UTF-8");
         URI uri = uriInfo.getBaseUriBuilder().path(ConnectionResource.class).path("{connectionID}").build(connectionID);
-        connectionData.setLink(new Link("self", uri));
+        connectorData.setLink(new Link("self", uri));
 
-        return connectionData;
+        return connectorData;
     }
 
-    public ConnectionRecord createConnectionRecord(ConnectionData connectionData) {
+    public ConnectionRecord createConnectionRecord(ConnectorData connectorData) {
 
         ConnectionRecord connectionRecord = new ConnectionRecord();
-        connectionRecord.setID(connectionData.getID());
-        connectionRecord.setStatus(connectionData.getStatus());
-        connectionRecord.setProperties(connectionData.getProperties());
+        connectionRecord.setID(connectorData.getID());
+        connectionRecord.setStatus(connectorData.getStatus());
+        connectionRecord.setProperties(connectorData.getProperties());
 
         return connectionRecord;
     }
@@ -109,7 +109,7 @@ public class ConnectionService extends PKIService implements ConnectionResource
 
             Iterator<ConnectionRecord> connections = database.findRecords(filter).iterator();
 
-            ConnectionCollection response = new ConnectionCollection();
+            ConnectorCollection response = new ConnectorCollection();
             int i = 0;
 
             // skip to the start of the page
@@ -117,7 +117,7 @@ public class ConnectionService extends PKIService implements ConnectionResource
 
             // return entries up to the page size
             for ( ; i<start+size && connections.hasNext(); i++) {
-                response.addEntry(createConnectionData(connections.next()));
+                response.addEntry(createConnectorData(connections.next()));
             }
 
             // count the total entries
@@ -156,7 +156,7 @@ public class ConnectionService extends PKIService implements ConnectionResource
             TPSSubsystem subsystem = (TPSSubsystem)CMS.getSubsystem(TPSSubsystem.ID);
             ConnectionDatabase database = subsystem.getConnectionDatabase();
 
-            return createOKResponse(createConnectionData(database.getRecord(connectionID)));
+            return createOKResponse(createConnectorData(database.getRecord(connectionID)));
 
         } catch (PKIException e) {
             throw e;
@@ -168,20 +168,20 @@ public class ConnectionService extends PKIService implements ConnectionResource
     }
 
     @Override
-    public Response addConnection(ConnectionData connectionData) {
+    public Response addConnection(ConnectorData connectorData) {
 
-        if (connectionData == null) throw new BadRequestException("Connection data is null.");
+        if (connectorData == null) throw new BadRequestException("Connector data is null.");
 
-        CMS.debug("ConnectionService.addConnection(\"" + connectionData.getID() + "\")");
+        CMS.debug("ConnectionService.addConnection(\"" + connectorData.getID() + "\")");
 
         try {
             TPSSubsystem subsystem = (TPSSubsystem)CMS.getSubsystem(TPSSubsystem.ID);
             ConnectionDatabase database = subsystem.getConnectionDatabase();
 
-            database.addRecord(connectionData.getID(), createConnectionRecord(connectionData));
-            connectionData = createConnectionData(database.getRecord(connectionData.getID()));
+            database.addRecord(connectorData.getID(), createConnectionRecord(connectorData));
+            connectorData = createConnectorData(database.getRecord(connectorData.getID()));
 
-            return createCreatedResponse(connectionData, connectionData.getLink().getHref());
+            return createCreatedResponse(connectorData, connectorData.getLink().getHref());
 
         } catch (PKIException e) {
             throw e;
@@ -193,10 +193,10 @@ public class ConnectionService extends PKIService implements ConnectionResource
     }
 
     @Override
-    public Response updateConnection(String connectionID, ConnectionData connectionData) {
+    public Response updateConnection(String connectionID, ConnectorData connectorData) {
 
         if (connectionID == null) throw new BadRequestException("Connection ID is null.");
-        if (connectionData == null) throw new BadRequestException("Connection data is null.");
+        if (connectorData == null) throw new BadRequestException("Connector data is null.");
 
         CMS.debug("ConnectionService.updateConnection(\"" + connectionID + "\")");
 
@@ -212,7 +212,7 @@ public class ConnectionService extends PKIService implements ConnectionResource
             }
 
             // update status if specified
-            String status = connectionData.getStatus();
+            String status = connectorData.getStatus();
             if (status != null && !"Disabled".equals(status)) {
                 if (!"Enabled".equals(status)) {
                     throw new ForbiddenException("Invalid connection status: " + status);
@@ -229,16 +229,16 @@ public class ConnectionService extends PKIService implements ConnectionResource
             }
 
             // update properties if specified
-            Map<String, String> properties = connectionData.getProperties();
+            Map<String, String> properties = connectorData.getProperties();
             if (properties != null) {
                 record.setProperties(properties);
             }
 
             database.updateRecord(connectionID, record);
 
-            connectionData = createConnectionData(database.getRecord(connectionID));
+            connectorData = createConnectorData(database.getRecord(connectionID));
 
-            return createOKResponse(connectionData);
+            return createOKResponse(connectorData);
 
         } catch (PKIException e) {
             throw e;
@@ -294,9 +294,9 @@ public class ConnectionService extends PKIService implements ConnectionResource
             record.setStatus(status);
             database.updateRecord(connectionID, record);
 
-            ConnectionData connectionData = createConnectionData(database.getRecord(connectionID));
+            ConnectorData connectorData = createConnectorData(database.getRecord(connectionID));
 
-            return createOKResponse(connectionData);
+            return createOKResponse(connectorData);
 
         } catch (PKIException e) {
             throw e;
-- 
1.8.4.2

