summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java27
-rw-r--r--sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java1
2 files changed, 27 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
index 4913a5c5fb..db6ec54a01 100644
--- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
+++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java
@@ -59,7 +59,7 @@ public class Shell {
private Map<String, Node> nodes = new HashMap<String, Node>();
public static final String[] COMMANDS = new String[] {"bye", "domain", "domains", "help", "install", "installed",
- "load", "printDomainLevelComposite", "remove", "run", "start", "status",
+ "load", "printDomainLevelComposite", "remove", "run", "save", "start", "status",
"stop"};
public static void main(final String[] args) throws Exception {
@@ -240,6 +240,11 @@ public class Shell {
return true;
}
+ boolean save(final String directory) throws IOException {
+ out.println("TODO: not yet implemented");
+ return true;
+ }
+
public boolean stop(List<String> toks) throws ActivationException {
String curi = toks.get(1);
if (toks.size() > 2) {
@@ -443,6 +448,12 @@ public class Shell {
return help(toks);
}
};
+ if (op.equalsIgnoreCase("save"))
+ return new Callable<Boolean>() {
+ public Boolean call() throws Exception {
+ return save(toks.get(1));
+ }
+ };
if (op.equalsIgnoreCase("stop"))
return new Callable<Boolean>() {
public Boolean call() throws Exception {
@@ -546,6 +557,8 @@ public class Shell {
helpRun();
} else if ("printDomainLevelComposite".equalsIgnoreCase(command)) {
helpPrintDomainLevelComposite();
+ } else if ("save".equalsIgnoreCase(command)) {
+ helpSave();
} else if ("start".equalsIgnoreCase(command)) {
helpStart();
} else if ("status".equalsIgnoreCase(command)) {
@@ -578,6 +591,7 @@ public class Shell {
out.println(" remove <contributionURI>");
out.println(" run <commandsFileURL>");
out.println(" printDomainLevelComposite");
+ out.println(" save <directoryPath>");
out.println(" start <curi> <compositeUri>|<contentURL>");
out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
out.println(" status [<curi> <compositeUri>]");
@@ -691,6 +705,17 @@ public class Shell {
out.println(" none");
}
+ void helpSave() {
+ out.println(" save <directoryPath>");
+ out.println();
+ out.println(" Saves the current Node state to directory.");
+ out.println(" This will include a node-config.xml file and copies of all artifacts");
+ out.println(" being used by the Node.");
+ out.println();
+ out.println(" Arguments:");
+ out.println(" directoryPath - (required) the URL of a directory to be used to store the state.");
+ }
+
void helpStart() {
out.println(" start <curi> <compositeUri>|<contentURL>");
out.println(" start <name> [<compositeUri>] <contributionURL> [-duris <uri,uri,...>]");
diff --git a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
index 616e34b7ad..5bcf772f57 100644
--- a/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
+++ b/sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/jline/TShellCompletor.java
@@ -59,6 +59,7 @@ public class TShellCompletor extends ArgumentCompletor {
completors.put("run", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()});
completors.put("addDeploymentComposite", new Completor[]{commandCompletor, new ICURICompletor(shell), new FileNameCompletor(), new NullCompletor()});
completors.put("printDomainLevelComposite", new Completor[]{commandCompletor, new NullCompletor()});
+ completors.put("save", new Completor[]{commandCompletor, new FileNameCompletor(), new NullCompletor()});
completors.put("start", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});
completors.put("status", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});
completors.put("stop", new Completor[]{commandCompletor, new ICURICompletor(shell), new CompositeURICompletor(shell), new NullCompletor()});