brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [2/5] brooklyn-server git commit: Introduce `AbstractMachineLocation` base class.
Date Mon, 18 Dec 2017 15:42:19 GMT
Introduce `AbstractMachineLocation` base class.

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

Branch: refs/heads/master
Commit: 7e813b2da75f15e1b63bc849ef81bb50c315af5e
Parents: 770ca34
Author: Alasdair Hodge <github@alasdairhodge.co.uk>
Authored: Thu Dec 7 18:29:43 2017 +0000
Committer: Alasdair Hodge <github@alasdairhodge.co.uk>
Committed: Fri Dec 8 09:55:30 2017 +0000

----------------------------------------------------------------------
 .../core/location/AbstractMachineLocation.java  | 36 ++++++++++++++++++++
 .../location/ssh/SshMachineLocation.java        |  4 +--
 .../location/winrm/WinRmMachineLocation.java    |  5 +--
 3 files changed, 41 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7e813b2d/core/src/main/java/org/apache/brooklyn/core/location/AbstractMachineLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/AbstractMachineLocation.java
b/core/src/main/java/org/apache/brooklyn/core/location/AbstractMachineLocation.java
new file mode 100644
index 0000000..a248c89
--- /dev/null
+++ b/core/src/main/java/org/apache/brooklyn/core/location/AbstractMachineLocation.java
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.brooklyn.core.location;
+
+import java.util.Map;
+
+import org.apache.brooklyn.api.location.MachineLocation;
+import org.apache.brooklyn.util.collections.MutableMap;
+
+public abstract class AbstractMachineLocation extends AbstractLocation implements MachineLocation
{
+
+    public AbstractMachineLocation() {
+        this(MutableMap.of());
+    }
+
+    public AbstractMachineLocation(Map<?,?> properties) {
+        super(properties);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7e813b2d/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
index 0ef3812..2078590 100644
--- a/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
+++ b/core/src/main/java/org/apache/brooklyn/location/ssh/SshMachineLocation.java
@@ -59,8 +59,8 @@ import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.config.MapConfigKey;
 import org.apache.brooklyn.core.config.Sanitizer;
 import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
-import org.apache.brooklyn.core.location.AbstractLocation;
 import org.apache.brooklyn.core.location.BasicHardwareDetails;
+import org.apache.brooklyn.core.location.AbstractMachineLocation;
 import org.apache.brooklyn.core.location.BasicMachineDetails;
 import org.apache.brooklyn.core.location.BasicOsDetails;
 import org.apache.brooklyn.core.location.LocationConfigUtils;
@@ -137,7 +137,7 @@ import groovy.lang.Closure;
  * Additionally there are routines to copyTo, copyFrom; and installTo (which tries a curl,
and falls back to copyTo
  * in event the source is accessible by the caller only).
  */
-public class SshMachineLocation extends AbstractLocation implements MachineLocation, PortSupplier,
WithMutexes, Closeable {
+public class SshMachineLocation extends AbstractMachineLocation implements MachineLocation,
PortSupplier, WithMutexes, Closeable {
 
     private static final Logger LOG = LoggerFactory.getLogger(SshMachineLocation.class);
     private static final Logger logSsh = LoggerFactory.getLogger(BrooklynLogging.SSH_IO);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/7e813b2d/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
----------------------------------------------------------------------
diff --git a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
index cf0819b..519d6d1 100644
--- a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
+++ b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
@@ -41,7 +41,7 @@ import org.apache.brooklyn.core.config.ConfigKeys;
 import org.apache.brooklyn.core.config.ConfigUtils;
 import org.apache.brooklyn.core.config.Sanitizer;
 import org.apache.brooklyn.core.entity.BrooklynConfigKeys;
-import org.apache.brooklyn.core.location.AbstractLocation;
+import org.apache.brooklyn.core.location.AbstractMachineLocation;
 import org.apache.brooklyn.core.location.access.PortForwardManager;
 import org.apache.brooklyn.core.location.access.PortForwardManagerLocationResolver;
 import org.apache.brooklyn.core.mgmt.ManagementContextInjectable;
@@ -71,7 +71,7 @@ import com.google.common.collect.Iterables;
 import com.google.common.net.HostAndPort;
 import com.google.common.reflect.TypeToken;
 
-public class WinRmMachineLocation extends AbstractLocation implements MachineLocation {
+public class WinRmMachineLocation extends AbstractMachineLocation implements MachineLocation
{
 
     private static final Logger LOG = LoggerFactory.getLogger(WinRmMachineLocation.class);
 
@@ -485,4 +485,5 @@ public class WinRmMachineLocation extends AbstractLocation implements
MachineLoc
 //                        "AAgAD0AIAAkAFIARABQAC4AUwBlAHQAQQBsAGwAbwB3AFQAUwBDAG8AbgBuAGUAYwB0AGkAbwBuAHMAKAAxACwAMQApAA=="
 //        ));
     }
+
 }


Mime
View raw message