Repository: camel Updated Branches: refs/heads/master 35735204a -> b77945104
CAMEL-8910 Camel-JClouds: Add new operations to JClouds Compute Service Producer, add rebootNode operation Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/727d8b8b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/727d8b8b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/727d8b8b Branch: refs/heads/master Commit: 727d8b8bfe71950a7627cd5ded42b28fdeb73483 Parents: 3573520 Author: Andrea Cosentino <anco...@gmail.com> Authored: Sun Jun 28 14:04:35 2015 +0200 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Sun Jun 28 14:04:35 2015 +0200 ---------------------------------------------------------------------- .../camel/component/jclouds/JcloudsComputeProducer.java | 10 ++++++++++ .../apache/camel/component/jclouds/JcloudsConstants.java | 1 + 2 files changed, 11 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/727d8b8b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java index 3d630d4..4d96c37 100644 --- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java +++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsComputeProducer.java @@ -67,6 +67,8 @@ public class JcloudsComputeProducer extends JcloudsProducer { createNode(exchange); } else if (JcloudsConstants.DESTROY_NODE.equals(operation)) { destroyNode(exchange); + } else if (JcloudsConstants.REBOOT_NODE.equals(operation)) { + destroyNode(exchange); } } @@ -166,6 +168,14 @@ public class JcloudsComputeProducer extends JcloudsProducer { Set<? extends Hardware> hardwareProfiles = computeService.listHardwareProfiles(); exchange.getOut().setBody(hardwareProfiles); } + + /** + * Reboot the node with the specified nodeId. + */ + protected void rebootNode(Exchange exchange) { + Predicate<NodeMetadata> predicate = getNodePredicate(exchange); + computeService.rebootNodesMatching(predicate); + } /** http://git-wip-us.apache.org/repos/asf/camel/blob/727d8b8b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java ---------------------------------------------------------------------- diff --git a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java index 811bbe7..d49a8e0 100644 --- a/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java +++ b/components/camel-jclouds/src/main/java/org/apache/camel/component/jclouds/JcloudsConstants.java @@ -33,6 +33,7 @@ public final class JcloudsConstants { public static final String LIST_NODES = "CamelJcloudsListNodes"; public static final String CREATE_NODE = "CamelJcloudsCreateNode"; public static final String DESTROY_NODE = "CamelJcloudsDestroyNode"; + public static final String REBOOT_NODE = "CamelJcloudsRebootNode"; public static final String RUN_SCRIPT = "CamelJcloudsRunScript"; public static final String CONTENT_LANGUAGE = "CamelJcloudsContentLanguage";