You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2016/02/01 18:50:18 UTC

[02/50] [abbrv] brooklyn-server git commit: Deprecate JcloudsLocation#rebindMachine in favour of registerMachine

Deprecate JcloudsLocation#rebindMachine in favour of registerMachine

Return type now MachineLocation instead of JcloudsSshMachineLocation.


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/8ef103ec
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/8ef103ec
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/8ef103ec

Branch: refs/heads/0.8.0-incubating
Commit: 8ef103ec6f7f9e95ec4b1106b0689924445a1a85
Parents: af4eee3
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Tue Aug 18 18:27:51 2015 +0100
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Fri Aug 21 10:16:43 2015 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsLocation.java       | 45 +++++++++++++++++---
 1 file changed, 39 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/8ef103ec/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
index 9167587..867d349 100644
--- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/JcloudsLocation.java
@@ -1861,16 +1861,41 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
     }
 
 
-    // ----------------- rebinding to existing machine ------------------------
+    // ----------------- registering existing machines ------------------------
 
+    /**
+     * @deprecated since 0.8.0 use {@link #registerMachine(NodeMetadata)} instead.
+     */
+    @Deprecated
     public JcloudsSshMachineLocation rebindMachine(NodeMetadata metadata) throws NoMachinesAvailableException {
-        return rebindMachine(MutableMap.of(), metadata);
+        return (JcloudsSshMachineLocation) registerMachine(metadata);
     }
+
+    public MachineLocation registerMachine(NodeMetadata metadata) throws NoMachinesAvailableException {
+        return registerMachine(MutableMap.of(), metadata);
+    }
+
+    /**
+     * @deprecated since 0.8.0 use {@link #registerMachine(Map, NodeMetadata)} instead.
+     */
+    @Deprecated
     public JcloudsSshMachineLocation rebindMachine(Map<?,?> flags, NodeMetadata metadata) throws NoMachinesAvailableException {
+        return (JcloudsSshMachineLocation) registerMachine(flags, metadata);
+    }
+
+    public MachineLocation registerMachine(Map<?, ?> flags, NodeMetadata metadata) throws NoMachinesAvailableException {
         ConfigBag setup = ConfigBag.newInstanceExtending(config().getBag(), flags);
         if (!setup.containsKey("id")) setup.putStringKey("id", metadata.getId());
         setHostnameUpdatingCredentials(setup, metadata);
-        return rebindMachine(setup);
+        return registerMachine(setup);
+    }
+
+    /**
+     * @deprecated since 0.8.0 use {@link #registerMachine(ConfigBag)} instead.
+     */
+    @Deprecated
+    public JcloudsSshMachineLocation rebindMachine(ConfigBag setup) throws NoMachinesAvailableException {
+        return (JcloudsSshMachineLocation) registerMachine(setup);
     }
 
     /**
@@ -1883,7 +1908,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
      *   <li>userName: the username for ssh'ing into the machine
      * <ul>
      */
-    public JcloudsSshMachineLocation rebindMachine(ConfigBag setup) throws NoMachinesAvailableException {
+    public MachineLocation registerMachine(ConfigBag setup) throws NoMachinesAvailableException {
         try {
             if (setup.getDescription() == null) setCreationString(setup);
             String user = checkNotNull(getUser(setup), "user");
@@ -1923,9 +1948,17 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation im
         }
     }
 
-    public JcloudsSshMachineLocation rebindMachine(Map<?,?> flags) throws NoMachinesAvailableException {
+    /**
+     * @deprecated since 0.8.0 use {@link #registerMachine(Map)} instead.
+     */
+    @Deprecated
+    public JcloudsSshMachineLocation rebindMachine(Map<?, ?> flags) throws NoMachinesAvailableException {
+        return (JcloudsSshMachineLocation) registerMachine(flags);
+    }
+
+    public MachineLocation registerMachine(Map<?,?> flags) throws NoMachinesAvailableException {
         ConfigBag setup = ConfigBag.newInstanceExtending(config().getBag(), flags);
-        return rebindMachine(setup);
+        return registerMachine(setup);
     }
 
     /**