Repository: brooklyn-server Updated Branches: refs/heads/master 798fbbbd0 -> 972854a8c
Revert winrmPort sensor in VanillaWindowsProcess - rename RDP_PORT and WINRM_PORT to values keeping the .port configuration convention Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/fba4412e Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/fba4412e Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/fba4412e Branch: refs/heads/master Commit: fba4412e2bfe26a6da045a079b48bba663c691f2 Parents: 5b01f8f Author: Valentin Aitken <bos...@gmail.com> Authored: Mon Feb 15 12:04:03 2016 +0200 Committer: Valentin Aitken <bos...@gmail.com> Committed: Thu Feb 18 15:16:41 2016 +0200 ---------------------------------------------------------------------- .../software/base/VanillaWindowsProcess.java | 24 +++++++++++++++++--- .../base/VanillaWindowsProcessImpl.java | 4 ++++ .../util/core/internal/winrm/WinRmTool.java | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fba4412e/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcess.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcess.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcess.java index eb64063..0e6673c 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcess.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcess.java @@ -103,7 +103,25 @@ public interface VanillaWindowsProcess extends AbstractVanillaProcess { // TODO If automatic updates are enabled and there are updates waiting to be installed, thirty minutes may not be sufficient... ConfigKey<Duration> REBOOT_COMPLETED_TIMEOUT = ConfigKeys.newDurationConfigKey("reboot.completed.timeout", "duration to wait whilst waiting for a machine to finish rebooting, and thus to become available again", Duration.minutes(30)); - - AttributeSensor<Integer> RDP_PORT = Sensors.newIntegerSensor("rdpPort"); - AttributeSensor<Integer> WINRM_PORT = Sensors.newIntegerSensor(WinRmTool.PROP_PORT.getName()); + + AttributeSensor<Integer> RDP_PORT = Sensors.newIntegerSensor("rdp.port", "RDP port used by the machine of this entity."); + AttributeSensor<Integer> WINRM_PORT = Sensors.newIntegerSensor("winrm.port", "WinRM port used by the machine of this entity."); + + /** + * @deprecated since 0.9.0; use {@link #RDP_PORT} instead. + */ + @Deprecated + AttributeSensor<Integer> RDP_PORT_CAMEL_CASE = Sensors.newIntegerSensor("rdpPort", "[DEPRECATED] instead use 'rdp.port'"); + + /** + * @deprecated since 0.9.0; use {@link #WINRM_PORT} instead. + */ + @Deprecated + AttributeSensor<Integer> WINRM_PORT_CAMEL_CASE = Sensors.newIntegerSensor("winrmPort", "[DEPRECATED] instead use 'winrm.port'"); + + /** + * @deprecated since 0.9.0; use {@link #WINRM_PORT} instead. + */ + @Deprecated + AttributeSensor<Integer> WINRM_PORT_SHORTEN = Sensors.newIntegerSensor("port", "[DEPRECATED] instead use 'winrm.port'"); } http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fba4412e/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessImpl.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessImpl.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessImpl.java index b6a7d0e..c3e0aa2 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessImpl.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessImpl.java @@ -33,9 +33,13 @@ public class VanillaWindowsProcessImpl extends SoftwareProcessImpl implements Va protected void preStart() { super.preStart(); sensors().set(RDP_PORT, 3389); + sensors().set(RDP_PORT_CAMEL_CASE, 3389); + WinRmMachineLocation loc = Iterables.getFirst(Iterables.filter(getLocations(), WinRmMachineLocation.class), null); if (loc != null) { sensors().set(WINRM_PORT, loc.getPort()); + sensors().set(WINRM_PORT_SHORTEN, loc.getPort()); + sensors().set(WINRM_PORT_CAMEL_CASE, loc.getPort()); } } http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/fba4412e/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java ---------------------------------------------------------------------- diff --git a/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java b/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java index c93e2ca..6e6bcf1 100644 --- a/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java +++ b/software/winrm/src/main/java/org/apache/brooklyn/util/core/internal/winrm/WinRmTool.java @@ -53,7 +53,7 @@ public interface WinRmTool { * winrm.useNtlm parameter could be a subject to change. * TODO Winrm supports several authentication mechanisms so it would be better to replace it with a prioritised list of authentication mechanisms to try. */ - @Beta + @Beta ConfigKey<Boolean> USE_NTLM = ConfigKeys.newBooleanConfigKey("winrm.useNtlm", "The parameter configures tells the machine sensors whether the winrm port is over https. If the parameter is true then 5986 will be used as a winrm port.", true); ConfigKey<String> PROP_USER = newStringConfigKey("user", "User to connect as", null); ConfigKey<String> PROP_PASSWORD = newStringConfigKey("password", "Password to use to connect", null);