Code cleanup. git-svn-id: https://svn.apache.org/repos/asf/karaf/cellar/branches/cellar-2.3.x@1476913 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/aaad133c Tree: http://git-wip-us.apache.org/repos/asf/karaf-cellar/tree/aaad133c Diff: http://git-wip-us.apache.org/repos/asf/karaf-cellar/diff/aaad133c Branch: refs/heads/cellar-2.3.x Commit: aaad133c1178e7ca862c781f93e4b4a8a1d5ae51 Parents: 2271d41 Author: jbonofre <jbonofre@13f79535-47bb-0310-9956-ffa450edef68> Authored: Mon Apr 29 08:00:31 2013 +0000 Committer: jbonofre <jbonofre@13f79535-47bb-0310-9956-ffa450edef68> Committed: Mon Apr 29 08:00:31 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 | 4 ++-- .../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 | 6 ++--- .../karaf/cellar/shell/group/GroupSupport.java | 25 +++++++++++--------- .../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, 72 insertions(+), 87 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/aaad133c/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..36d5115 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 support. + */ public abstract class ClusterCommandSupport extends CellarCommandSupport { protected ExecutionContext executionContext; http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/aaad133c/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 f121ea7..3299ea1 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.felix.gogo.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 node ID to ping.", required = true, multiValued = false) + @Argument(index = 0, name = "node", description = "The node ID 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 iterations.", required = false, multiValued = false) + @Argument(index = 2, name = "interval", description = "The time in millis to wait between iterations", required = false, multiValued = false) Long interval = 1000L; @Override http://git-wip-us.apache.org/repos/asf/karaf-cellar/blob/aaad133c/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 a873bf1..cf4a09f 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.felix.gogo.commands.Command; import java.util.Set; -@Command(scope = "cluster", name = "node-list", description = "List the cluster nodes.") +@Command(scope = "cluster", name = "node-list", description = "List the cluster nodes") 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/aaad133c/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 1e2cf68..c3e41d3 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/aaad133c/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 2c04498..00c7cb6 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.felix.gogo.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/aaad133c/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 abc0ab5..c799ee6 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.felix.gogo.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/aaad133c/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 cb4a559..3dddee1 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,10 +19,10 @@ import org.apache.felix.gogo.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) + @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/aaad133c/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..92cce9f 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; +/** + * Abstract 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/aaad133c/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 7098170..b16dfbb 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.felix.gogo.commands.Argument; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.cellar.core.Group; -@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/aaad133c/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 3ed0ad9..8f1ca1d 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.felix.gogo.commands.Argument; import org.apache.felix.gogo.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/aaad133c/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 f39fcca..76a013c 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "group-join", description = "Join a cluster group.") +@Command(scope = "cluster", name = "group-join", description = "Join 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 = 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/aaad133c/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 d215b28..168a4d2 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "group-list", description = "List cluster groups.") +@Command(scope = "cluster", name = "group-list", description = "List 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/aaad133c/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 e708811..f6c178f 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 = "Pick a number of nodes from one cluster group and moves them into another.") +@Command(scope = "cluster", name = "group-pick", description = "Pick a number of nodes from one cluster group and moves them into another") public class GroupPickCommand extends GroupSupport { - @Argument(index = 0, name = "source", description = "The source cluster group name that will act as a selection pool.", required = true, multiValued = false) + @Argument(index = 0, name = "source", description = "The source cluster group name that will act as a selection pool", required = true, multiValued = false) String sourceGroupName; - @Argument(index = 1, name = "destination", description = "The destination cluster group name.", required = true, multiValued = false) + @Argument(index = 1, name = "destination", 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/aaad133c/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 a896e48..2698e8f 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "group-quit", description = "Quit a cluster group.") +@Command(scope = "cluster", name = "group-quit", description = "Quit 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/aaad133c/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 cf903e0..2093ab5 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,13 +20,13 @@ import org.apache.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "group-set", description = "Set the target nodes for a specific cluster group.") +@Command(scope = "cluster", name = "group-set", description = "Set the target nodes for a specific cluster group") public class GroupSetCommand 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/aaad133c/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 f52eb8a..2af6282 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; +/** + * Abstract cluster group shell command support. + */ public abstract class GroupSupport extends ClusterCommandSupport { protected static final String HEADER_FORMAT = " %-20s %s"; @@ -33,11 +36,11 @@ public abstract class GroupSupport extends ClusterCommandSupport { /** * Executes the command. * - * @param action - * @param group - * @param nodes - * @return - * @throws Exception + * @param action the cluster group action. + * @param group the cluster group name. + * @param nodes the node IDs. + * @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> nodes) throws Exception { return doExecute(action, group, source, nodes, true); @@ -46,12 +49,12 @@ public abstract class GroupSupport extends ClusterCommandSupport { /** * Executes the command. * - * @param action - * @param group - * @param nodeIds - * @param suppressOutput - * @return - * @throws Exception + * @param action the cluster group action. + * @param group the cluster group name. + * @param nodeIds the node IDs. + * @param suppressOutput true to suppress command execution 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/aaad133c/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 a8f5100..ef62e43 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "handler-start", description = "Start an event handler.") +@Command(scope = "cluster", name = "handler-start", 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 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/aaad133c/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 71c70ee..86530cb 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "handler-status", description = "Status of an 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 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/aaad133c/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 a569665..9b04c53 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.felix.gogo.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/aaad133c/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..8a076eb 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; +/** + * Abstract 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/aaad133c/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 c8da688..3e3f588 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.felix.gogo.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/aaad133c/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 e97a504..34aa227 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.felix.gogo.commands.Command; import java.util.List; -@Command(scope = "cluster", name = "producer-start", description = "Status of an event producer.") +@Command(scope = "cluster", name = "producer-start", 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/aaad133c/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 66106ae..4a3b39e 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.felix.gogo.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/aaad133c/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..38e2e84 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; +/** + * Abstract 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/aaad133c/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>
