You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2013/12/18 13:22:54 UTC
[19/50] [abbrv] git commit: Code cleanup.
Code cleanup.
git-svn-id: https://svn.apache.org/repos/asf/karaf/cellar/trunk@1476912 13f79535-47bb-0310-9956-ffa450edef68
Project: http://git-wip-us.apache.org/repos/asf/karaf-cellar/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cellar/commit/9b430fe7
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/9b430fe7
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/9b430fe7
Branch: refs/heads/master
Commit: 9b430fe719d059efeae0d619cb72c3129062cedd
Parents: f52c623
Author: jbonofre <jb...@13f79535-47bb-0310-9956-ffa450edef68>
Authored: Mon Apr 29 07:40:38 2013 +0000
Committer: jbonofre <jb...@13f79535-47bb-0310-9956-ffa450edef68>
Committed: Mon Apr 29 07:40:38 2013 +0000
----------------------------------------------------------------------
.../cellar/shell/ClusterCommandSupport.java | 3 +++
.../karaf/cellar/shell/NodePingCommand.java | 8 +++----
.../karaf/cellar/shell/NodesListCommand.java | 2 +-
.../apache/karaf/cellar/shell/SyncCommand.java | 2 +-
.../shell/consumer/ConsumerStartCommand.java | 4 ++--
.../shell/consumer/ConsumerStatusCommand.java | 4 ++--
.../shell/consumer/ConsumerStopCommand.java | 2 +-
.../cellar/shell/consumer/ConsumerSupport.java | 3 +++
.../cellar/shell/group/GroupCreateCommand.java | 4 ++--
.../cellar/shell/group/GroupDeleteCommand.java | 9 ++-----
.../cellar/shell/group/GroupJoinCommand.java | 6 ++---
.../cellar/shell/group/GroupListCommand.java | 4 ++--
.../cellar/shell/group/GroupPickCommand.java | 8 +++----
.../cellar/shell/group/GroupQuitCommand.java | 6 ++---
.../cellar/shell/group/GroupSetCommand.java | 2 +-
.../karaf/cellar/shell/group/GroupSupport.java | 15 +++++++-----
.../shell/handler/HandlersStartCommand.java | 6 ++---
.../shell/handler/HandlersStatusCommand.java | 6 ++---
.../shell/handler/HandlersStopCommand.java | 6 ++---
.../cellar/shell/handler/HandlersSupport.java | 3 +++
.../shell/producer/ProducerStartCommand.java | 4 ++--
.../shell/producer/ProducerStatusCommand.java | 4 ++--
.../shell/producer/ProducerStopCommand.java | 4 ++--
.../cellar/shell/producer/ProducerSupport.java | 3 +++
.../OSGI-INF/blueprint/shell-cluster.xml | 25 --------------------
25 files changed, 64 insertions(+), 79 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/ClusterCommandSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/ClusterCommandSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/ClusterCommandSupport.java
index 9c814da..3ce20b4 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/ClusterCommandSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/ClusterCommandSupport.java
@@ -16,6 +16,9 @@ package org.apache.karaf.cellar.shell;
import org.apache.karaf.cellar.core.command.ExecutionContext;
import org.apache.karaf.cellar.core.shell.CellarCommandSupport;
+/**
+ * Abstract cluster shell command.
+ */
public abstract class ClusterCommandSupport extends CellarCommandSupport {
protected ExecutionContext executionContext;
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/NodePingCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/NodePingCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/NodePingCommand.java
index e4d61b4..f26b52f 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/NodePingCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/NodePingCommand.java
@@ -21,18 +21,18 @@ import org.apache.karaf.shell.commands.Command;
import java.util.Arrays;
import java.util.HashSet;
-@Command(scope = "cluster", name = "node-ping", description = "Ping a cluster node.")
+@Command(scope = "cluster", name = "node-ping", description = "Ping a cluster node")
public class NodePingCommand extends ClusterCommandSupport {
private static Long TIMEOUT = 5000L;
- @Argument(index = 0, name = "node", description = "The ID of the node to ping.", required = true, multiValued = false)
+ @Argument(index = 0, name = "node", description = "The ID of the node to ping", required = true, multiValued = false)
String nodeId;
- @Argument(index = 1, name = "iterations", description = "The number of iterations to perform.", required = false, multiValued = false)
+ @Argument(index = 1, name = "iterations", description = "The number of iterations to perform", required = false, multiValued = false)
Integer iterations = 10;
- @Argument(index = 2, name = "interval", description = "The time in millis to wait between iteration.", required = false, multiValued = false)
+ @Argument(index = 2, name = "interval", description = "The time in millis to wait between iteration", required = false, multiValued = false)
Long interval = 1000L;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/NodesListCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/NodesListCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/NodesListCommand.java
index 4cbf665..822538f 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/NodesListCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/NodesListCommand.java
@@ -18,7 +18,7 @@ import org.apache.karaf.shell.commands.Command;
import java.util.Set;
-@Command(scope = "cluster", name = "node-list", description = "List the nodes in the cluster.")
+@Command(scope = "cluster", name = "node-list", description = "List the nodes in the cluster")
public class NodesListCommand extends ClusterCommandSupport {
private static final String HEADER_FORMAT = " %-30s %-20s %-5s";
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/SyncCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/SyncCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/SyncCommand.java
index ba073b8..4782abd 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/SyncCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/SyncCommand.java
@@ -21,7 +21,7 @@ import org.osgi.framework.ServiceReference;
import java.util.Set;
-@Command(scope = "cluster", name = "sync", description = "Force the call of all cluster synchronizers available.")
+@Command(scope = "cluster", name = "sync", description = "Force the call of all cluster synchronizers available")
public class SyncCommand extends ClusterCommandSupport {
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStartCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStartCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStartCommand.java
index 4a7a99e..666613e 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStartCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStartCommand.java
@@ -19,10 +19,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "consumer-start", description = "Start an event consumer.")
+@Command(scope = "cluster", name = "consumer-start", description = "Start a cluster event consumer")
public class ConsumerStartCommand extends ConsumerSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStatusCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStatusCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStatusCommand.java
index 411977f..a3cd144 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStatusCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStatusCommand.java
@@ -18,10 +18,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "consumer-status", description = "Status of an event consumer.")
+@Command(scope = "cluster", name = "consumer-status", description = "Status of a cluster event consumer")
public class ConsumerStatusCommand extends ConsumerSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStopCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStopCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStopCommand.java
index 10651a5..92ef7c0 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStopCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerStopCommand.java
@@ -19,7 +19,7 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "consumer-stop", description = "Stop an event consumer.")
+@Command(scope = "cluster", name = "consumer-stop", description = "Stop a cluster event consumer")
public class ConsumerStopCommand extends ConsumerSupport {
@Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerSupport.java
index 267be4b..572f7ab 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/consumer/ConsumerSupport.java
@@ -24,6 +24,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+/**
+ * Generic cluster event consumer shell command support.
+ */
public abstract class ConsumerSupport extends ClusterCommandSupport {
protected static final String HEADER_FORMAT = " %-30s %-5s";
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java
index 569db8d..1f50a5a 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupCreateCommand.java
@@ -17,10 +17,10 @@ import org.apache.karaf.cellar.core.Group;
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
-@Command(scope = "cluster", name = "group-create", description = "Create a cluster group.")
+@Command(scope = "cluster", name = "group-create", description = "Create a cluster group")
public class GroupCreateCommand extends GroupSupport {
- @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+ @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
String groupName;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupDeleteCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupDeleteCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupDeleteCommand.java
index 85ceb0d..b587969 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupDeleteCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupDeleteCommand.java
@@ -14,18 +14,13 @@
package org.apache.karaf.cellar.shell.group;
import org.apache.karaf.cellar.core.Group;
-import org.apache.karaf.cellar.core.Node;
-import org.apache.karaf.cellar.core.control.ManageGroupAction;
import org.apache.karaf.shell.commands.Argument;
import org.apache.karaf.shell.commands.Command;
-import java.util.LinkedList;
-import java.util.List;
-
-@Command(scope = "cluster", name = "group-delete", description = "Delete a cluster group.")
+@Command(scope = "cluster", name = "group-delete", description = "Delete a cluster group")
public class GroupDeleteCommand extends GroupSupport {
- @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+ @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
String groupName;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupJoinCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupJoinCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupJoinCommand.java
index be0882c..c04dfff 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupJoinCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupJoinCommand.java
@@ -20,13 +20,13 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "group-join", description = "Join node(s) to a cluster group.")
+@Command(scope = "cluster", name = "group-join", description = "Join node(s) to a cluster group")
public class GroupJoinCommand extends GroupSupport {
- @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+ @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
String groupName;
- @Argument(index = 1, name = "node", description = "The node(s) ID.", required = true, multiValued = true)
+ @Argument(index = 1, name = "node", description = "The node(s) ID", required = true, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupListCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupListCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupListCommand.java
index 26bca79..6feb809 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupListCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupListCommand.java
@@ -19,10 +19,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "group-list", description = "List the cluster groups.")
+@Command(scope = "cluster", name = "group-list", description = "List the cluster groups")
public class GroupListCommand extends GroupSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupPickCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupPickCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupPickCommand.java
index 5fa3ac9..186cad3 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupPickCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupPickCommand.java
@@ -24,16 +24,16 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
-@Command(scope = "cluster", name = "group-pick", description = "Picks a number of nodes from one cluster group and moves them into an other.")
+@Command(scope = "cluster", name = "group-pick", description = "Picks a number of nodes from one cluster group and moves them into another")
public class GroupPickCommand extends GroupSupport {
- @Argument(index = 0, name = "sourceGroupName", description = "The source cluster group name.", required = true, multiValued = false)
+ @Argument(index = 0, name = "sourceGroupName", description = "The source cluster group name", required = true, multiValued = false)
String sourceGroupName;
- @Argument(index = 1, name = "targetGroupName", description = "The destination cluster group name.", required = true, multiValued = false)
+ @Argument(index = 1, name = "targetGroupName", description = "The destination cluster group name", required = true, multiValued = false)
String targetGroupName;
- @Argument(index = 2, name = "count", description = "The number of nodes to transfer.", required = false, multiValued = false)
+ @Argument(index = 2, name = "count", description = "The number of nodes to transfer", required = false, multiValued = false)
int count = 1;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupQuitCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupQuitCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupQuitCommand.java
index e4f2f3b..2272624 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupQuitCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupQuitCommand.java
@@ -20,13 +20,13 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "group-quit", description = "Quit node(s) from a cluster group.")
+@Command(scope = "cluster", name = "group-quit", description = "Quit node(s) from a cluster group")
public class GroupQuitCommand extends GroupSupport {
- @Argument(index = 0, name = "group", description = "The cluster group name.", required = true, multiValued = false)
+ @Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
String groupName;
- @Argument(index = 1, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 1, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSetCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSetCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSetCommand.java
index 8121912..1dbc9d0 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSetCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSetCommand.java
@@ -20,7 +20,7 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "group-set", description = "Set the target nodes to a cluster group.")
+@Command(scope = "cluster", name = "group-set", description = "Set the target nodes to a cluster group")
public class GroupSetCommand extends GroupSupport {
@Argument(index = 0, name = "group", description = "The cluster group name", required = true, multiValued = false)
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
index a71e0d0..9392b19 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/group/GroupSupport.java
@@ -25,6 +25,9 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+/**
+ * Generic cluster group shell command support.
+ */
public abstract class GroupSupport extends ClusterCommandSupport {
protected static final String HEADER_FORMAT = " %-20s %s";
@@ -37,12 +40,12 @@ public abstract class GroupSupport extends ClusterCommandSupport {
/**
* Executes the command.
*
- * @param action
- * @param group
- * @param nodeIds
- * @param suppressOutput
- * @return
- * @throws Exception
+ * @param action the group action to perform.
+ * @param group the cluster group name.
+ * @param nodeIds the node IDs.
+ * @param suppressOutput true to display command output, false else.
+ * @return the Object resulting of the command execution.
+ * @throws Exception in case of execution failure.
*/
protected Object doExecute(ManageGroupAction action, String group, Group source, Collection<String> nodeIds, Boolean suppressOutput) throws Exception {
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStartCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStartCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStartCommand.java
index a57bd8c..28cbbd8 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStartCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStartCommand.java
@@ -18,13 +18,13 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "handlers", description = "Start an event handler.")
+@Command(scope = "cluster", name = "handlers", description = "Start a cluster event handler")
public class HandlersStartCommand extends HandlersSupport {
- @Argument(index = 0, name = "handler", description = "The event handler ID.", required = true, multiValued = false)
+ @Argument(index = 0, name = "handler", description = "The cluster event handler ID", required = true, multiValued = false)
String handler;
- @Argument(index = 1, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 1, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStatusCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStatusCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStatusCommand.java
index 042dbca..d08c7f0 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStatusCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStatusCommand.java
@@ -18,13 +18,13 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "handler-status", description = "Status of a given event handler.")
+@Command(scope = "cluster", name = "handler-status", description = "Status of a cluster event handler")
public class HandlersStatusCommand extends HandlersSupport {
- @Argument(index = 0, name = "handler", description = "The event handler ID.", required = false, multiValued = false)
+ @Argument(index = 0, name = "handler", description = "The cluster event handler", required = false, multiValued = false)
String handler;
- @Argument(index = 1, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 1, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStopCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStopCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStopCommand.java
index f51902f..d77e294 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStopCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersStopCommand.java
@@ -18,13 +18,13 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "handler-stop", description = "Stop an event handler.")
+@Command(scope = "cluster", name = "handler-stop", description = "Stop a cluster event handler")
public class HandlersStopCommand extends HandlersSupport {
- @Argument(index = 0, name = "handler", description = "The event handler ID.", required = true, multiValued = false)
+ @Argument(index = 0, name = "handler", description = "The event handler", required = true, multiValued = false)
String handler;
- @Argument(index = 1, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 1, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersSupport.java
index d632d27..ddde493 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/handler/HandlersSupport.java
@@ -23,6 +23,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+/**
+ * Generic cluster event handler shell command support.
+ */
public abstract class HandlersSupport extends ClusterCommandSupport {
protected static final String HEADER_FORMAT = " %-30s %-5s %s";
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStartCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStartCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStartCommand.java
index 923d79c..5c5f520 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStartCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStartCommand.java
@@ -19,10 +19,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "producer-start", description = "Start an event producer.")
+@Command(scope = "cluster", name = "producer-start", description = "Start a cluster event producer")
public class ProducerStartCommand extends ProducerSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStatusCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStatusCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStatusCommand.java
index 0b96438..1dd2310 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStatusCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStatusCommand.java
@@ -18,10 +18,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "producer-status", description = "Status of an event producer.")
+@Command(scope = "cluster", name = "producer-status", description = "Status of a cluster event producer")
public class ProducerStatusCommand extends ProducerSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStopCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStopCommand.java b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStopCommand.java
index 535c722..e79ad5e 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStopCommand.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerStopCommand.java
@@ -19,10 +19,10 @@ import org.apache.karaf.shell.commands.Command;
import java.util.List;
-@Command(scope = "cluster", name = "producer-stop", description = "Stop an event producer.")
+@Command(scope = "cluster", name = "producer-stop", description = "Stop a cluster event producer")
public class ProducerStopCommand extends ProducerSupport {
- @Argument(index = 0, name = "node", description = "The node(s) ID.", required = false, multiValued = true)
+ @Argument(index = 0, name = "node", description = "The node(s) ID", required = false, multiValued = true)
List<String> nodes;
@Override
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerSupport.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerSupport.java b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerSupport.java
index fee1ad8..34f1bb0 100644
--- a/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerSupport.java
+++ b/shell/src/main/java/org/apache/karaf/cellar/shell/producer/ProducerSupport.java
@@ -24,6 +24,9 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+/**
+ * Generic cluster event producer shell command support.
+ */
public abstract class ProducerSupport extends ClusterCommandSupport {
protected static final String HEADER_FORMAT = " %-30s %-5s";
http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/9b430fe7/shell/src/main/resources/OSGI-INF/blueprint/shell-cluster.xml
----------------------------------------------------------------------
diff --git a/shell/src/main/resources/OSGI-INF/blueprint/shell-cluster.xml b/shell/src/main/resources/OSGI-INF/blueprint/shell-cluster.xml
index dd4fa8e..84a8f80 100644
--- a/shell/src/main/resources/OSGI-INF/blueprint/shell-cluster.xml
+++ b/shell/src/main/resources/OSGI-INF/blueprint/shell-cluster.xml
@@ -15,28 +15,24 @@
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" default-activation="lazy">
- <!-- Command Bundle -->
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.0.0">
<command name="cluster/node-list">
<action class="org.apache.karaf.cellar.shell.NodesListCommand">
<property name="clusterManager" ref="clusterManager"/>
</action>
</command>
-
<command name="cluster/node-ping">
<action class="org.apache.karaf.cellar.shell.NodePingCommand">
<property name="clusterManager" ref="clusterManager"/>
<property name="executionContext" ref="executionContext"/>
</action>
</command>
-
<command name="cluster/sync">
<action class="org.apache.karaf.cellar.shell.SyncCommand">
<property name="clusterManager" ref="clusterManager"/>
<property name="groupManager" ref="groupManager"/>
</action>
</command>
-
<command name="cluster/consumer-start">
<action class="org.apache.karaf.cellar.shell.consumer.ConsumerStartCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -46,7 +42,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/consumer-stop">
<action class="org.apache.karaf.cellar.shell.consumer.ConsumerStopCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -56,7 +51,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/consumer-status">
<action class="org.apache.karaf.cellar.shell.consumer.ConsumerStatusCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -66,7 +60,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/producer-start">
<action class="org.apache.karaf.cellar.shell.producer.ProducerStartCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -76,7 +69,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/producer-stop">
<action class="org.apache.karaf.cellar.shell.producer.ProducerStopCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -86,7 +78,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/producer-status">
<action class="org.apache.karaf.cellar.shell.producer.ProducerStatusCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -96,7 +87,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/handler-start">
<action class="org.apache.karaf.cellar.shell.handler.HandlersStartCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -106,7 +96,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/handler-stop">
<action class="org.apache.karaf.cellar.shell.handler.HandlersStopCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -116,7 +105,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/handler-status">
<action class="org.apache.karaf.cellar.shell.handler.HandlersStatusCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -126,7 +114,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/group-join">
<action class="org.apache.karaf.cellar.shell.group.GroupJoinCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -138,7 +125,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/group-quit">
<action class="org.apache.karaf.cellar.shell.group.GroupQuitCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -150,7 +136,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/group-set">
<action class="org.apache.karaf.cellar.shell.group.GroupSetCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -162,7 +147,6 @@
<ref component-id="allNodesCompleter"/>
</completers>
</command>
-
<command name="cluster/group-pick">
<action class="org.apache.karaf.cellar.shell.group.GroupPickCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -173,7 +157,6 @@
<ref component-id="allGroupCompleter"/>
</completers>
</command>
-
<command name="cluster/group-list">
<action class="org.apache.karaf.cellar.shell.group.GroupListCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -181,7 +164,6 @@
<property name="executionContext" ref="executionContext"/>
</action>
</command>
-
<command name="cluster/group-create">
<action class="org.apache.karaf.cellar.shell.group.GroupCreateCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -189,7 +171,6 @@
<property name="executionContext" ref="executionContext"/>
</action>
</command>
-
<command name="cluster/group-delete">
<action class="org.apache.karaf.cellar.shell.group.GroupDeleteCommand">
<property name="clusterManager" ref="clusterManager"/>
@@ -200,27 +181,21 @@
<ref component-id="allGroupCompleter"/>
</completers>
</command>
-
</command-bundle>
- <!-- Reference to the Cluster Manager -->
<reference id="clusterManager" interface="org.apache.karaf.cellar.core.ClusterManager" availability="optional"/>
<reference id="groupManager" interface="org.apache.karaf.cellar.core.GroupManager" availability="optional"/>
<reference id="executionContext" interface="org.apache.karaf.cellar.core.command.ExecutionContext" availability="optional"/>
- <!-- Completers -->
<bean id="allNodesCompleter" class="org.apache.karaf.cellar.core.shell.completer.AllNodeCompleter">
<property name="clusterManager" ref="clusterManager"/>
</bean>
-
<bean id="allGroupCompleter" class="org.apache.karaf.cellar.core.shell.completer.AllGroupsCompleter">
<property name="groupManager" ref="groupManager"/>
</bean>
-
<bean id="localGroupCompleter" class="org.apache.karaf.cellar.core.shell.completer.LocalGroupsCompleter">
<property name="groupManager" ref="groupManager"/>
</bean>
-
<bean id="otherGroupCompleter" class="org.apache.karaf.cellar.core.shell.completer.OtherGroupsCompleter">
<property name="groupManager" ref="groupManager"/>
</bean>