From d92d26c4b4385973e07e3468af826f26c04a2f1b Mon Sep 17 00:00:00 2001
From: "Endi S. Dewata" <edewata@redhat.com>
Date: Mon, 5 May 2014 18:16:56 -0400
Subject: [PATCH] Renamed TPS connection to TPS connector (part 1).

The TPS connection CLI has been renamed to TPS connector.

Ticket #977
---
 .../src/com/netscape/cmstools/cli/TPSCLI.java      |  4 ++--
 .../ConnectorAddCLI.java}                          | 20 ++++++++--------
 .../ConnectorCLI.java}                             | 20 ++++++++--------
 .../ConnectorFindCLI.java}                         | 16 ++++++-------
 .../ConnectorModifyCLI.java}                       | 28 +++++++++++-----------
 .../ConnectorRemoveCLI.java}                       | 22 ++++++++---------
 .../ConnectorShowCLI.java}                         | 28 +++++++++++-----------
 7 files changed, 69 insertions(+), 69 deletions(-)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionAddCLI.java => connector/ConnectorAddCLI.java} (83%)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionCLI.java => connector/ConnectorCLI.java} (80%)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionFindCLI.java => connector/ConnectorFindCLI.java} (86%)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionModifyCLI.java => connector/ConnectorModifyCLI.java} (78%)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionRemoveCLI.java => connector/ConnectorRemoveCLI.java} (72%)
 rename base/java-tools/src/com/netscape/cmstools/tps/{connection/ConnectionShowCLI.java => connector/ConnectorShowCLI.java} (72%)

diff --git a/base/java-tools/src/com/netscape/cmstools/cli/TPSCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/TPSCLI.java
index b6df2995a923f5b3704eb315f3d19e1839d40af7..1931b2baa56130122be1ef7d1fd2efa1d54f3b01 100644
--- a/base/java-tools/src/com/netscape/cmstools/cli/TPSCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/TPSCLI.java
@@ -27,7 +27,7 @@ import com.netscape.cmstools.selftests.SelfTestCLI;
 import com.netscape.cmstools.tps.authenticator.AuthenticatorCLI;
 import com.netscape.cmstools.tps.cert.TPSCertCLI;
 import com.netscape.cmstools.tps.config.ConfigCLI;
-import com.netscape.cmstools.tps.connection.ConnectionCLI;
+import com.netscape.cmstools.tps.connector.ConnectorCLI;
 import com.netscape.cmstools.tps.profile.ProfileCLI;
 import com.netscape.cmstools.tps.token.TokenCLI;
 import com.netscape.cmstools.user.UserCLI;
