diff --git a/client/pom.xml b/client/pom.xml
index c6351ed8..975773d5 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -32,7 +32,12 @@ limitations under the License.
Sqoop Client
-
+
+ junit
+ junit
+ test
+
+
org.mockito
mockito-all
test
@@ -41,64 +46,11 @@ limitations under the License.
org.apache.sqoop
sqoop-common
-
- commons-cli
- commons-cli
- 1.2
-
-
- commons-lang
- commons-lang
- 2.6
-
com.sun.jersey
jersey-client
1.11
-
- jline
- jline
- 0.9.94
-
-
- org.fusesource.jansi
- jansi
- 1.7
-
-
- org.codehaus.groovy
- groovy-all
- 1.8.5
-
-
-
- dist
-
- true
-
-
-
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- package
-
- copy-dependencies
-
-
- ${project.build.directory}/lib
-
-
-
-
-
-
-
-
-
diff --git a/client/src/main/java/org/apache/sqoop/client/ClientError.java b/client/src/main/java/org/apache/sqoop/client/ClientError.java
new file mode 100644
index 00000000..aafb5b08
--- /dev/null
+++ b/client/src/main/java/org/apache/sqoop/client/ClientError.java
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sqoop.client;
+
+import org.apache.sqoop.common.ErrorCode;
+
+public enum ClientError implements ErrorCode {
+
+ /** An unknown error has occurred. */
+ CLIENT_0000("An unknown error has occurred"),
+
+ /** There occurred exception on server side **/
+ CLIENT_0001("Server has returned exception"),
+
+ /** Polling time of submission status cannot be negative */
+ CLIENT_0002("Polling time of submission status cannot be negative"),
+
+ ;
+
+ private final String message;
+
+ private ClientError(String message) {
+ this.message = message;
+ }
+
+ public String getCode() {
+ return name();
+ }
+
+ public String getMessage() {
+ return message;
+ }
+}
diff --git a/client/src/main/java/org/apache/sqoop/client/SqoopClient.java b/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
index 158e46c2..f9e7ddd3 100644
--- a/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
+++ b/client/src/main/java/org/apache/sqoop/client/SqoopClient.java
@@ -17,7 +17,6 @@
*/
package org.apache.sqoop.client;
-import org.apache.sqoop.client.core.ClientError;
import org.apache.sqoop.client.request.SqoopRequests;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.json.ConnectorBean;
@@ -396,7 +395,7 @@ public MSubmission startSubmission(long jid) {
*/
public MSubmission startSubmission(long jid, SubmissionCallback callback, long pollTime) throws InterruptedException {
if(pollTime <= 0) {
- throw new SqoopException(ClientError.CLIENT_0008);
+ throw new SqoopException(ClientError.CLIENT_0002);
}
boolean first = true;
MSubmission submission = requests.createSubmission(jid).getSubmissions().get(0);
diff --git a/client/src/main/java/org/apache/sqoop/client/request/Request.java b/client/src/main/java/org/apache/sqoop/client/request/Request.java
index befb793c..d9229f5f 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/Request.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/Request.java
@@ -25,7 +25,8 @@
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.WebResource.Builder;
import com.sun.jersey.api.client.filter.ClientFilter;
-import org.apache.sqoop.client.core.ClientError;
+
+import org.apache.sqoop.client.ClientError;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.common.SqoopProtocolConstants;
import org.apache.sqoop.json.ThrowableBean;
@@ -99,7 +100,7 @@ public ClientResponse handle(ClientRequest cr) {
JSONObject json = (JSONObject) JSONValue.parse(responseText);
ex.restore(json);
- throw new SqoopException(ClientError.CLIENT_0006, ex.getThrowable());
+ throw new SqoopException(ClientError.CLIENT_0001, ex.getThrowable());
}
}
diff --git a/dist/pom.xml b/dist/pom.xml
index dd67f852..9186a38b 100644
--- a/dist/pom.xml
+++ b/dist/pom.xml
@@ -40,7 +40,7 @@ limitations under the License.
org.apache.sqoop
- sqoop-client
+ sqoop-shell
@@ -167,16 +167,16 @@ limitations under the License.
-
-
-
+
+
+
-
+
diff --git a/dist/src/main/bin/sqoop.sh b/dist/src/main/bin/sqoop.sh
index 88adb049..e3ed5ef4 100755
--- a/dist/src/main/bin/sqoop.sh
+++ b/dist/src/main/bin/sqoop.sh
@@ -51,7 +51,7 @@ cd ${BASEDIR}
echo "Sqoop home directory: ${BASEDIR}"
CATALINA_BIN=${CATALINA_BIN:-server/bin}
-CLIENT_LIB=${CLIENT_LIB:-client/lib}
+CLIENT_LIB=${CLIENT_LIB:-shell/lib}
setup_catalina_opts() {
# The Java System properties 'sqoop.http.port' and 'sqoop.admin.port' are
@@ -107,7 +107,7 @@ case $COMMAND in
if [ -n "${JAVA_HOME}" ] ; then
EXEC_JAVA="${JAVA_HOME}/bin/java"
fi
- ${EXEC_JAVA} -classpath ${CLASSPATH} org.apache.sqoop.client.shell.SqoopShell $2
+ ${EXEC_JAVA} -classpath ${CLASSPATH} org.apache.sqoop.shell.SqoopShell $2
;;
*)
diff --git a/pom.xml b/pom.xml
index 5ea06337..513b6d05 100644
--- a/pom.xml
+++ b/pom.xml
@@ -246,6 +246,11 @@ limitations under the License.
org.apache.sqoop
sqoop-client
${project.version}
+
+
+ org.apache.sqoop
+ sqoop-shell
+ ${project.version}
org.apache.sqoop
@@ -413,6 +418,7 @@ limitations under the License.
repository
server
client
+ shell
docs
connector
execution
diff --git a/shell/pom.xml b/shell/pom.xml
new file mode 100644
index 00000000..947eab02
--- /dev/null
+++ b/shell/pom.xml
@@ -0,0 +1,108 @@
+
+
+
+
+ 4.0.0
+
+
+ org.apache
+ sqoop
+ 2.0.0-SNAPSHOT
+
+
+ org.apache.sqoop
+ sqoop-shell
+ Sqoop Shell
+
+
+
+ org.mockito
+ mockito-all
+ test
+
+
+ org.apache.sqoop
+ sqoop-common
+
+
+ org.apache.sqoop
+ sqoop-client
+
+
+ commons-cli
+ commons-cli
+ 1.2
+
+
+ commons-lang
+ commons-lang
+ 2.6
+
+
+ com.sun.jersey
+ jersey-client
+ 1.11
+
+
+ jline
+ jline
+ 0.9.94
+
+
+ org.fusesource.jansi
+ jansi
+ 1.7
+
+
+ org.codehaus.groovy
+ groovy-all
+ 1.8.5
+
+
+
+
+
+ dist
+
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-dependency-plugin
+
+
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}/lib
+
+
+
+
+
+
+
+
+
+
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java b/shell/src/main/java/org/apache/sqoop/shell/CloneCommand.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/CloneCommand.java
index 283b0259..980a9086 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CloneCommand.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Client side cloning of connection and job objects.
@@ -42,7 +42,7 @@ public CloneCommand(Shell shell) {
public Object executeCommand(List args) {
if(!isInteractive()) {
- throw new SqoopException(ClientError.CLIENT_0007, "clone");
+ throw new SqoopException(ShellError.SHELL_0007, "clone");
}
if (args.size() == 0) {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/CloneConnectionFunction.java
similarity index 90%
rename from client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/CloneConnectionFunction.java
index 05389010..856abaae 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CloneConnectionFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MConnection;
import org.apache.sqoop.model.MPersistableEntity;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormFiller.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
*
@@ -56,7 +56,7 @@ public Object executeFunction(CommandLine line) {
try {
cloneConnection(getLong(line, Constants.OPT_XID));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/CloneJobFunction.java
similarity index 90%
rename from client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/CloneJobFunction.java
index 6f62813c..3e230251 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CloneJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CloneJobFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MJob;
import org.apache.sqoop.model.MPersistableEntity;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormFiller.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
*
@@ -55,7 +55,7 @@ public Object executeFunction(CommandLine line) {
try {
cloneJob(getLong(line, Constants.OPT_JID));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java b/shell/src/main/java/org/apache/sqoop/shell/CreateCommand.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/CreateCommand.java
index ac555e18..e62ce08c 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CreateCommand.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
@@ -42,7 +42,7 @@ public CreateCommand(Shell shell) {
public Object executeCommand(List args) {
if(!isInteractive()) {
- throw new SqoopException(ClientError.CLIENT_0007, "create");
+ throw new SqoopException(ShellError.SHELL_0007, "create");
}
if (args.size() == 0) {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/CreateConnectionFunction.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/CreateConnectionFunction.java
index 04b240c4..5fbf0a3d 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CreateConnectionFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.FormDisplayer;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MConnection;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.FormDisplayer;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormFiller.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
*
@@ -55,7 +55,7 @@ public Object executeFunction(CommandLine line) {
try {
createConnection(getLong(line, Constants.OPT_CID));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
similarity index 89%
rename from client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
index cc4d546e..6e4f04bf 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/CreateJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/CreateJobFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.FormDisplayer;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.FormDisplayer;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormFiller.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
* Handles creation of new job objects.
@@ -67,7 +67,7 @@ public Object executeFunction(CommandLine line) {
createJob(getLong(line, Constants.OPT_XID),
line.getOptionValue(Constants.OPT_TYPE));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java b/shell/src/main/java/org/apache/sqoop/shell/DeleteCommand.java
similarity index 92%
rename from client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/DeleteCommand.java
index 6a5b3a14..abfcf2ed 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DeleteCommand.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
similarity index 90%
rename from client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
index 18d3a70f..c1237320 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DeleteConnectionFunction.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/DeleteJobFunction.java
similarity index 91%
rename from client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/DeleteJobFunction.java
index 736be20d..d4095b73 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DeleteJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DeleteJobFunction.java
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.client.request.JobRequest;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Handles deletion of a job object.
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DisableCommand.java b/shell/src/main/java/org/apache/sqoop/shell/DisableCommand.java
similarity index 93%
rename from client/src/main/java/org/apache/sqoop/client/shell/DisableCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/DisableCommand.java
index 5cbd6db0..5a6d942c 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DisableCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DisableCommand.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DisableConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/DisableConnectionFunction.java
similarity index 86%
rename from client/src/main/java/org/apache/sqoop/client/shell/DisableConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/DisableConnectionFunction.java
index e04292a9..f1196601 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DisableConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DisableConnectionFunction.java
@@ -15,15 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.model.MConnection;
-import org.apache.sqoop.validation.Status;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Handles enabling of a connection object
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/DisableJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/DisableJobFunction.java
similarity index 87%
rename from client/src/main/java/org/apache/sqoop/client/shell/DisableJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/DisableJobFunction.java
index 5962cd2a..a87e51f3 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/DisableJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/DisableJobFunction.java
@@ -15,16 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.client.request.JobRequest;
-import org.apache.sqoop.model.MJob;
-import org.apache.sqoop.validation.Status;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Handles disabling of a job object.
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/EnableCommand.java b/shell/src/main/java/org/apache/sqoop/shell/EnableCommand.java
similarity index 92%
rename from client/src/main/java/org/apache/sqoop/client/shell/EnableCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/EnableCommand.java
index 8a2c1c76..3b8c0b1e 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/EnableCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/EnableCommand.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/EnableConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/EnableConnectionFunction.java
similarity index 86%
rename from client/src/main/java/org/apache/sqoop/client/shell/EnableConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/EnableConnectionFunction.java
index ed6dc3c8..f782b165 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/EnableConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/EnableConnectionFunction.java
@@ -15,15 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.model.MConnection;
-import org.apache.sqoop.validation.Status;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Handles enabling of a connection object
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/EnableJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/EnableJobFunction.java
similarity index 87%
rename from client/src/main/java/org/apache/sqoop/client/shell/EnableJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/EnableJobFunction.java
index 9e4e3203..20c80dca 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/EnableJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/EnableJobFunction.java
@@ -15,16 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.client.request.JobRequest;
-import org.apache.sqoop.model.MJob;
-import org.apache.sqoop.validation.Status;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Handles disabling of a job object.
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java b/shell/src/main/java/org/apache/sqoop/shell/HelpCommand.java
similarity index 94%
rename from client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/HelpCommand.java
index c6f831d6..e8d531fe 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/HelpCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/HelpCommand.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.text.MessageFormat;
import java.util.Iterator;
@@ -23,15 +23,15 @@
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Command;
import org.codehaus.groovy.tools.shell.CommandSupport;
import org.codehaus.groovy.tools.shell.Shell;
import org.codehaus.groovy.tools.shell.util.SimpleCompletor;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
public class HelpCommand extends CommandSupport {
@@ -125,7 +125,7 @@ private void help(String name) {
if (command == null) {
String msg = MessageFormat.format(resource.getString(Constants
.RES_UNRECOGNIZED_CMD), name);
- throw new SqoopException(ClientError.CLIENT_0001, msg);
+ throw new SqoopException(ShellError.SHELL_0001, msg);
}
printlnResource(Constants.RES_HELP_CMD_USAGE, command.getName(), command.getUsage());
println();
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java b/shell/src/main/java/org/apache/sqoop/shell/SetCommand.java
similarity index 92%
rename from client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/SetCommand.java
index c8311238..548def0c 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SetCommand.java
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.List;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
public class SetCommand extends SqoopCommand {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/SetOptionFunction.java
similarity index 94%
rename from client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/SetOptionFunction.java
index e843edef..1c43dcee 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetOptionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SetOptionFunction.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java b/shell/src/main/java/org/apache/sqoop/shell/SetServerFunction.java
similarity index 95%
rename from client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/SetServerFunction.java
index 41fc17a6..abd9ceac 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SetServerFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SetServerFunction.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
@SuppressWarnings("serial")
public class SetServerFunction extends SqoopFunction {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShellEnvironment.java b/shell/src/main/java/org/apache/sqoop/shell/ShellEnvironment.java
similarity index 96%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShellEnvironment.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShellEnvironment.java
index 41a8cd3f..8be2e544 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShellEnvironment.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShellEnvironment.java
@@ -15,12 +15,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.sqoop.client.SqoopClient;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.IO;
import java.net.MalformedURLException;
@@ -129,7 +129,7 @@ public static void setServerUrl(String ustr){
client.setServerUrl(getServerUrl());
} catch (MalformedURLException ex) {
- throw new SqoopException(ClientError.CLIENT_0003, ex);
+ throw new SqoopException(ShellError.SHELL_0003, ex);
}
}
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java b/shell/src/main/java/org/apache/sqoop/shell/ShowCommand.java
similarity index 96%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowCommand.java
index 4245717f..672fa853 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowCommand.java
@@ -15,13 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.List;
-import org.apache.sqoop.client.core.Constants;
+
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
public class ShowCommand extends SqoopCommand
{
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
similarity index 94%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
index 94f92b30..b7204ffe 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectionFunction.java
@@ -15,20 +15,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.TableDisplayer;
import org.apache.sqoop.model.MConnection;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.TableDisplayer;
import java.text.DateFormat;
import java.util.LinkedList;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormDisplayer.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormDisplayer.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectorFunction.java
similarity index 93%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowConnectorFunction.java
index b053339b..97a4ab2a 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowConnectorFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowConnectorFunction.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.Collection;
import java.util.LinkedList;
@@ -23,12 +23,12 @@
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.TableDisplayer;
import org.apache.sqoop.model.MConnector;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.TableDisplayer;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormDisplayer.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormDisplayer.*;
@SuppressWarnings("serial")
public class ShowConnectorFunction extends SqoopFunction {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowFrameworkFunction.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowFrameworkFunction.java
index 58b2c6e9..28497db2 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowFrameworkFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowFrameworkFunction.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.model.MFramework;
+import org.apache.sqoop.shell.core.Constants;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormDisplayer.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormDisplayer.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
similarity index 93%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
index 97a240b2..fc6f4162 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowJobFunction.java
@@ -15,20 +15,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.TableDisplayer;
import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.TableDisplayer;
import java.text.DateFormat;
import java.util.LinkedList;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
-import static org.apache.sqoop.client.utils.FormDisplayer.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormDisplayer.*;
/**
*
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowOptionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowOptionFunction.java
similarity index 93%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowOptionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowOptionFunction.java
index 81c56128..5e3c3ff9 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowOptionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowOptionFunction.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Show client internal options
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowServerFunction.java
similarity index 95%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowServerFunction.java
index 110f67ef..ec97e637 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowServerFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowServerFunction.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
@SuppressWarnings("serial")
public class ShowServerFunction extends SqoopFunction {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowSubmissionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowSubmissionFunction.java
similarity index 91%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowSubmissionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowSubmissionFunction.java
index 666eb7a7..a592a986 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowSubmissionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowSubmissionFunction.java
@@ -15,20 +15,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.SubmissionDisplayer;
-import org.apache.sqoop.client.utils.TableDisplayer;
import org.apache.sqoop.model.MSubmission;
-import org.apache.sqoop.submission.SubmissionStatus;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.SubmissionDisplayer;
+import org.apache.sqoop.shell.utils.TableDisplayer;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
public class ShowSubmissionFunction extends SqoopFunction {
@SuppressWarnings("static-access")
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/ShowVersionFunction.java
similarity index 96%
rename from client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/ShowVersionFunction.java
index 8e17f67a..764b7541 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/ShowVersionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/ShowVersionFunction.java
@@ -15,18 +15,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.Arrays;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.client.request.VersionRequest;
import org.apache.sqoop.common.VersionInfo;
import org.apache.sqoop.json.VersionBean;
+import org.apache.sqoop.shell.core.Constants;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
@SuppressWarnings("serial")
public class ShowVersionFunction extends SqoopFunction {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java b/shell/src/main/java/org/apache/sqoop/shell/SqoopCommand.java
similarity index 95%
rename from client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/SqoopCommand.java
index 2188482a..241d120b 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SqoopCommand.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import groovy.lang.GroovyShell;
import groovy.lang.MissingPropertyException;
@@ -23,8 +23,8 @@
import java.util.*;
-import org.apache.sqoop.client.core.ClientError;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
import org.codehaus.groovy.tools.shell.ComplexCommandSupport;
import org.codehaus.groovy.tools.shell.Shell;
@@ -144,7 +144,7 @@ protected void resolveVariables(List arg) {
temp.add(scr.run().toString());
}
catch(MissingPropertyException e) {
- throw new SqoopException(ClientError.CLIENT_0004, e.getMessage(), e);
+ throw new SqoopException(ShellError.SHELL_0004, e.getMessage(), e);
}
}
Collections.copy(arg, temp);
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java b/shell/src/main/java/org/apache/sqoop/shell/SqoopFunction.java
similarity index 90%
rename from client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/SqoopFunction.java
index bf267615..675a796d 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SqoopFunction.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.Iterator;
import java.util.List;
@@ -26,10 +26,10 @@
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
-import org.apache.sqoop.client.core.ClientError;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
@SuppressWarnings("serial")
abstract public class SqoopFunction extends Options {
@@ -63,7 +63,7 @@ protected CommandLine parseOptions(Options options, int start, List argl
try {
line = parser.parse(options, args);
} catch (ParseException e) {
- throw new SqoopException(ClientError.CLIENT_0003, e.getMessage(), e);
+ throw new SqoopException(ShellError.SHELL_0003, e.getMessage(), e);
}
return line;
}
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java b/shell/src/main/java/org/apache/sqoop/shell/SqoopShell.java
similarity index 96%
rename from client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
rename to shell/src/main/java/org/apache/sqoop/shell/SqoopShell.java
index f4ea3be1..900c0e57 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/SqoopShell.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/SqoopShell.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.io.BufferedReader;
import java.io.File;
@@ -24,15 +24,15 @@
import java.util.HashSet;
import java.util.Iterator;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.ThrowableDisplayer;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.ThrowableDisplayer;
import org.codehaus.groovy.runtime.MethodClosure;
import org.codehaus.groovy.tools.shell.Command;
import org.codehaus.groovy.tools.shell.CommandRegistry;
import org.codehaus.groovy.tools.shell.Groovysh;
import org.codehaus.groovy.tools.shell.IO.Verbosity;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Main entry point to Sqoop client.
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StartCommand.java b/shell/src/main/java/org/apache/sqoop/shell/StartCommand.java
similarity index 91%
rename from client/src/main/java/org/apache/sqoop/client/shell/StartCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/StartCommand.java
index 7293f563..f03e08fe 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StartCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StartCommand.java
@@ -15,15 +15,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.List;
import org.apache.log4j.Logger;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.printlnResource;
+import static org.apache.sqoop.shell.ShellEnvironment.printlnResource;
public class StartCommand extends SqoopCommand {
public static final Logger LOG = Logger.getLogger(StartCommand.class);
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StartJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/StartJobFunction.java
similarity index 86%
rename from client/src/main/java/org/apache/sqoop/client/shell/StartJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/StartJobFunction.java
index 2e1c8d3a..02148de4 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StartJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StartJobFunction.java
@@ -15,21 +15,21 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.client;
-import static org.apache.sqoop.client.shell.ShellEnvironment.getPollTimeout;
-import static org.apache.sqoop.client.shell.ShellEnvironment.resourceString;
+import static org.apache.sqoop.shell.ShellEnvironment.client;
+import static org.apache.sqoop.shell.ShellEnvironment.getPollTimeout;
+import static org.apache.sqoop.shell.ShellEnvironment.resourceString;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
import org.apache.log4j.Logger;
import org.apache.sqoop.client.SubmissionCallback;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.SubmissionDisplayer;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MSubmission;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.SubmissionDisplayer;
public class StartJobFunction extends SqoopFunction {
public static final Logger LOG = Logger.getLogger(StartJobFunction.class);
@@ -72,7 +72,7 @@ public void finished(MSubmission submission) {
try {
client.startSubmission(getLong(line, Constants.OPT_JID), callback, pollTimeout);
} catch (InterruptedException e) {
- throw new SqoopException(ClientError.CLIENT_0009, e);
+ throw new SqoopException(ShellError.SHELL_0008, e);
}
} else if (line.hasOption(Constants.OPT_JID)) {
MSubmission submission = client.startSubmission(getLong(line, Constants.OPT_JID));
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StatusCommand.java b/shell/src/main/java/org/apache/sqoop/shell/StatusCommand.java
similarity index 91%
rename from client/src/main/java/org/apache/sqoop/client/shell/StatusCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/StatusCommand.java
index 5aab0352..184892a3 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StatusCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StatusCommand.java
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.List;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.printlnResource;
+import static org.apache.sqoop.shell.ShellEnvironment.printlnResource;
public class StatusCommand extends SqoopCommand {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StatusJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/StatusJobFunction.java
similarity index 86%
rename from client/src/main/java/org/apache/sqoop/client/shell/StatusJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/StatusJobFunction.java
index b854a90a..be0de8c2 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StatusJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StatusJobFunction.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.client;
-import static org.apache.sqoop.client.shell.ShellEnvironment.resourceString;
+import static org.apache.sqoop.shell.ShellEnvironment.client;
+import static org.apache.sqoop.shell.ShellEnvironment.resourceString;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.SubmissionDisplayer;
import org.apache.sqoop.model.MSubmission;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.SubmissionDisplayer;
import org.apache.sqoop.submission.SubmissionStatus;
public class StatusJobFunction extends SqoopFunction{
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StopCommand.java b/shell/src/main/java/org/apache/sqoop/shell/StopCommand.java
similarity index 91%
rename from client/src/main/java/org/apache/sqoop/client/shell/StopCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/StopCommand.java
index 154c58ef..698bca77 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StopCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StopCommand.java
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import java.util.List;
-import org.apache.sqoop.client.core.Constants;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.printlnResource;
+import static org.apache.sqoop.shell.ShellEnvironment.printlnResource;
public class StopCommand extends SqoopCommand {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/StopJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/StopJobFunction.java
similarity index 85%
rename from client/src/main/java/org/apache/sqoop/client/shell/StopJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/StopJobFunction.java
index 49ab461c..6c0e3c28 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/StopJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/StopJobFunction.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import static org.apache.sqoop.client.shell.ShellEnvironment.client;
-import static org.apache.sqoop.client.shell.ShellEnvironment.resourceString;
+import static org.apache.sqoop.shell.ShellEnvironment.client;
+import static org.apache.sqoop.shell.ShellEnvironment.resourceString;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.SubmissionDisplayer;
import org.apache.sqoop.model.MSubmission;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.SubmissionDisplayer;
public class StopJobFunction extends SqoopFunction {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java b/shell/src/main/java/org/apache/sqoop/shell/UpdateCommand.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
rename to shell/src/main/java/org/apache/sqoop/shell/UpdateCommand.java
index f16745c0..9262ccd0 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/UpdateCommand.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/UpdateCommand.java
@@ -15,16 +15,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
import org.codehaus.groovy.tools.shell.Shell;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
*
@@ -42,7 +42,7 @@ public UpdateCommand(Shell shell) {
public Object executeCommand(List args) {
if(!isInteractive()) {
- throw new SqoopException(ClientError.CLIENT_0007, "update");
+ throw new SqoopException(ShellError.SHELL_0007, "update");
}
if (args.size() == 0) {
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/UpdateConnectionFunction.java b/shell/src/main/java/org/apache/sqoop/shell/UpdateConnectionFunction.java
similarity index 88%
rename from client/src/main/java/org/apache/sqoop/client/shell/UpdateConnectionFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/UpdateConnectionFunction.java
index 8556e2bc..c062fe67 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/UpdateConnectionFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/UpdateConnectionFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.FormDisplayer;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MConnection;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.FormDisplayer;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.utils.FormFiller.*;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
*
@@ -55,7 +55,7 @@ public Object executeFunction(CommandLine line) {
try {
updateConnection(getLong(line, Constants.OPT_XID));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/shell/UpdateJobFunction.java b/shell/src/main/java/org/apache/sqoop/shell/UpdateJobFunction.java
similarity index 87%
rename from client/src/main/java/org/apache/sqoop/client/shell/UpdateJobFunction.java
rename to shell/src/main/java/org/apache/sqoop/shell/UpdateJobFunction.java
index 425a53f3..da1e0c57 100644
--- a/client/src/main/java/org/apache/sqoop/client/shell/UpdateJobFunction.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/UpdateJobFunction.java
@@ -15,23 +15,23 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.shell;
+package org.apache.sqoop.shell;
import jline.ConsoleReader;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
-import org.apache.sqoop.client.core.ClientError;
-import org.apache.sqoop.client.core.Constants;
-import org.apache.sqoop.client.utils.FormDisplayer;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.model.MJob;
+import org.apache.sqoop.shell.core.ShellError;
+import org.apache.sqoop.shell.core.Constants;
+import org.apache.sqoop.shell.utils.FormDisplayer;
import org.apache.sqoop.validation.Status;
import java.io.IOException;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.utils.FormFiller.*;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.utils.FormFiller.*;
/**
*
@@ -55,7 +55,7 @@ public Object executeFunction(CommandLine line) {
try {
updateJob(getLong(line, Constants.OPT_JID));
} catch (IOException ex) {
- throw new SqoopException(ClientError.CLIENT_0005, ex);
+ throw new SqoopException(ShellError.SHELL_0005, ex);
}
return null;
diff --git a/client/src/main/java/org/apache/sqoop/client/core/Constants.java b/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
similarity index 99%
rename from client/src/main/java/org/apache/sqoop/client/core/Constants.java
rename to shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
index 999790d5..0e33d420 100644
--- a/client/src/main/java/org/apache/sqoop/client/core/Constants.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/core/Constants.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.core;
+package org.apache.sqoop.shell.core;
/**
*
@@ -23,7 +23,7 @@
public class Constants {
// General string constants
- public static final String RESOURCE_NAME = "client-resource";
+ public static final String RESOURCE_NAME = "shell-resource";
public static final String BOLD_STR_SEQUENCE = "@|bold";
public static final String END_STR_SEQUENCE = "|@";
diff --git a/client/src/main/java/org/apache/sqoop/client/core/ClientError.java b/shell/src/main/java/org/apache/sqoop/shell/core/ShellError.java
similarity index 67%
rename from client/src/main/java/org/apache/sqoop/client/core/ClientError.java
rename to shell/src/main/java/org/apache/sqoop/shell/core/ShellError.java
index d96f44e1..e5a99f1c 100644
--- a/client/src/main/java/org/apache/sqoop/client/core/ClientError.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/core/ShellError.java
@@ -15,47 +15,44 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.core;
+package org.apache.sqoop.shell.core;
import org.apache.sqoop.common.ErrorCode;
-public enum ClientError implements ErrorCode {
+public enum ShellError implements ErrorCode {
/** An unknown error has occurred. */
- CLIENT_0000("An unknown error has occurred"),
+ SHELL_0000("An unknown error has occurred"),
/** The specified command is not recognized. */
- CLIENT_0001("The specified command is not recognized"),
+ SHELL_0001("The specified command is not recognized"),
/** The specified function is not recognized. */
- CLIENT_0002("The specified function is not recognized"),
+ SHELL_0002("The specified function is not recognized"),
/** An error has occurred when parsing options. */
- CLIENT_0003("An error has occurred when parsing options"),
+ SHELL_0003("An error has occurred when parsing options"),
/** Unable to resolve the variables. */
- CLIENT_0004("Unable to resolve the variables"),
+ SHELL_0004("Unable to resolve the variables"),
/** We're not able to get user input */
- CLIENT_0005("Can't get user input"),
+ SHELL_0005("Can't get user input"),
/** There occurred exception on server side **/
- CLIENT_0006("Server has returned exception"),
+ SHELL_0006("Server has returned exception"),
/** Command not compatible with batch mode */
- CLIENT_0007("Command not compatible with batch mode"),
-
- /** Polling time of submission status cannot be negative */
- CLIENT_0008("Polling time of submission status cannot be negative"),
+ SHELL_0007("Command not compatible with batch mode"),
/** Job Submission : Cannot sleep */
- CLIENT_0009("Cannot sleep"),
+ SHELL_0008("Cannot sleep"),
;
private final String message;
- private ClientError(String message) {
+ private ShellError(String message) {
this.message = message;
}
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java b/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
similarity index 98%
rename from client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
rename to shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
index b044e222..56e0b4e9 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/FormDisplayer.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/FormDisplayer.java
@@ -15,10 +15,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.utils;
+package org.apache.sqoop.shell.utils;
import org.apache.commons.lang.StringUtils;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.model.MAccountableEntity;
import org.apache.sqoop.model.MBooleanInput;
import org.apache.sqoop.model.MConnection;
@@ -32,6 +31,7 @@
import org.apache.sqoop.model.MJobForms;
import org.apache.sqoop.model.MMapInput;
import org.apache.sqoop.model.MStringInput;
+import org.apache.sqoop.shell.core.Constants;
import org.apache.sqoop.validation.Status;
import java.util.ArrayList;
@@ -40,7 +40,7 @@
import java.util.Map;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Convenience static methods for displaying form related information
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java b/shell/src/main/java/org/apache/sqoop/shell/utils/FormFiller.java
similarity index 99%
rename from client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
rename to shell/src/main/java/org/apache/sqoop/shell/utils/FormFiller.java
index 2fbf129d..9bc0b936 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/FormFiller.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/FormFiller.java
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.utils;
+package org.apache.sqoop.shell.utils;
import jline.ConsoleReader;
import org.apache.sqoop.model.MBooleanInput;
@@ -35,7 +35,7 @@
import java.util.HashMap;
import java.util.ResourceBundle;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Convenient methods for retrieving user input.
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/SubmissionDisplayer.java b/shell/src/main/java/org/apache/sqoop/shell/utils/SubmissionDisplayer.java
similarity index 97%
rename from client/src/main/java/org/apache/sqoop/client/utils/SubmissionDisplayer.java
rename to shell/src/main/java/org/apache/sqoop/shell/utils/SubmissionDisplayer.java
index cbc956da..1f61fb20 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/SubmissionDisplayer.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/SubmissionDisplayer.java
@@ -15,10 +15,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.utils;
+package org.apache.sqoop.shell.utils;
-import org.apache.sqoop.client.core.Constants;
import org.apache.sqoop.model.MSubmission;
+import org.apache.sqoop.shell.core.Constants;
import org.apache.sqoop.submission.SubmissionStatus;
import org.apache.sqoop.submission.counter.Counter;
import org.apache.sqoop.submission.counter.CounterGroup;
@@ -26,7 +26,7 @@
import java.text.SimpleDateFormat;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Class used for displaying or printing the submission details
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java b/shell/src/main/java/org/apache/sqoop/shell/utils/TableDisplayer.java
similarity index 97%
rename from client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java
rename to shell/src/main/java/org/apache/sqoop/shell/utils/TableDisplayer.java
index 487fa50f..51030d03 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/TableDisplayer.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/TableDisplayer.java
@@ -15,14 +15,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.utils;
+package org.apache.sqoop.shell.utils;
import org.apache.commons.lang.StringUtils;
import java.util.LinkedList;
import java.util.List;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Display table based data
diff --git a/client/src/main/java/org/apache/sqoop/client/utils/ThrowableDisplayer.java b/shell/src/main/java/org/apache/sqoop/shell/utils/ThrowableDisplayer.java
similarity index 92%
rename from client/src/main/java/org/apache/sqoop/client/utils/ThrowableDisplayer.java
rename to shell/src/main/java/org/apache/sqoop/shell/utils/ThrowableDisplayer.java
index 8a34f344..6026a957 100644
--- a/client/src/main/java/org/apache/sqoop/client/utils/ThrowableDisplayer.java
+++ b/shell/src/main/java/org/apache/sqoop/shell/utils/ThrowableDisplayer.java
@@ -15,13 +15,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.sqoop.client.utils;
+package org.apache.sqoop.shell.utils;
import groovy.lang.MissingPropertyException;
-import org.apache.sqoop.client.core.ClientError;
import org.apache.sqoop.common.SqoopException;
+import org.apache.sqoop.shell.core.ShellError;
-import static org.apache.sqoop.client.shell.ShellEnvironment.*;
+import static org.apache.sqoop.shell.ShellEnvironment.*;
/**
* Pretty printing of Throwable objects
@@ -44,7 +44,7 @@ public static void errorHook(Throwable t) {
// If this is server exception from server
if(t instanceof SqoopException
- && ((SqoopException)t).getErrorCode() == ClientError.CLIENT_0006) {
+ && ((SqoopException)t).getErrorCode() == ShellError.SHELL_0006) {
print("@|red Server has returned exception: |@");
printThrowable(t.getCause(), isVerbose());
} else if(t.getClass() == MissingPropertyException.class) {
diff --git a/shell/src/main/resources/log4j.properties b/shell/src/main/resources/log4j.properties
new file mode 100644
index 00000000..af7e9f3e
--- /dev/null
+++ b/shell/src/main/resources/log4j.properties
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=WARN, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
diff --git a/client/src/main/resources/client-resource.properties b/shell/src/main/resources/shell-resource.properties
similarity index 100%
rename from client/src/main/resources/client-resource.properties
rename to shell/src/main/resources/shell-resource.properties
diff --git a/shell/src/test/resources/log4j.properties b/shell/src/test/resources/log4j.properties
new file mode 100644
index 00000000..44ffced2
--- /dev/null
+++ b/shell/src/test/resources/log4j.properties
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=DEBUG, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n