Implements support for VanillaWindowsProcess
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/c9bde14e Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/c9bde14e Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/c9bde14e Branch: refs/heads/master Commit: c9bde14e1d9c19e2eebba194e7ff9e536f469504 Parents: f566486 Author: Martin Harris <[email protected]> Authored: Wed Apr 15 16:12:44 2015 +0100 Committer: Richard Downer <[email protected]> Committed: Thu May 28 17:27:34 2015 +0100 ---------------------------------------------------------------------- .../drivers/ReflectiveEntityDriverFactory.java | 47 +++++++++++++------- .../AbstractSoftwareProcessWinRmDriver.java | 23 ++++++++-- .../entity/basic/AbstractVanillaProcess.java | 32 +++++++++++++ .../basic/AbstractVanillaProcessDriver.java | 22 +++++++++ .../basic/AbstractVanillaSoftwareProcess.java | 32 ------------- .../AbstractVanillaSoftwareProcessDriver.java | 22 --------- .../entity/basic/VanillaSoftwareProcess.java | 2 +- .../basic/VanillaSoftwareProcessDriver.java | 2 +- .../entity/basic/VanillaWindowsProcess.java | 21 +++++++-- .../basic/VanillaWindowsProcessDriver.java | 2 +- .../entity/basic/VanillaWindowsProcessImpl.java | 1 + .../basic/VanillaWindowsProcessWinRmDriver.java | 13 +++--- 12 files changed, 134 insertions(+), 85 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/core/src/main/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactory.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactory.java b/core/src/main/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactory.java index 3e0b757..7ad2f32 100644 --- a/core/src/main/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactory.java +++ b/core/src/main/java/brooklyn/entity/drivers/ReflectiveEntityDriverFactory.java @@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory; import brooklyn.location.Location; import brooklyn.location.basic.SshMachineLocation; import brooklyn.location.paas.PaasLocation; +import brooklyn.location.basic.WinRmMachineLocation; import brooklyn.util.collections.MutableList; import brooklyn.util.collections.MutableMap; import brooklyn.util.exceptions.Exceptions; @@ -56,6 +57,7 @@ public class ReflectiveEntityDriverFactory { public ReflectiveEntityDriverFactory() { addRule(DriverInferenceForSshLocation.DEFAULT_IDENTIFIER, new DriverInferenceForSshLocation()); addRule(DriverInferenceForPaasLocation.DEFAULT_IDENTIFIER, new DriverInferenceForPaasLocation()); + addRule(DriverInferenceForWinRmLocation.DEFAULT_IDENTIFIER, new DriverInferenceForWinRmLocation()); } public interface DriverInferenceRule { @@ -169,17 +171,32 @@ public class ReflectiveEntityDriverFactory { public static class DriverInferenceForPaasLocation extends AbstractDriverInferenceRule { - public static final String DEFAULT_IDENTIFIER = "paas-location-driver-inference-rule"; + public static final String DEFAULT_IDENTIFIER = "paas-location-driver-inference-rule"; - @Override - public <D extends EntityDriver> String inferDriverClassName(DriverDependentEntity<D> entity, Class<D> driverInterface, Location location) { - String driverInterfaceName = driverInterface.getName(); - if (!(location instanceof PaasLocation)) return null; - if (!driverInterfaceName.endsWith("Driver")) { - throw new IllegalArgumentException(String.format("Driver name [%s] doesn't end with 'Driver'; cannot auto-detect PaasDriver class name", driverInterfaceName)); - } - return Strings.removeFromEnd(driverInterfaceName, "Driver")+ ((PaasLocation) location).getPaasProviderName() + "Driver"; + @Override + public <D extends EntityDriver> String inferDriverClassName(DriverDependentEntity<D> entity, Class<D> driverInterface, Location location) { + String driverInterfaceName = driverInterface.getName(); + if (!(location instanceof PaasLocation)) return null; + if (!driverInterfaceName.endsWith("Driver")) { + throw new IllegalArgumentException(String.format("Driver name [%s] doesn't end with 'Driver'; cannot auto-detect PaasDriver class name", driverInterfaceName)); + } + return Strings.removeFromEnd(driverInterfaceName, "Driver") + ((PaasLocation) location).getPaasProviderName() + "Driver"; + } + } + + public static class DriverInferenceForWinRmLocation extends AbstractDriverInferenceRule { + + public static final String DEFAULT_IDENTIFIER = "winrm-location-driver-inference-rule"; + + @Override + public <D extends EntityDriver> String inferDriverClassName(DriverDependentEntity<D> entity, Class<D> driverInterface, Location location) { + String driverInterfaceName = driverInterface.getName(); + if (!(location instanceof WinRmMachineLocation)) return null; + if (!driverInterfaceName.endsWith("Driver")) { + throw new IllegalArgumentException(String.format("Driver name [%s] doesn't end with 'Driver'; cannot auto-detect WinRmDriver class name", driverInterfaceName)); } + return Strings.removeFromEnd(driverInterfaceName, "Driver")+"WinRmDriver"; + } } /** adds a rule; possibly replacing an old one if one exists with the given identifier. the new rule is added after all previous ones. @@ -190,17 +207,17 @@ public class ReflectiveEntityDriverFactory { LOG.debug("Added driver mapping rule "+rule); return oldRule; } - + public DriverInferenceRule addClassFullNameMapping(String expectedClassFullName, String newClassFullName) { DriverInferenceByRenamingClassFullName rule = new DriverInferenceByRenamingClassFullName(expectedClassFullName, newClassFullName); return addRule(rule.getIdentifier(), rule); } - + public DriverInferenceRule addClassSimpleNameMapping(String expectedClassSimpleName, String newClassSimpleName) { DriverInferenceByRenamingClassSimpleName rule = new DriverInferenceByRenamingClassSimpleName(expectedClassSimpleName, newClassSimpleName); return addRule(rule.getIdentifier(), rule); } - + public <D extends EntityDriver> D build(DriverDependentEntity<D> entity, Location location){ Class<D> driverInterface = entity.getDriverInterface(); Class<? extends D> driverClass = null; @@ -227,7 +244,7 @@ public class ReflectiveEntityDriverFactory { driverClass = driverInterface; } LOG.debug("Driver for "+driverInterface.getName()+" in "+location+" is: "+driverClass); - + if (driverClass==null) { if (exceptions.isEmpty()) throw new RuntimeException("No drivers could be found for "+driverInterface.getName()+"; " @@ -244,7 +261,7 @@ public class ReflectiveEntityDriverFactory { throw Exceptions.propagate(e); } } - + @SuppressWarnings("unchecked") private <D extends EntityDriver> Constructor<D> getConstructor(Class<D> driverClass) { for (Constructor<?> constructor : driverClass.getConstructors()) { @@ -255,5 +272,5 @@ public class ReflectiveEntityDriverFactory { throw new RuntimeException(String.format("Class [%s] has no constructor with 2 arguments", driverClass.getName())); } - + } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessWinRmDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessWinRmDriver.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessWinRmDriver.java index ed92e15..d865c4d 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessWinRmDriver.java +++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessWinRmDriver.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Map; import brooklyn.config.ConfigKey; +import brooklyn.event.AttributeSensor; +import brooklyn.event.basic.Sensors; import brooklyn.location.basic.WinRmMachineLocation; import com.google.api.client.util.Strings; @@ -31,8 +33,15 @@ import com.google.common.collect.ImmutableList; public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwareProcessDriver { + AttributeSensor<String> WINDOWS_USERNAME = Sensors.newStringSensor("windows.username", + "Default Windows username to be used when connecting to the Entity's VM"); + AttributeSensor<String> WINDOWS_PASSWORD = Sensors.newStringSensor("windows.password", + "Default Windows password to be used when connecting to the Entity's VM"); + public AbstractSoftwareProcessWinRmDriver(EntityLocal entity, WinRmMachineLocation location) { super(entity, location); + entity.setAttribute(WINDOWS_USERNAME, location.config().get(WinRmMachineLocation.WINDOWS_USERNAME)); + entity.setAttribute(WINDOWS_PASSWORD, location.config().get(WinRmMachineLocation.WINDOWS_PASSWORD)); } @Override @@ -98,13 +107,19 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar getLocation().executePsScript("New-Item -path \"" + directoryName + "\" -type directory -ErrorAction SilentlyContinue"); } - protected boolean executeCommand(ConfigKey<String> regularCommandKey, ConfigKey<String> powershellCommandKey) { + protected boolean executeCommand(ConfigKey<String> regularCommandKey, ConfigKey<String> powershellCommandKey, boolean allowNoOp) { String regularCommand = getEntity().getConfig(regularCommandKey); String powershellCommand = getEntity().getConfig(powershellCommandKey); - if ((Strings.isNullOrEmpty(regularCommand) && Strings.isNullOrEmpty(powershellCommand)) || ( - !Strings.isNullOrEmpty(regularCommand) && !Strings.isNullOrEmpty(powershellCommand))) { - throw new IllegalStateException(String.format("Exactly one of %s or %s must be set", regularCommandKey.getName(), powershellCommandKey.getName())); + if (Strings.isNullOrEmpty(regularCommand) && Strings.isNullOrEmpty(powershellCommand)) { + if (allowNoOp) { + return true; + } else { + throw new IllegalStateException(String.format("Exactly one of %s or %s must be set", regularCommandKey.getName(), powershellCommandKey.getName())); + } + } else if (!Strings.isNullOrEmpty(regularCommand) && !Strings.isNullOrEmpty(powershellCommand)) { + throw new IllegalStateException(String.format("%s and %s cannot both be set", regularCommandKey.getName(), powershellCommandKey.getName())); } + if (Strings.isNullOrEmpty(regularCommand)) { return getLocation().executePsScript(ImmutableList.of(powershellCommand)) == 0; } else { http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcess.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcess.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcess.java new file mode 100644 index 0000000..5c89f51 --- /dev/null +++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcess.java @@ -0,0 +1,32 @@ +/* + * 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 brooklyn.entity.basic; + +import brooklyn.config.ConfigKey; +import brooklyn.event.basic.AttributeSensorAndConfigKey; + +public interface AbstractVanillaProcess extends SoftwareProcess { + AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL = SoftwareProcess.DOWNLOAD_URL; + + ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "0.0.0"); + + ConfigKey<String> LAUNCH_COMMAND = ConfigKeys.newStringConfigKey("launch.command", "command to run to launch the process", "./start.sh"); + ConfigKey<String> CHECK_RUNNING_COMMAND = ConfigKeys.newStringConfigKey("checkRunning.command", "command to determine whether the process is running"); + ConfigKey<String> STOP_COMMAND = ConfigKeys.newStringConfigKey("stop.command", "command to run to stop the process"); +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcessDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcessDriver.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcessDriver.java new file mode 100644 index 0000000..1ddb488 --- /dev/null +++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaProcessDriver.java @@ -0,0 +1,22 @@ +/* + * 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 brooklyn.entity.basic; + +public interface AbstractVanillaProcessDriver extends SoftwareProcessDriver { +} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcess.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcess.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcess.java deleted file mode 100644 index 18fda37..0000000 --- a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcess.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 brooklyn.entity.basic; - -import brooklyn.config.ConfigKey; -import brooklyn.event.basic.AttributeSensorAndConfigKey; - -public interface AbstractVanillaSoftwareProcess extends SoftwareProcess { - AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL = SoftwareProcess.DOWNLOAD_URL; - - ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "0.0.0"); - - ConfigKey<String> LAUNCH_COMMAND = ConfigKeys.newStringConfigKey("launch.command", "command to run to launch the process", "./start.sh"); - ConfigKey<String> CHECK_RUNNING_COMMAND = ConfigKeys.newStringConfigKey("checkRunning.command", "command to determine whether the process is running"); - ConfigKey<String> STOP_COMMAND = ConfigKeys.newStringConfigKey("stop.command", "command to run to stop the process"); -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcessDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcessDriver.java b/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcessDriver.java deleted file mode 100644 index ca80f63..0000000 --- a/software/base/src/main/java/brooklyn/entity/basic/AbstractVanillaSoftwareProcessDriver.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 brooklyn.entity.basic; - -public interface AbstractVanillaSoftwareProcessDriver extends SoftwareProcessDriver { -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcess.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcess.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcess.java index a1cca3f..ff37c0a 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcess.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcess.java @@ -52,6 +52,6 @@ import brooklyn.entity.proxying.ImplementedBy; */ @Catalog(name="Vanilla Software Process", description="A software process configured with scripts, e.g. for launch, check-running and stop") @ImplementedBy(VanillaSoftwareProcessImpl.class) -public interface VanillaSoftwareProcess extends AbstractVanillaSoftwareProcess { +public interface VanillaSoftwareProcess extends AbstractVanillaProcess { } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcessDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcessDriver.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcessDriver.java index 31ecdde..e4e43ec 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcessDriver.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaSoftwareProcessDriver.java @@ -18,6 +18,6 @@ */ package brooklyn.entity.basic; -public interface VanillaSoftwareProcessDriver extends AbstractVanillaSoftwareProcessDriver { +public interface VanillaSoftwareProcessDriver extends AbstractVanillaProcessDriver { } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcess.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcess.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcess.java index 133ea45..585f73e 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcess.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcess.java @@ -19,9 +19,22 @@ package brooklyn.entity.basic; import brooklyn.config.ConfigKey; +import brooklyn.entity.proxying.ImplementedBy; -public interface VanillaWindowsProcess extends AbstractVanillaSoftwareProcess { - ConfigKey<String> LAUNCH_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("launch.powershell.command", "command to run to launch the process", "./start.sh"); - ConfigKey<String> CHECK_RUNNING_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("checkRunning.powershell.command", "command to determine whether the process is running"); - ConfigKey<String> STOP_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("stop.powershell.command", "command to run to stop the process"); +@ImplementedBy(VanillaWindowsProcessImpl.class) +public interface VanillaWindowsProcess extends AbstractVanillaProcess { + ConfigKey<String> LAUNCH_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("launch.powershell.command", + "command to run to launch the process", "./start.sh"); + ConfigKey<String> CHECK_RUNNING_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("checkRunning.powershell.command", + "command to determine whether the process is running"); + ConfigKey<String> STOP_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("stop.powershell.command", + "command to run to stop the process"); + ConfigKey<String> CUSTOMIZE_COMMAND = ConfigKeys.newStringConfigKey("customize.command", + "command to run during the customization phase"); + ConfigKey<String> CUSTOMIZE_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("customize.powershell.command", + "powershell command to run during the customization phase"); + ConfigKey<String> INSTALL_COMMAND = ConfigKeys.newStringConfigKey("install.command", + "command to run during the install phase"); + ConfigKey<String> INSTALL_POWERSHELL_COMMAND = ConfigKeys.newStringConfigKey("install.powershell.command", + "powershell command to run during the install phase"); } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessDriver.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessDriver.java index 228c443..04e60cf 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessDriver.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessDriver.java @@ -18,6 +18,6 @@ */ package brooklyn.entity.basic; -public interface VanillaWindowsProcessDriver extends AbstractVanillaSoftwareProcessDriver { +public interface VanillaWindowsProcessDriver extends AbstractVanillaProcessDriver { } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessImpl.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessImpl.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessImpl.java index f09bb87..7eac4a6 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessImpl.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessImpl.java @@ -35,4 +35,5 @@ public class VanillaWindowsProcessImpl extends SoftwareProcessImpl implements Va disconnectServiceUpIsRunning(); super.disconnectSensors(); } + } http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/c9bde14e/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java index c966685..768da6f 100644 --- a/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java +++ b/software/base/src/main/java/brooklyn/entity/basic/VanillaWindowsProcessWinRmDriver.java @@ -28,27 +28,30 @@ public class VanillaWindowsProcessWinRmDriver extends AbstractSoftwareProcessWin @Override public void install() { - + // TODO: Follow install path of VanillaSoftwareProcessSshDriver + executeCommand(VanillaWindowsProcess.INSTALL_COMMAND, VanillaWindowsProcess.INSTALL_POWERSHELL_COMMAND, true); } @Override public void customize() { - + // TODO: Follow customize path of VanillaSoftwareProcessSshDriver + executeCommand(VanillaWindowsProcess.CUSTOMIZE_COMMAND, VanillaWindowsProcess.CUSTOMIZE_POWERSHELL_COMMAND, true); } @Override public void launch() { - + executeCommand(VanillaWindowsProcess.LAUNCH_COMMAND, VanillaWindowsProcess.LAUNCH_POWERSHELL_COMMAND, true); } @Override public boolean isRunning() { - return executeCommand(VanillaWindowsProcess.CHECK_RUNNING_COMMAND, VanillaWindowsProcess.CHECK_RUNNING_POWERSHELL_COMMAND); + return executeCommand(VanillaWindowsProcess.CHECK_RUNNING_COMMAND, + VanillaWindowsProcess.CHECK_RUNNING_POWERSHELL_COMMAND, false); } @Override public void stop() { - + executeCommand(VanillaWindowsProcess.STOP_POWERSHELL_COMMAND, VanillaWindowsProcess.STOP_COMMAND, true); } }
