5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-05 00:00:22 +08:00

SQOOP-811: Client shell variable substitution for recent commands

(Vasanth kumar RJ via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2013-01-06 10:20:22 -08:00
parent 53688b54b5
commit 2016dedce6
8 changed files with 23 additions and 8 deletions

View File

@ -42,7 +42,7 @@ public CloneCommand(Shell shell) {
Constants.PRE_CLONE, Constants.SUF_INFO);
}
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_CLONE_USAGE), getUsage());

View File

@ -41,7 +41,7 @@ public CreateCommand(Shell shell) {
Constants.PRE_CREATE, Constants.SUF_INFO);
}
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_CREATE_USAGE), getUsage());

View File

@ -42,7 +42,7 @@ public DeleteCommand(Shell shell) {
@Override
@SuppressWarnings("unchecked")
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_DELETE_USAGE), getUsage());
if (args.size() == 0) {

View File

@ -40,7 +40,7 @@ protected SetCommand(Shell shell) {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_SET_USAGE), getUsage());
@ -49,7 +49,6 @@ public Object execute(List args) {
io.out.println();
return null;
}
resolveVariables(args);
String func = (String)args.get(0);
if (func.equals(Constants.FN_SERVER)) {
if (serverFunction == null) {

View File

@ -47,7 +47,7 @@ protected ShowCommand(Shell shell) {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_SHOW_USAGE), getUsage());
if (args.size() == 0) {

View File

@ -126,6 +126,22 @@ public String getHelp() {
return help;
}
/**
* Override execute method
*/
@Override
public Object execute(List args) {
resolveVariables(args);
return executeCommand(args);
}
/**
* Abstract executeCommand
* @param args list
* @return Object
*/
public abstract Object executeCommand(List args);
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void resolveVariables(List arg) {
List temp = new ArrayList();

View File

@ -43,7 +43,7 @@ public SubmissionCommand(Shell shell) {
Constants.PRE_SUBMISSION, Constants.SUF_INFO);
}
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_SUBMISSION_USAGE), getUsage());
if (args.size() == 0) {

View File

@ -40,7 +40,7 @@ public UpdateCommand(Shell shell) {
Constants.PRE_UPDATE, Constants.SUF_INFO);
}
public Object execute(List args) {
public Object executeCommand(List args) {
String usageMsg = MessageFormat.format(getResource().getString(Constants
.RES_UPDATE_USAGE), getUsage());
if (args.size() == 0) {