@@ -47,7 +47,7 @@ public class TPSCLI extends SubsystemCLI {
         addModule(new AuthenticatorCLI(this));
         addModule(new TPSCertCLI(this));
         addModule(new ConfigCLI(this));
-        addModule(new ConnectionCLI(this));
+        addModule(new ConnectorCLI(this));
         addModule(new GroupCLI(this));
         addModule(new ProfileCLI(this));
         addModule(new SelfTestCLI(this));
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
similarity index 83%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
index 06307b96abedf9545feca16de19121d1391dd6cf..72653dac357ed2962b19a58ef51667b000fd7596 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorAddCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.io.BufferedReader;
 import java.io.FileReader;
@@ -34,13 +34,13 @@ import com.netscape.cmstools.cli.MainCLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionAddCLI extends CLI {
+public class ConnectorAddCLI extends CLI {
 
-    public ConnectionCLI connectionCLI;
+    public ConnectorCLI connectorCLI;
 
-    public ConnectionAddCLI(ConnectionCLI connectionCLI) {
-        super("add", "Add connection", connectionCLI);
-        this.connectionCLI = connectionCLI;
+    public ConnectorAddCLI(ConnectorCLI connectorCLI) {
+        super("add", "Add connector", connectorCLI);
+        this.connectorCLI = connectorCLI;
 
         createOptions();
     }
@@ -50,7 +50,7 @@ public class ConnectionAddCLI extends CLI {
     }
 
     public void createOptions() {
-        Option option = new Option(null, "input", true, "Input file containing connection properties.");
+        Option option = new Option(null, "input", true, "Input file containing connector properties.");
         option.setArgName("file");
         option.setRequired(true);
         options.addOption(option);
@@ -99,10 +99,10 @@ public class ConnectionAddCLI extends CLI {
             connectionData = ConnectionData.valueOf(sw.toString());
         }
 
-        connectionData = connectionCLI.connectionClient.addConnection(connectionData);
+        connectionData = connectorCLI.connectionClient.addConnection(connectionData);
 
-        MainCLI.printMessage("Added connection \"" + connectionData.getID() + "\"");
+        MainCLI.printMessage("Added connector \"" + connectionData.getID() + "\"");
 
-        ConnectionCLI.printConnectionData(connectionData, true);
+        ConnectorCLI.printConnectionData(connectionData, true);
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
similarity index 80%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
index c0802ba13a05d6e410759ee6c29ac5081d0131db..73422f12e2846a1c7ae9381853f68229823a9d14 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.io.IOException;
 import java.util.Map;
@@ -30,18 +30,18 @@ import com.netscape.cmstools.cli.CLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionCLI extends CLI {
+public class ConnectorCLI extends CLI {
 
     public ConnectionClient connectionClient;
 
-    public ConnectionCLI(CLI parent) {
-        super("connection", "Connection management commands", parent);
+    public ConnectorCLI(CLI parent) {
+        super("connector", "Connector management commands", parent);
 
-        addModule(new ConnectionAddCLI(this));
-        addModule(new ConnectionFindCLI(this));
-        addModule(new ConnectionModifyCLI(this));
-        addModule(new ConnectionRemoveCLI(this));
-        addModule(new ConnectionShowCLI(this));
+        addModule(new ConnectorAddCLI(this));
+        addModule(new ConnectorFindCLI(this));
+        addModule(new ConnectorModifyCLI(this));
+        addModule(new ConnectorRemoveCLI(this));
+        addModule(new ConnectorShowCLI(this));
     }
 
     public void execute(String[] args) throws Exception {
@@ -53,7 +53,7 @@ public class ConnectionCLI extends CLI {
     }
 
     public static void printConnectionData(ConnectionData connectionData, boolean showProperties) throws IOException {
-        System.out.println("  Connection ID: " + connectionData.getID());
+        System.out.println("  Connector ID: " + connectionData.getID());
         if (connectionData.getStatus() != null) System.out.println("  Status: " + connectionData.getStatus());
 
         if (showProperties) {
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
similarity index 86%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
index 0685c5050348ef3f5d52117fa0f8cd7f242a5c96..cc93fbb943fba57a5c85d95dbbf4d23100bfb6e9 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorFindCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.util.Arrays;
 import java.util.Collection;
@@ -32,13 +32,13 @@ import com.netscape.cmstools.cli.MainCLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionFindCLI extends CLI {
+public class ConnectorFindCLI extends CLI {
 
-    public ConnectionCLI connectionCLI;
+    public ConnectorCLI connectorCLI;
 
-    public ConnectionFindCLI(ConnectionCLI connectionCLI) {
-        super("find", "Find connections", connectionCLI);
-        this.connectionCLI = connectionCLI;
+    public ConnectorFindCLI(ConnectorCLI connectorCLI) {
+        super("find", "Find connectors", connectorCLI);
+        this.connectorCLI = connectorCLI;
 
         createOptions();
     }
@@ -85,7 +85,7 @@ public class ConnectionFindCLI extends CLI {
         s = cmd.getOptionValue("size");
         Integer size = s == null ? null : Integer.valueOf(s);
 
-        ConnectionCollection result = connectionCLI.connectionClient.findConnections(filter, start, size);
+        ConnectionCollection result = connectorCLI.connectionClient.findConnections(filter, start, size);
 
         MainCLI.printMessage(result.getTotal() + " entries matched");
         if (result.getTotal() == 0) return;
@@ -101,7 +101,7 @@ public class ConnectionFindCLI extends CLI {
                 System.out.println();
             }
 
-            ConnectionCLI.printConnectionData(connectionData, false);
+            ConnectorCLI.printConnectionData(connectionData, false);
         }
 
         MainCLI.printMessage("Number of entries returned " + connections.size());
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
similarity index 78%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
index 0d5de705ada705cee35fc0d3496b958525fcdadc..f92e7c153365c8b3d4d55195aaa14737625c0d2f 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorModifyCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.io.BufferedReader;
 import java.io.FileReader;
@@ -34,19 +34,19 @@ import com.netscape.cmstools.cli.MainCLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionModifyCLI extends CLI {
+public class ConnectorModifyCLI extends CLI {
 
-    public ConnectionCLI connectionCLI;
+    public ConnectorCLI connectorCLI;
 
-    public ConnectionModifyCLI(ConnectionCLI connectionCLI) {
-        super("mod", "Modify connection", connectionCLI);
-        this.connectionCLI = connectionCLI;
+    public ConnectorModifyCLI(ConnectorCLI connectorCLI) {
+        super("mod", "Modify connector", connectorCLI);
+        this.connectorCLI = connectorCLI;
 
         createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Connector ID> [OPTIONS...]", options);
     }
 
     public void createOptions() {
@@ -54,7 +54,7 @@ public class ConnectionModifyCLI extends CLI {
         option.setArgName("action");
         options.addOption(option);
 
-        option = new Option(null, "input", true, "Input file containing connection properties.");
+        option = new Option(null, "input", true, "Input file containing connector properties.");
         option.setArgName("file");
         options.addOption(option);
     }
@@ -81,12 +81,12 @@ public class ConnectionModifyCLI extends CLI {
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
-            System.err.println("Error: No Connection ID specified.");
+            System.err.println("Error: No Connector ID specified.");
             printHelp();
             System.exit(-1);
         }
 
-        String connectionID = cmdArgs[0];
+        String connectorID = cmdArgs[0];
         String action = cmd.getOptionValue("action", "update");
         String input = cmd.getOptionValue("input");
 
@@ -113,14 +113,14 @@ public class ConnectionModifyCLI extends CLI {
                 connectionData = ConnectionData.valueOf(sw.toString());
             }
 
-            connectionData = connectionCLI.connectionClient.updateConnection(connectionID, connectionData);
+            connectionData = connectorCLI.connectionClient.updateConnection(connectorID, connectionData);
 
         } else { // other actions
-            connectionData = connectionCLI.connectionClient.changeConnectionStatus(connectionID, action);
+            connectionData = connectorCLI.connectionClient.changeConnectionStatus(connectorID, action);
         }
 
-        MainCLI.printMessage("Modified connection \"" + connectionID + "\"");
+        MainCLI.printMessage("Modified connector \"" + connectorID + "\"");
 
-        ConnectionCLI.printConnectionData(connectionData, true);
+        ConnectorCLI.printConnectionData(connectionData, true);
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
similarity index 72%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
index 68289109ade675aac579adfe257a9f7cdab8f3f3..d8c9b2a718d2f20f1284512acfd4b2a960b27801 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorRemoveCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.util.Arrays;
 
@@ -28,17 +28,17 @@ import com.netscape.cmstools.cli.MainCLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionRemoveCLI extends CLI {
+public class ConnectorRemoveCLI extends CLI {
 
-    public ConnectionCLI connectionCLI;
+    public ConnectorCLI connectorCLI;
 
-    public ConnectionRemoveCLI(ConnectionCLI connectionCLI) {
-        super("del", "Remove connection", connectionCLI);
-        this.connectionCLI = connectionCLI;
+    public ConnectorRemoveCLI(ConnectorCLI connectorCLI) {
+        super("del", "Remove connector", connectorCLI);
+        this.connectorCLI = connectorCLI;
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Connector ID> [OPTIONS...]", options);
     }
 
     public void execute(String[] args) throws Exception {
@@ -63,15 +63,15 @@ public class ConnectionRemoveCLI extends CLI {
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
-            System.err.println("Error: No Connection ID specified.");
+            System.err.println("Error: No Connector ID specified.");
             printHelp();
             System.exit(-1);
         }
 
-        String connectionID = args[0];
+        String connectorID = args[0];
 
-        connectionCLI.connectionClient.removeConnection(connectionID);
+        connectorCLI.connectionClient.removeConnection(connectorID);
 
-        MainCLI.printMessage("Deleted connection \"" + connectionID + "\"");
+        MainCLI.printMessage("Deleted connector \"" + connectorID + "\"");
     }
 }
diff --git a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
similarity index 72%
rename from base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java
rename to base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
index 5a37aaffebb9799b0271a1917878acda2340f42b..57eac7d33db32777b74054a0376ca8a8e4526c84 100644
--- a/base/java-tools/src/com/netscape/cmstools/tps/connection/ConnectionShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/tps/connector/ConnectorShowCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cmstools.tps.connection;
+package com.netscape.cmstools.tps.connector;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
@@ -32,23 +32,23 @@ import com.netscape.cmstools.cli.MainCLI;
 /**
  * @author Endi S. Dewata
  */
-public class ConnectionShowCLI extends CLI {
+public class ConnectorShowCLI extends CLI {
 
-    public ConnectionCLI connectionCLI;
+    public ConnectorCLI connectorCLI;
 
-    public ConnectionShowCLI(ConnectionCLI connectionCLI) {
-        super("show", "Show connection", connectionCLI);
-        this.connectionCLI = connectionCLI;
+    public ConnectorShowCLI(ConnectorCLI connectorCLI) {
+        super("show", "Show connector", connectorCLI);
+        this.connectorCLI = connectorCLI;
 
         createOptions();
     }
 
     public void printHelp() {
-        formatter.printHelp(getFullName() + " <Connection ID> [OPTIONS...]", options);
+        formatter.printHelp(getFullName() + " <Connector ID> [OPTIONS...]", options);
     }
 
     public void createOptions() {
-        Option option = new Option(null, "output", true, "Output file to store connection properties.");
+        Option option = new Option(null, "output", true, "Output file to store connector properties.");
         option.setArgName("file");
         options.addOption(option);
     }
@@ -75,25 +75,25 @@ public class ConnectionShowCLI extends CLI {
         String[] cmdArgs = cmd.getArgs();
 
         if (cmdArgs.length != 1) {
-            System.err.println("Error: No Connection ID specified.");
+            System.err.println("Error: No Connector ID specified.");
             printHelp();
             System.exit(-1);
         }
 
-        String connectionID = args[0];
+        String connectorID = args[0];
         String output = cmd.getOptionValue("output");
 
-        ConnectionData connectionData = connectionCLI.connectionClient.getConnection(connectionID);
+        ConnectionData connectionData = connectorCLI.connectionClient.getConnection(connectorID);
 
         if (output == null) {
-            MainCLI.printMessage("Connection \"" + connectionID + "\"");
-            ConnectionCLI.printConnectionData(connectionData, true);
+            MainCLI.printMessage("Connector \"" + connectorID + "\"");
+            ConnectorCLI.printConnectionData(connectionData, true);
 
         } else {
             try (PrintWriter out = new PrintWriter(new FileWriter(output))) {
                 out.println(connectionData);
             }
-            MainCLI.printMessage("Stored connection \"" + connectionID + "\" into " + output);
+            MainCLI.printMessage("Stored connector \"" + connectorID + "\" into " + output);
         }
     }
 }
-- 
1.8.4.2

