brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [01/10] git commit: Remove (some) use of groovy in src/main
Date Tue, 05 Aug 2014 05:24:45 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master 65afbdbcb -> 7d2d42b37


Remove (some) use of groovy in src/main

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

Branch: refs/heads/master
Commit: 2d056f06b6d3aae465241afad79db04b27210e77
Parents: e315de3
Author: Aled Sage <aled.sage@gmail.com>
Authored: Tue Jul 22 14:59:39 2014 +0100
Committer: Aled Sage <aled.sage@gmail.com>
Committed: Tue Jul 22 14:59:39 2014 +0100

----------------------------------------------------------------------
 .../location/jclouds/JcloudsLocation.java       | 56 ++++++++++----------
 .../jclouds/JcloudsSshMachineLocation.java      |  4 +-
 .../brooklyn/location/jclouds/JcloudsUtil.java  | 12 ++---
 .../java/brooklyn/enricher/DeltaEnricher.java   |  2 +-
 .../policy/autoscaling/AutoScalerPolicy.java    |  4 +-
 .../policy/followthesun/FollowTheSunPolicy.java |  6 +--
 .../loadbalancing/LoadBalancingPolicy.java      |  6 +--
 .../basic/AbstractSoftwareProcessSshDriver.java | 14 ++---
 .../java/brooklyn/entity/java/JavaAppUtils.java |  4 +-
 .../java/JavaSoftwareProcessSshDriver.java      |  5 +-
 .../java/brooklyn/event/feed/jmx/JmxHelper.java |  7 ++-
 .../database/mariadb/MariaDbSshDriver.java      |  4 +-
 .../entity/database/mysql/MySqlSshDriver.java   |  4 +-
 .../monitoring/monit/MonitIntegrationTest.java  |  2 +-
 14 files changed, 65 insertions(+), 65 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
index e27e16c..7181a3f 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
@@ -18,8 +18,8 @@
  */
 package brooklyn.location.jclouds;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static java.util.concurrent.TimeUnit.MILLISECONDS;
@@ -213,10 +213,10 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
                 getLocalConfigBag().put(CLOUD_REGION_ID, (String)getLocalConfigBag().getStringKey("providerLocationId"));
         }
         
-        if (isDisplayNameAutoGenerated() || !truth(getDisplayName())) {
+        if (isDisplayNameAutoGenerated() || !groovyTruth(getDisplayName())) {
             setDisplayName(elvis(getProvider(), "unknown") +
-                   (truth(getRegion()) ? ":"+getRegion() : "") +
-                   (truth(getEndpoint()) ? ":"+getEndpoint() : ""));
+                   (groovyTruth(getRegion()) ? ":"+getRegion() : "") +
+                   (groovyTruth(getEndpoint()) ? ":"+getEndpoint() : ""));
         }
         
         setCreationString(getLocalConfigBag());
