@Override public void consumerStop(String nodeIdOrAlias) throws Exception { ConsumerSwitchCommand command = new ConsumerSwitchCommand(clusterManager.generateId()); Set<Node> nodes = new HashSet<Node>(); if (nodeIdOrAlias == null || nodeIdOrAlias.isEmpty()) { nodes.add(clusterManager.getNode()); } else { Node node = clusterManager.findNodeByIdOrAlias(nodeIdOrAlias); if (node == null) { throw new IllegalArgumentException("Cluster node " + nodeIdOrAlias + " doesn't exist"); } nodes.add(node); } command.setDestination(nodes); command.setStatus(SwitchStatus.OFF); executionContext.execute(command); }
@Override public void consumerStart(String nodeIdOrAlias) throws Exception { ConsumerSwitchCommand command = new ConsumerSwitchCommand(clusterManager.generateId()); Set<Node> nodes = new HashSet<Node>(); if (nodeIdOrAlias == null || nodeIdOrAlias.isEmpty()) { nodes.add(clusterManager.getNode()); } else { Node node = clusterManager.findNodeByIdOrAlias(nodeIdOrAlias); if (node == null) { throw new IllegalArgumentException("Cluster node " + nodeIdOrAlias + " doesn't exist"); } nodes.add(node); } command.setDestination(nodes); command.setStatus(SwitchStatus.ON); executionContext.execute(command); }
@Override public void consumerStart(String nodeIdOrAlias) throws Exception { ConsumerSwitchCommand command = new ConsumerSwitchCommand(clusterManager.generateId()); Set<Node> nodes = new HashSet<Node>(); if (nodeIdOrAlias == null || nodeIdOrAlias.isEmpty()) { nodes.add(clusterManager.getNode()); } else { Node node = clusterManager.findNodeByIdOrAlias(nodeIdOrAlias); if (node == null) { throw new IllegalArgumentException("Cluster node " + nodeIdOrAlias + " doesn't exist"); } nodes.add(node); } command.setDestination(nodes); command.setStatus(SwitchStatus.ON); executionContext.execute(command); }
@Override public void consumerStop(String nodeIdOrAlias) throws Exception { ConsumerSwitchCommand command = new ConsumerSwitchCommand(clusterManager.generateId()); Set<Node> nodes = new HashSet<Node>(); if (nodeIdOrAlias == null || nodeIdOrAlias.isEmpty()) { nodes.add(clusterManager.getNode()); } else { Node node = clusterManager.findNodeByIdOrAlias(nodeIdOrAlias); if (node == null) { throw new IllegalArgumentException("Cluster node " + nodeIdOrAlias + " doesn't exist"); } nodes.add(node); } command.setDestination(nodes); command.setStatus(SwitchStatus.OFF); executionContext.execute(command); }
command.setDestination(recipientList); command.setStatus(status);