Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 68814200D80 for ; Mon, 18 Dec 2017 16:42:21 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 66E42160BF9; Mon, 18 Dec 2017 15:42:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7D876160C05 for ; Mon, 18 Dec 2017 16:42:20 +0100 (CET) Received: (qmail 38060 invoked by uid 500); 18 Dec 2017 15:42:19 -0000 Mailing-List: contact commits-help@brooklyn.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.apache.org Delivered-To: mailing list commits@brooklyn.apache.org Received: (qmail 38042 invoked by uid 99); 18 Dec 2017 15:42:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Dec 2017 15:42:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 8F3B3E04F0; Mon, 18 Dec 2017 15:42:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.apache.org Date: Mon, 18 Dec 2017 15:42:19 -0000 Message-Id: <59440f053bd34798be057a4b0eace61f@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/5] brooklyn-server git commit: Introduce `AbstractMachineLocation` base class. archived-at: Mon, 18 Dec 2017 15:42:21 -0000 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 Authored: Thu Dec 7 18:29:43 2017 +0000 Committer: Alasdair Hodge 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==" // )); } + }