@@ -374,7 +374,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         Map<String,Object> result = Maps.newLinkedHashMap();
         Collection<String> unmatchedTags = Lists.newArrayList();
         for (String it : tags) {
-            if (truth(tagMapping.get(it)) && !truth(result)) {
+            if (groovyTruth(tagMapping.get(it)) && !groovyTruth(result)) {
                 result.putAll(tagMapping.get(it));
             } else {
                 unmatchedTags.add(it);
@@ -627,8 +627,8 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
                 //set userName and other data, from these credentials
                 Object oldUsername = setup.put(USER, customCredentials.getUser());
                 LOG.debug("node {} username {} / {} (customCredentials)", new Object[] {
node, customCredentials.getUser(), oldUsername });
-                if (truth(customCredentials.getPassword())) setup.put(PASSWORD, customCredentials.getPassword());
-                if (truth(customCredentials.getPrivateKey())) setup.put(PRIVATE_KEY_DATA,
customCredentials.getPrivateKey());
+                if (groovyTruth(customCredentials.getPassword())) setup.put(PASSWORD, customCredentials.getPassword());
+                if (groovyTruth(customCredentials.getPrivateKey())) setup.put(PRIVATE_KEY_DATA,
customCredentials.getPrivateKey());
             }
             if (initialCredentials == null) {
                 initialCredentials = extractVmCredentials(setup, node);
@@ -1023,7 +1023,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         if (templateBuilder instanceof PortableTemplateBuilder) {
             ((PortableTemplateBuilder<?>)templateBuilder).attachComputeService(computeService);
             // do the default last, and only if nothing else specified (guaranteed to be
a PTB if nothing else specified)
-            if (truth(config.get(DEFAULT_IMAGE_ID))) {
+            if (groovyTruth(config.get(DEFAULT_IMAGE_ID))) {
                 if (((PortableTemplateBuilder<?>)templateBuilder).isBlank()) {
                     templateBuilder.imageId(config.get(DEFAULT_IMAGE_ID).toString());
                 }
@@ -1260,21 +1260,21 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         LoginCredentials loginCreds = null;
         String user = getUser(config);
         String explicitLoginUser = config.get(LOGIN_USER);
-        String loginUser = truth(explicitLoginUser) ? explicitLoginUser : (image.getDefaultCredentials()
!= null) ? image.getDefaultCredentials().identity : null;
+        String loginUser = groovyTruth(explicitLoginUser) ? explicitLoginUser : (image.getDefaultCredentials()
!= null) ? image.getDefaultCredentials().identity : null;
         Boolean dontCreateUser = config.get(DONT_CREATE_USER);
         Boolean grantUserSudo = config.get(GRANT_USER_SUDO);
         String publicKeyData = LocationConfigUtils.getPublicKeyData(config);
         String privateKeyData = LocationConfigUtils.getPrivateKeyData(config);
         String explicitPassword = config.get(PASSWORD);
-        String password = truth(explicitPassword) ? explicitPassword : Identifiers.makeRandomId(12);
+        String password = groovyTruth(explicitPassword) ? explicitPassword : Identifiers.makeRandomId(12);
         List<Statement> statements = Lists.newArrayList();
         
-        if (truth(dontCreateUser)) {
+        if (groovyTruth(dontCreateUser)) {
             // TODO For dontCreateUser, we probably only want to treat it special if user
was explicitly supplied
             // (rather than it just being the default config key value). If user was explicit,
then should
             // set the password + authorize the key for that user. Presumably the caller
knows that this
             // user pre-exists on the given VM image.
-            if (!truth(user)) {
+            if (!groovyTruth(user)) {
                 // loginCreds result will be null; use creds returned by jclouds on the node
                 LOG.info("Not setting up any user (subsequently using loginUser {})", user,
loginUser);
                 config.put(USER, loginUser);
@@ -1289,9 +1289,9 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
                 }
             }
             
-        } else if (!truth(user) || user.equals(loginUser)) {
+        } else if (!groovyTruth(user) || user.equals(loginUser)) {
             // For subsequent ssh'ing, we'll be using the loginUser
-            if (!truth(user)) {
+            if (!groovyTruth(user)) {
                 config.put(USER, loginUser);
             }
 
@@ -1326,7 +1326,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
             AdminAccess.Builder adminBuilder = AdminAccess.builder()
                     .adminUsername(user)
                     .adminPassword(password)
-                    .grantSudoToAdminUser(truth(grantUserSudo))
+                    .grantSudoToAdminUser(groovyTruth(grantUserSudo))
                     .resetLoginPassword(true)
                     .loginPassword(password);
 
@@ -1341,7 +1341,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
             // then authorizeAdminPublicKey is reset to null!
             adminBuilder.installAdminPrivateKey(false).adminPrivateKey("ignore");
             
-            if (truth(explicitPassword)) {
+            if (groovyTruth(explicitPassword)) {
                 adminBuilder.lockSsh(false);
             } else if (publicKeyData != null) {
                 adminBuilder.lockSsh(true);
@@ -1353,7 +1353,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
             
             statements.add(adminBuilder.build());
             
-            if (truth(publicKeyData) && truth(privateKeyData)) {
+            if (groovyTruth(publicKeyData) && groovyTruth(privateKeyData)) {
                 // assume have uploaded corresponding .pub file
                 loginCreds = LoginCredentials.builder().user(user).privateKey(privateKeyData).build();
             } else {
@@ -1436,7 +1436,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
 
             NodeMetadata node = Iterables.getOnlyElement(candidateNodes);
             String pkd = LocationConfigUtils.getPrivateKeyData(setup);
-            if (truth(pkd)) {
+            if (groovyTruth(pkd)) {
                 LoginCredentials expectedCredentials = LoginCredentials.fromCredentials(new
Credentials(user, pkd));
                 //override credentials
                 node = NodeMetadataBuilder.fromNodeMetadata(node).credentials(expectedCredentials).build();
@@ -1591,7 +1591,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
     @Override
     public void release(SshMachineLocation machine) {
         String instanceId = vmInstanceIds.remove(machine);
-        if (!truth(instanceId)) {
+        if (!groovyTruth(instanceId)) {
             throw new IllegalArgumentException("Unknown machine "+machine);
         }
         
@@ -1660,7 +1660,7 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
 
         LOG.debug("node {} username {} / {} (jclouds)", new Object[] { node, user, nodeCredentials.getUser()
});
         
-        if (truth(nodeCredentials.getUser())) {
+        if (groovyTruth(nodeCredentials.getUser())) {
             if (user==null) {
                 setup.put(USER, user = nodeCredentials.getUser());
             } else if ("root".equals(user) && ROOT_ALIASES.contains(nodeCredentials.getUser()))
{
@@ -1757,15 +1757,15 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
         List<String> usersTried = new ArrayList<String>();
         
         String originalUser = getUser(setup);
-        if (truth(originalUser)) {
+        if (groovyTruth(originalUser)) {
             if (setHostname(setup, metadata, false)) return;
             usersTried.add(originalUser);
         }
         
         LoginCredentials credentials = metadata.getCredentials();
-        if (truth(credentials)) {
-            if (truth(credentials.getUser())) setup.put(USER, credentials.getUser());
-            if (truth(credentials.getPrivateKey())) setup.put(PRIVATE_KEY_DATA, credentials.getPrivateKey());
+        if (groovyTruth(credentials)) {
+            if (groovyTruth(credentials.getUser())) setup.put(USER, credentials.getUser());
+            if (groovyTruth(credentials.getPrivateKey())) setup.put(PRIVATE_KEY_DATA, credentials.getPrivateKey());
             if (setHostname(setup, metadata, false)) {
                 if (originalUser!=null && !originalUser.equals(getUser(setup))) {
                     LOG.warn("Switching to cloud-specified user at "+metadata+" as "+getUser(setup)+"
(failed to connect using: "+usersTried+")");
@@ -1840,11 +1840,11 @@ public class JcloudsLocation extends AbstractCloudMachineProvisioningLocation
im
     private String getPublicHostnameGeneric(NodeMetadata node, @Nullable ConfigBag setup)
{
         //prefer the public address to the hostname because hostname is sometimes wrong/abbreviated
         //(see that javadoc; also e.g. on rackspace, the hostname lacks the domain)
-        if (truth(node.getPublicAddresses())) {
+        if (groovyTruth(node.getPublicAddresses())) {
             return node.getPublicAddresses().iterator().next();
-        } else if (truth(node.getHostname())) {
+        } else if (groovyTruth(node.getHostname())) {
             return node.getHostname();
-        } else if (truth(node.getPrivateAddresses())) {
+        } else if (groovyTruth(node.getPrivateAddresses())) {
             return node.getPrivateAddresses().iterator().next();
         } else {
             return null;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
index 709791a..035c531 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsSshMachineLocation.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.location.jclouds;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
@@ -183,7 +183,7 @@ public class JcloudsSshMachineLocation extends SshMachineLocation implements
Has
     }
 
     protected Optional<String> getPrivateAddress() {
-        if (truth(node.getPrivateAddresses())) {
+        if (groovyTruth(node.getPrivateAddresses())) {
             Iterator<String> pi = node.getPrivateAddresses().iterator();
             while (pi.hasNext()) {
                 String p = pi.next();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
----------------------------------------------------------------------
diff --git a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
index c0f6555..af89ba9 100644
--- a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
+++ b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsUtil.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.location.jclouds;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static org.jclouds.aws.ec2.reference.AWSEC2Constants.PROPERTY_EC2_AMI_QUERY;
 import static org.jclouds.aws.ec2.reference.AWSEC2Constants.PROPERTY_EC2_CC_AMI_QUERY;
@@ -213,12 +213,12 @@ public class JcloudsUtil implements JcloudsLocationConfig {
         // See https://issues.apache.org/jira/browse/WHIRR-416
         if ("aws-ec2".equals(provider)) {
             // TODO convert AWS-only flags to config keys
-            if (truth(conf.get(IMAGE_ID))) {
+            if (groovyTruth(conf.get(IMAGE_ID))) {
                 properties.setProperty(PROPERTY_EC2_AMI_QUERY, "");
                 properties.setProperty(PROPERTY_EC2_CC_AMI_QUERY, "");
-            } else if (truth(conf.getStringKey("imageOwner"))) {
+            } else if (groovyTruth(conf.getStringKey("imageOwner"))) {
                 properties.setProperty(PROPERTY_EC2_AMI_QUERY, "owner-id="+conf.getStringKey("imageOwner")+";state=available;image-type=machine");
-            } else if (truth(conf.getStringKey("anyOwner"))) {
+            } else if (groovyTruth(conf.getStringKey("anyOwner"))) {
                 // set `anyOwner: true` to override the default query (which is restricted
to certain owners as per below), 
                 // allowing the AMI query to bind to any machine
                 // (note however, we sometimes pick defaults in JcloudsLocationFactory);
@@ -245,8 +245,8 @@ public class JcloudsUtil implements JcloudsLocationConfig {
         properties.putAll(extra);
 
         String endpoint = conf.get(CLOUD_ENDPOINT);
-        if (!truth(endpoint)) endpoint = getDeprecatedProperty(conf, Constants.PROPERTY_ENDPOINT);
-        if (truth(endpoint)) properties.setProperty(Constants.PROPERTY_ENDPOINT, endpoint);
+        if (!groovyTruth(endpoint)) endpoint = getDeprecatedProperty(conf, Constants.PROPERTY_ENDPOINT);
+        if (groovyTruth(endpoint)) properties.setProperty(Constants.PROPERTY_ENDPOINT, endpoint);
 
         Map<?,?> cacheKey = MutableMap.builder()
                 .putAll(properties)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/policy/src/main/java/brooklyn/enricher/DeltaEnricher.java
----------------------------------------------------------------------
diff --git a/policy/src/main/java/brooklyn/enricher/DeltaEnricher.java b/policy/src/main/java/brooklyn/enricher/DeltaEnricher.java
index 5a386b3..d3e3edc 100644
--- a/policy/src/main/java/brooklyn/enricher/DeltaEnricher.java
+++ b/policy/src/main/java/brooklyn/enricher/DeltaEnricher.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.enricher;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
 import brooklyn.enricher.basic.AbstractTransformingEnricher;
 import brooklyn.entity.Entity;
 import brooklyn.event.AttributeSensor;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/policy/src/main/java/brooklyn/policy/autoscaling/AutoScalerPolicy.java
----------------------------------------------------------------------
diff --git a/policy/src/main/java/brooklyn/policy/autoscaling/AutoScalerPolicy.java b/policy/src/main/java/brooklyn/policy/autoscaling/AutoScalerPolicy.java
index 4c40ad0..5399654 100644
--- a/policy/src/main/java/brooklyn/policy/autoscaling/AutoScalerPolicy.java
+++ b/policy/src/main/java/brooklyn/policy/autoscaling/AutoScalerPolicy.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.policy.autoscaling;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkNotNull;
 import groovy.lang.Closure;
 
@@ -959,6 +959,6 @@ public class AutoScalerPolicy extends AbstractPolicy {
     
     @Override
     public String toString() {
-        return getClass().getSimpleName() + (truth(name) ? "("+name+")" : "");
+        return getClass().getSimpleName() + (groovyTruth(name) ? "("+name+")" : "");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/policy/src/main/java/brooklyn/policy/followthesun/FollowTheSunPolicy.java
----------------------------------------------------------------------
diff --git a/policy/src/main/java/brooklyn/policy/followthesun/FollowTheSunPolicy.java b/policy/src/main/java/brooklyn/policy/followthesun/FollowTheSunPolicy.java
index 82a0f48..bfd5ce1 100644
--- a/policy/src/main/java/brooklyn/policy/followthesun/FollowTheSunPolicy.java
+++ b/policy/src/main/java/brooklyn/policy/followthesun/FollowTheSunPolicy.java
@@ -18,8 +18,8 @@
  */
 package brooklyn.policy.followthesun;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import java.util.Collection;
@@ -272,6 +272,6 @@ public class FollowTheSunPolicy extends AbstractPolicy {
     
     @Override
     public String toString() {
-        return getClass().getSimpleName() + (truth(name) ? "("+name+")" : "");
+        return getClass().getSimpleName() + (groovyTruth(name) ? "("+name+")" : "");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/policy/src/main/java/brooklyn/policy/loadbalancing/LoadBalancingPolicy.java
----------------------------------------------------------------------
diff --git a/policy/src/main/java/brooklyn/policy/loadbalancing/LoadBalancingPolicy.java b/policy/src/main/java/brooklyn/policy/loadbalancing/LoadBalancingPolicy.java
index c9a6875..8dcbac7 100644
--- a/policy/src/main/java/brooklyn/policy/loadbalancing/LoadBalancingPolicy.java
+++ b/policy/src/main/java/brooklyn/policy/loadbalancing/LoadBalancingPolicy.java
@@ -18,8 +18,8 @@
  */
 package brooklyn.policy.loadbalancing;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 
 import java.util.Map;
 import java.util.Map.Entry;
@@ -324,6 +324,6 @@ public class LoadBalancingPolicy<NodeType extends Entity, ItemType
extends Movab
     
     @Override
     public String toString() {
-        return getClass().getSimpleName() + (truth(name) ? "("+name+")" : "");
+        return getClass().getSimpleName() + (groovyTruth(name) ? "("+name+")" : "");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
index 6b4e153..0a9142c 100644
--- a/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/basic/AbstractSoftwareProcessSshDriver.java
@@ -18,8 +18,8 @@
  */
 package brooklyn.entity.basic;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkNotNull;
 
 import java.io.File;
@@ -582,8 +582,8 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
         }
 
         ScriptHelper s = new ScriptHelper(this, phase+" "+elvis(entity,this));
-        if (!truth(flags.get(NON_STANDARD_LAYOUT))) {
-            if (truth(flags.get(DEBUG))) {
+        if (!groovyTruth(flags.get(NON_STANDARD_LAYOUT))) {
+            if (groovyTruth(flags.get(DEBUG))) {
                 s.header.prepend("set -x");
             }
             if (INSTALLING.equals(phase)) {
@@ -596,7 +596,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
                         "test -f BROOKLYN && exit 0"
                         );
 
-                if (!truth(flags.get(INSTALL_INCOMPLETE))) {
+                if (!groovyTruth(flags.get(INSTALL_INCOMPLETE))) {
                     s.footer.append("date > $INSTALL_DIR/BROOKLYN");
                 }
             }
@@ -614,7 +614,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
         }
         if (ImmutableSet.of(STOPPING, KILLING).contains(phase)) {
             // stopping and killing allowed to have empty body if pid file set
-            if (!truth(flags.get(USE_PID_FILE)))
+            if (!groovyTruth(flags.get(USE_PID_FILE)))
                 s.failIfBodyEmpty();
         }
         if (ImmutableSet.of(INSTALLING, LAUNCHING).contains(phase)) {
@@ -628,7 +628,7 @@ public abstract class AbstractSoftwareProcessSshDriver extends AbstractSoftwareP
             s.setFlag(SshTool.PROP_SSH_TRIES, 1);
         }
 
-        if (truth(flags.get(USE_PID_FILE))) {
+        if (groovyTruth(flags.get(USE_PID_FILE))) {
             Object usePidFile = flags.get(USE_PID_FILE);
             String pidFile = (usePidFile instanceof CharSequence ? usePidFile : Os.mergePathsUnix(getRunDir(),
PID_FILENAME)).toString();
             String processOwner = (String) flags.get(PROCESS_OWNER);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java b/software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java
index 3a4613b..12e9787 100644
--- a/software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java
+++ b/software/base/src/main/java/brooklyn/entity/java/JavaAppUtils.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.entity.java;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 
 import java.lang.management.ManagementFactory;
 import java.lang.management.MemoryUsage;
@@ -47,7 +47,7 @@ import com.google.common.base.Function;
 public class JavaAppUtils {
 
     public static boolean isEntityMxBeanStatsEnabled(Entity entity) {
-        return truth(entity.getConfig(UsesJavaMXBeans.MXBEAN_STATS_ENABLED));
+        return groovyTruth(entity.getConfig(UsesJavaMXBeans.MXBEAN_STATS_ENABLED));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
b/software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
index 86359eb..677a329 100644
--- a/software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
+++ b/software/base/src/main/java/brooklyn/entity/java/JavaSoftwareProcessSshDriver.java
@@ -18,6 +18,8 @@
  */
 package brooklyn.entity.java;
 
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
+
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -36,7 +38,6 @@ import brooklyn.entity.basic.EntityLocal;
 import brooklyn.entity.effector.EffectorTasks;
 import brooklyn.entity.software.SshEffectorTasks;
 import brooklyn.location.basic.SshMachineLocation;
-import brooklyn.util.GroovyJavaMethods;
 import brooklyn.util.collections.MutableMap;
 import brooklyn.util.collections.MutableSet;
 import brooklyn.util.exceptions.Exceptions;
@@ -84,7 +85,7 @@ public abstract class JavaSoftwareProcessSshDriver extends AbstractSoftwareProce
     }
 
     public boolean isJmxSslEnabled() {
-        return isJmxEnabled() && GroovyJavaMethods.truth(entity.getConfig(UsesJmx.JMX_SSL_ENABLED));
+        return isJmxEnabled() && groovyTruth(entity.getConfig(UsesJmx.JMX_SSL_ENABLED));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/base/src/main/java/brooklyn/event/feed/jmx/JmxHelper.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/brooklyn/event/feed/jmx/JmxHelper.java b/software/base/src/main/java/brooklyn/event/feed/jmx/JmxHelper.java
index 5bc082c..80e5065 100644
--- a/software/base/src/main/java/brooklyn/event/feed/jmx/JmxHelper.java
+++ b/software/base/src/main/java/brooklyn/event/feed/jmx/JmxHelper.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.event.feed.jmx;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static com.google.common.base.Preconditions.checkNotNull;
 import groovy.time.TimeDuration;
 
@@ -65,7 +65,6 @@ import org.slf4j.LoggerFactory;
 import brooklyn.entity.basic.EntityLocal;
 import brooklyn.entity.java.JmxSupport;
 import brooklyn.entity.java.UsesJmx;
-import brooklyn.util.GroovyJavaMethods;
 import brooklyn.util.crypto.SecureKeys;
 import brooklyn.util.crypto.SslTrustUtils;
 import brooklyn.util.exceptions.Exceptions;
@@ -291,12 +290,12 @@ public class JmxHelper {
     public Map getConnectionEnvVars() {
         Map env = new LinkedHashMap();
         
-        if (truth(user) && truth(password)) {
+        if (groovyTruth(user) && groovyTruth(password)) {
             String[] creds = new String[] {user, password};
             env.put(JMXConnector.CREDENTIALS, creds);
         }
         
-        if (entity!=null && GroovyJavaMethods.truth(entity.getConfig(UsesJmx.JMX_SSL_ENABLED)))
{
+        if (entity!=null && groovyTruth(entity.getConfig(UsesJmx.JMX_SSL_ENABLED)))
{
             env.put("jmx.remote.profiles", JmxmpAgent.TLS_JMX_REMOTE_PROFILES);
 
             PrivateKey key = entity.getConfig(UsesJmx.JMX_SSL_ACCESS_KEY);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/database/src/main/java/brooklyn/entity/database/mariadb/MariaDbSshDriver.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/brooklyn/entity/database/mariadb/MariaDbSshDriver.java
b/software/database/src/main/java/brooklyn/entity/database/mariadb/MariaDbSshDriver.java
index ef9be34..e25d2f2 100644
--- a/software/database/src/main/java/brooklyn/entity/database/mariadb/MariaDbSshDriver.java
+++ b/software/database/src/main/java/brooklyn/entity/database/mariadb/MariaDbSshDriver.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.entity.database.mariadb;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static brooklyn.util.ssh.BashCommands.commandsToDownloadUrlsAs;
 import static brooklyn.util.ssh.BashCommands.installPackage;
 import static brooklyn.util.ssh.BashCommands.ok;
@@ -193,7 +193,7 @@ public class MariaDbSshDriver extends AbstractSoftwareProcessSshDriver
implement
     public String getMariaDbServerOptionsString() {
         Map<String, Object> options = entity.getConfig(MariaDbNode.MARIADB_SERVER_CONF);
         StringBuilder result = new StringBuilder();
-        if (truth(options)) {
+        if (groovyTruth(options)) {
             for (Map.Entry<String, Object> entry : options.entrySet()) {
                 result.append(entry.getKey());
                 String value = entry.getValue().toString();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/database/src/main/java/brooklyn/entity/database/mysql/MySqlSshDriver.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/brooklyn/entity/database/mysql/MySqlSshDriver.java
b/software/database/src/main/java/brooklyn/entity/database/mysql/MySqlSshDriver.java
index a35c303..49dc209 100644
--- a/software/database/src/main/java/brooklyn/entity/database/mysql/MySqlSshDriver.java
+++ b/software/database/src/main/java/brooklyn/entity/database/mysql/MySqlSshDriver.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.entity.database.mysql;
 
-import static brooklyn.util.GroovyJavaMethods.truth;
+import static brooklyn.util.JavaGroovyEquivalents.groovyTruth;
 import static brooklyn.util.ssh.BashCommands.commandsToDownloadUrlsAs;
 import static brooklyn.util.ssh.BashCommands.installPackage;
 import static brooklyn.util.ssh.BashCommands.ok;
@@ -192,7 +192,7 @@ public class MySqlSshDriver extends AbstractSoftwareProcessSshDriver implements
     public String getMySqlServerOptionsString() {
         Map<String, Object> options = entity.getConfig(MySqlNode.MYSQL_SERVER_CONF);
         StringBuilder result = new StringBuilder();
-        if (truth(options)) {
+        if (groovyTruth(options)) {
             for (Map.Entry<String, Object> entry : options.entrySet()) {
                 result.append(entry.getKey());
                 String value = entry.getValue().toString();

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/2d056f06/software/monitoring/src/test/java/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
----------------------------------------------------------------------
diff --git a/software/monitoring/src/test/java/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
b/software/monitoring/src/test/java/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
index ddf5659..0c9a1e6 100644
--- a/software/monitoring/src/test/java/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
+++ b/software/monitoring/src/test/java/brooklyn/entity/monitoring/monit/MonitIntegrationTest.java
@@ -18,7 +18,7 @@
  */
 package brooklyn.entity.monitoring.monit;
 
-import static brooklyn.util.GroovyJavaMethods.elvis;
+import static brooklyn.util.JavaGroovyEquivalents.elvis;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertNotEquals;
 


Mime
View raw message