[2/6] incubator-brooklyn git commit: releasePortForwarding now uses Task F/W to invoke portForwarder.closePortForwarding

2015-12-14 Thread sjcorbett
releasePortForwarding now uses Task F/W to invoke 
portForwarder.closePortForwarding


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/2c194d10
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/2c194d10
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/2c194d10

Branch: refs/heads/master
Commit: 2c194d1078d21053127b3a4e077853d1eb467d48
Parents: 4ed9e97
Author: Mark McKenna 
Authored: Wed Dec 2 16:06:21 2015 +
Committer: Mark McKenna 
Committed: Fri Dec 11 15:49:12 2015 +

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


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2c194d10/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 8a666c6..2f08af8 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
@@ -57,6 +57,8 @@ import 
org.apache.brooklyn.api.location.MachineManagementMixins;
 import org.apache.brooklyn.api.location.NoMachinesAvailableException;
 import org.apache.brooklyn.api.location.PortRange;
 import org.apache.brooklyn.api.mgmt.AccessController;
+import org.apache.brooklyn.api.mgmt.Task;
+import org.apache.brooklyn.api.mgmt.TaskAdaptable;
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.config.ConfigKey.HasConfigKey;
 import org.apache.brooklyn.core.config.ConfigUtils;
@@ -96,6 +98,9 @@ import org.apache.brooklyn.util.core.internal.ssh.ShellTool;
 import org.apache.brooklyn.util.core.internal.ssh.SshTool;
 import org.apache.brooklyn.util.core.internal.winrm.WinRmTool;
 import org.apache.brooklyn.util.core.internal.winrm.WinRmToolResponse;
+import org.apache.brooklyn.util.core.task.DynamicTasks;
+import org.apache.brooklyn.util.core.task.TaskBuilder;
+import org.apache.brooklyn.util.core.task.Tasks;
 import org.apache.brooklyn.util.core.text.TemplateProcessor;
 import org.apache.brooklyn.util.exceptions.CompoundRuntimeException;
 import org.apache.brooklyn.util.exceptions.Exceptions;
@@ -2437,13 +2442,13 @@ public class JcloudsLocation extends 
AbstractCloudMachineProvisioningLocation im
 }
 }
 
-protected void releasePortForwarding(SshMachineLocation machine) {
+protected void releasePortForwarding(final SshMachineLocation machine) {
 // TODO Implementation needs revisisted. It relies on deprecated 
PortForwardManager methods.
 
 boolean usePortForwarding = 
Boolean.TRUE.equals(machine.getConfig(USE_PORT_FORWARDING));
-JcloudsPortForwarderExtension portForwarder = 
machine.getConfig(PORT_FORWARDER);
+final JcloudsPortForwarderExtension portForwarder = 
machine.getConfig(PORT_FORWARDER);
 PortForwardManager portForwardManager = 
machine.getConfig(PORT_FORWARDING_MANAGER);
-NodeMetadata node = (machine instanceof JcloudsSshMachineLocation) ? 
((JcloudsSshMachineLocation) machine).getNode() : null;
+final NodeMetadata node = (machine instanceof 
JcloudsSshMachineLocation) ? ((JcloudsSshMachineLocation) machine).getNode() : 
null;
 
 if (portForwarder == null) {
 LOG.debug("No port-forwarding to close (because portForwarder 
null) on release of " + machine);
@@ -2467,15 +2472,35 @@ public class JcloudsLocation extends 
AbstractCloudMachineProvisioningLocation im
 mappings = ImmutableSet.of();
 }
 
-for (PortMapping mapping : mappings) {
-HostAndPort publicEndpoint = mapping.getPublicEndpoint();
-int targetPort = mapping.getPrivatePort();
-Protocol protocol = Protocol.TCP;
+final TaskBuilder builder = TaskBuilder.builder()
+.parallel(true)
+.displayName("close port-forwarding at "+machine);
+
+for (final PortMapping mapping : mappings) {
+final HostAndPort publicEndpoint = mapping.getPublicEndpoint();
+final int targetPort = mapping.getPrivatePort();
+final Protocol protocol = Protocol.TCP;
 if (publicEndpoint != null) {
-LOG.debug("Closing port-forwarding at {} for machine {}: 
{}->{}", new Object[] {this, machine, publicEndpoint, targetPort});
-

incubator-brooklyn git commit: Fix Getting Started button again

2015-12-14 Thread richard
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master ed928a594 -> 1fe871b76


Fix Getting Started button again


Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/1fe871b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/1fe871b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/1fe871b7

Branch: refs/heads/master
Commit: 1fe871b76ebf13afeeab62772342e72cb70f7113
Parents: ed928a5
Author: Richard Downer 
Authored: Mon Dec 14 10:36:12 2015 +
Committer: Richard Downer 
Committed: Mon Dec 14 10:36:12 2015 +

--
 docs/website/index.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/1fe871b7/docs/website/index.md
--
diff --git a/docs/website/index.md b/docs/website/index.md
index 09ece7d..1312fdc 100644
--- a/docs/website/index.md
+++ b/docs/website/index.md
@@ -70,7 +70,7 @@ View and modify using the *web console* or automate using the 
*REST API*
 
 
 learn 
more
-get started
+get started