diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-05 20:04:07 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-07-05 20:04:07 +0000 |
commit | 4a4c29c19e0adf94868198ba1805c4e93fa51185 (patch) | |
tree | f620b4320fe1b2d0bfa8be742c31933a83a7a205 /sca-java-2.x/trunk/modules/shell/src | |
parent | 1a0660d880f0199ebdfb056e0657824f53c7aa0d (diff) |
Add installed command
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@960680 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/shell/src')
-rw-r--r-- | sca-java-2.x/trunk/modules/shell/src/main/java/org/apache/tuscany/sca/shell/Shell.java | 27 |
1 files changed, 26 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 de83eae259..7408778f89 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 @@ -56,7 +56,7 @@ public class Shell { private boolean useJline;
final List<String> history = new ArrayList<String>();
static final String[] COMMANDS = new String[] {"addDeploymentComposite", "addToDomainLevelComposite", "help",
- "install", "listDeployedCompostes", "listInstalledContributions",
+ "install", "installed", "listDeployedCompostes", "listInstalledContributions",
"printDomainLevelComposite", "removeFromDomainLevelComposite",
"remove", "start", "status", "stop"};
@@ -102,6 +102,28 @@ public class Shell { return true;
}
+ boolean installed(final List<String> toks) {
+ List<String> curis;
+ if (toks.size() > 1) {
+ curis = Arrays.asList(new String[]{toks.get(1)});
+ } else {
+ curis =node.getInstalledContributions();
+ }
+ for (String curi : curis) {
+ out.println(curi + " " + node.getInstalledContribution(curi).getLocation());
+ Contribution c = node.getInstalledContribution(curi);
+ for (String dcuri : node.getDeployedCompostes(curi)) {
+ for (Artifact a : c.getArtifacts()) {
+ if (dcuri.equals(a.getURI())) {
+ out.println(" " + dcuri + " " + ((Composite)a.getModel()).getName());
+ break;
+ }
+ }
+ }
+ }
+ return true;
+ }
+
private String getDefaultURI(String contributionURL) {
int lastDot = contributionURL.lastIndexOf('.');
int lastSep = contributionURL.lastIndexOf("/");
@@ -269,6 +291,9 @@ public class Shell { if (op.equals("install")) return new Callable<Boolean>() { public Boolean call() throws Exception {
return install(toks.get(1), toks);
}};
+ if (op.equals("installed")) return new Callable<Boolean>() { public Boolean call() throws Exception {
+ return installed(toks);
+ }};
if (op.equals("listDeployedCompostes")) return new Callable<Boolean>() { public Boolean call() throws Exception {
return listDeployedCompostes(toks.get(1));
}};
|