You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2015/06/28 16:06:52 UTC
[3/6] camel git commit: CAMEL-8910 Camel-JClouds: Add new operations
to JClouds Compute Service Producer, add suspendNode operation
CAMEL-8910 Camel-JClouds: Add new operations to JClouds Compute Service Producer, add suspendNode operation
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1f0fe61a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1f0fe61a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1f0fe61a
Branch: refs/heads/master
Commit: 1f0fe61a7de52cbae5350817cf05250b4787ab48
Parents: 422536b
Author: Andrea Cosentino <an...@gmail.com>
Authored: Sun Jun 28 15:14:10 2015 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Sun Jun 28 15:14:10 2015 +0200
----------------------------------------------------------------------
.../camel/component/jclouds/JcloudsComputeProducer.java | 11 ++++++++++-
.../apache/camel/component/jclouds/JcloudsConstants.java | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1f0fe61a/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 e25cbbd..0e4b4c3 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
@@ -69,6 +69,8 @@ public class JcloudsComputeProducer extends JcloudsProducer {
destroyNode(exchange);
} else if (JcloudsConstants.REBOOT_NODE.equals(operation)) {
rebootNode(exchange);
+ } else if (JcloudsConstants.SUSPEND_NODE.equals(operation)) {
+ suspendNode(exchange);
}
}
@@ -176,7 +178,14 @@ public class JcloudsComputeProducer extends JcloudsProducer {
Predicate<NodeMetadata> predicate = getNodePredicate(exchange);
computeService.rebootNodesMatching(predicate);
}
-
+
+ /**
+ * Reboot the node with the specified nodeId.
+ */
+ protected void suspendNode(Exchange exchange) {
+ Predicate<NodeMetadata> predicate = getNodePredicate(exchange);
+ computeService.suspendNodesMatching(predicate);
+ }
/**
* Returns the required {@ComputeMetadata} {@link Predicate} for the Exhcnage.
http://git-wip-us.apache.org/repos/asf/camel/blob/1f0fe61a/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 d49a8e0..49c9f29 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
@@ -34,6 +34,7 @@ public final class JcloudsConstants {
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 SUSPEND_NODE = "CamelJcloudsSuspendNode";
public static final String RUN_SCRIPT = "CamelJcloudsRunScript";
public static final String CONTENT_LANGUAGE = "CamelJcloudsContentLanguage";