brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aleds...@apache.org
Subject [1/7] git commit: Fix a bunch of log messages and comments
Date Fri, 18 Jul 2014 12:38:24 GMT
Repository: incubator-brooklyn
Updated Branches:
  refs/heads/master bf71719c8 -> 935236ec8


Fix a bunch of log messages and comments


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

Branch: refs/heads/master
Commit: af9c4c0d8839eeb74839b2f0d9940785d97f7aec
Parents: 4587633
Author: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Authored: Wed Jul 9 18:08:44 2014 +0100
Committer: Sam Corbett <sam.corbett@cloudsoftcorp.com>
Committed: Wed Jul 16 19:19:49 2014 +0100

----------------------------------------------------------------------
 .../brooklyn/catalog/internal/CatalogLibrariesDo.java     |  3 ++-
 .../java/brooklyn/location/basic/LocationConfigUtils.java |  2 --
 .../brooklyn/location/geo/LocalhostExternalIpLoader.java  |  3 +--
 .../main/java/brooklyn/entity/nosql/redis/RedisStore.java |  2 --
 .../java/brooklyn/entity/nosql/redis/RedisStoreImpl.java  |  2 +-
 .../java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java  |  4 ++--
 .../io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java   |  4 ++--
 .../JavaWebAppWithDslYamlRebindIntegrationTest.java       |  4 ++--
 .../src/main/java/brooklyn/rest/api/LocationApi.java      |  5 -----
 .../java/brooklyn/rest/transform/LocationTransformer.java | 10 +++++++---
 .../brooklyn/rest/util/BrooklynRestResourceUtils.java     |  4 ++--
 11 files changed, 19 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDo.java b/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDo.java
index 1be3253..5f95a40 100644
--- a/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDo.java
+++ b/core/src/main/java/brooklyn/catalog/internal/CatalogLibrariesDo.java
@@ -68,7 +68,8 @@ public class CatalogLibrariesDo implements CatalogItem.CatalogItemLibraries
{
         for (String bundleUrl : bundles) {
             osgi.get().registerBundle(bundleUrl);
         }
-        LOG.debug("Catalog registered {} bundles in {}", bundles.size(), Time.makeTimeStringRounded(timer));
+        LOG.debug("{} registered {} bundles in {}",
+                new Object[]{bundles.size(), Time.makeTimeStringRounded(timer)});
     }
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/core/src/main/java/brooklyn/location/basic/LocationConfigUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/basic/LocationConfigUtils.java b/core/src/main/java/brooklyn/location/basic/LocationConfigUtils.java
index 4785842..077bec2 100644
--- a/core/src/main/java/brooklyn/location/basic/LocationConfigUtils.java
+++ b/core/src/main/java/brooklyn/location/basic/LocationConfigUtils.java
@@ -110,8 +110,6 @@ public class LocationConfigUtils {
      * Returns the file contents, or null if none of the files can be read.
      *  
      * @param files             list of file paths
-     * @param fileContext       what this file refers to (e.g. privateKeyFile)
-     * @param configDescription what this file is being read for 
      */
     private static String getFileContents(Iterable<String> files) {
         int size = Iterables.size(files);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java
index b6a3bc0..aa9714e 100644
--- a/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java
+++ b/core/src/main/java/brooklyn/location/geo/LocalhostExternalIpLoader.java
@@ -143,7 +143,7 @@ public class LocalhostExternalIpLoader {
                         try {
                             LOG.debug("Looking up external IP of this host from {} in private
thread {}", url, Thread.currentThread());
                             localExternalIp = new IpLoader(url).call();
-                            LOG.debug("Finished looking up external IP of this host from
{} in private thread, result ", url, localExternalIp);
+                            LOG.debug("Finished looking up external IP of this host from
{} in private thread, result {}", url, localExternalIp);
                             break;
                         } catch (Throwable t) {
                             LOG.debug("Unable to look up external IP of this host from {},
probably offline {})", url, t);
@@ -168,7 +168,6 @@ public class LocalhostExternalIpLoader {
         if (localExternalIp == null) {
             return null;
         }
-        LOG.debug("Looked up external IP of this host, result is: {}", localExternalIp);
         return localExternalIp;
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStore.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStore.java b/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStore.java
index 3240fa5..85b2ef5 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStore.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStore.java
@@ -31,8 +31,6 @@ import brooklyn.util.flags.SetFromFlag;
 
 /**
  * An entity that represents a Redis key-value store service.
- *
- * TODO add sensors with Redis statistics using INFO command
  */
 @Catalog(name="Redis Server", description="Redis is an open-source, networked, in-memory,
key-value data store with optional durability", iconUrl="classpath:///redis-logo.png")
 @ImplementedBy(RedisStoreImpl.class)

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStoreImpl.java
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStoreImpl.java
b/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStoreImpl.java
index 9caf863..7957099 100644
--- a/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStoreImpl.java
+++ b/software/nosql/src/main/java/brooklyn/entity/nosql/redis/RedisStoreImpl.java
@@ -125,9 +125,9 @@ public class RedisStoreImpl extends SoftwareProcessImpl implements RedisStore
{
 
     @Override
     public void disconnectSensors() {
-        super.disconnectSensors();
         disconnectServiceUpIsRunning();
         if (sshFeed != null) sshFeed.stop();
+        super.disconnectSensors();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java
index f27e0ca..6e84d09 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/AbstractYamlTest.java
@@ -54,7 +54,7 @@ public abstract class AbstractYamlTest {
     protected ManagementContext mgmt() { return brooklynMgmt; }
     
     @BeforeMethod(alwaysRun = true)
-    public void setup() {
+    public void setUp() {
         launcher = new BrooklynCampPlatformLauncherNoServer() {
             @Override
             protected LocalManagementContext newMgmtContext() {
@@ -71,7 +71,7 @@ public abstract class AbstractYamlTest {
     }
     
     @AfterMethod(alwaysRun = true)
-    public void teardown() {
+    public void tearDown() {
         if (brooklynMgmt != null) Entities.destroyAll(brooklynMgmt);
         if (launcher != null) launcher.stopServers();
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java
b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java
index 32a538e..eb99cff 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/DslAndRebindYamlTest.java
@@ -64,9 +64,9 @@ public class DslAndRebindYamlTest extends AbstractYamlTest {
     
     @AfterMethod(alwaysRun = true)
     @Override
-    public void teardown() {
+    public void tearDown() {
         for (ManagementContext mgmt: mgmtContexts) Entities.destroyAll(mgmt);
-        super.teardown();
+        super.tearDown();
         mementoDir = null;
         mgmtContexts.clear();
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/JavaWebAppWithDslYamlRebindIntegrationTest.java
----------------------------------------------------------------------
diff --git a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/JavaWebAppWithDslYamlRebindIntegrationTest.java
b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/JavaWebAppWithDslYamlRebindIntegrationTest.java
index 882fe05..0a99473 100644
--- a/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/JavaWebAppWithDslYamlRebindIntegrationTest.java
+++ b/usage/camp/src/test/java/io/brooklyn/camp/brooklyn/JavaWebAppWithDslYamlRebindIntegrationTest.java
@@ -65,9 +65,9 @@ public class JavaWebAppWithDslYamlRebindIntegrationTest extends AbstractYamlTest
     
     @AfterMethod(alwaysRun = true)
     @Override
-    public void teardown() {
+    public void tearDown() {
         for (ManagementContext mgmt: mgmtContexts) Entities.destroyAll(mgmt);
-        super.teardown();
+        super.tearDown();
         mementoDir = null;
         mgmtContexts.clear();
     }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/rest-api/src/main/java/brooklyn/rest/api/LocationApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/brooklyn/rest/api/LocationApi.java b/usage/rest-api/src/main/java/brooklyn/rest/api/LocationApi.java
index 21100d0..1134202 100644
--- a/usage/rest-api/src/main/java/brooklyn/rest/api/LocationApi.java
+++ b/usage/rest-api/src/main/java/brooklyn/rest/api/LocationApi.java
@@ -72,11 +72,6 @@ public interface LocationApi {
           @DefaultValue("false")
           @QueryParam("full") String fullConfig) ;
 
-  // breaks BrooklynApi -- as method needs an annotation
-//  /** @deprecated since 0.7.0; REST call now handled by above (optional query parameter
added) */
-//  @Deprecated
-//  public LocationSummary get(String locationId);
-
   @POST
   @ApiOperation(value = "Create a new location", responseClass = "String")
   public Response create(

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/rest-server/src/main/java/brooklyn/rest/transform/LocationTransformer.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/transform/LocationTransformer.java
b/usage/rest-server/src/main/java/brooklyn/rest/transform/LocationTransformer.java
index f822d8f..d9b5ff5 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/transform/LocationTransformer.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/transform/LocationTransformer.java
@@ -52,8 +52,9 @@ public class LocationTransformer {
         return newInstance(null, id, locationSpec, LocationDetailLevel.LOCAL_EXCLUDING_SECRET);
     }
     public static LocationSummary newInstance(ManagementContext mgmt, String id, LocationSpec
locationSpec, LocationDetailLevel level) {
+        // TODO: Remove null checks on mgmt when newInstance(String, LocationSpec) is deleted
         Map<String, ?> config = locationSpec.getConfig();
-        if (level==LocationDetailLevel.FULL_EXCLUDING_SECRET || level==LocationDetailLevel.FULL_INCLUDING_SECRET)
{
+        if (mgmt != null && (level==LocationDetailLevel.FULL_EXCLUDING_SECRET ||
level==LocationDetailLevel.FULL_INCLUDING_SECRET)) {
             LocationDefinition ld = new BasicLocationDefinition(id, locationSpec.getName(),
locationSpec.getSpec(), locationSpec.getConfig());
             Location ll = mgmt.getLocationRegistry().resolveForPeeking(ld);
             if (ll!=null) config = ll.getAllConfig(true);
@@ -82,17 +83,20 @@ public class LocationTransformer {
     }
 
     /** @deprecated since 0.7.0 use method taking management context and detail specifier
*/
+    @Deprecated
     public static LocationSummary newInstance(LocationDefinition l) {
         return newInstance(null, l, LocationDetailLevel.LOCAL_EXCLUDING_SECRET);
     }
+
     public static LocationSummary newInstance(ManagementContext mgmt, LocationDefinition
l, LocationDetailLevel level) {
+        // TODO: Can remove null checks on mgmt when newInstance(LocationDefinition) is deleted
         Map<String, Object> config = l.getConfig();
-        if (level==LocationDetailLevel.FULL_EXCLUDING_SECRET || level==LocationDetailLevel.FULL_INCLUDING_SECRET)
{
+        if (mgmt != null && (level==LocationDetailLevel.FULL_EXCLUDING_SECRET ||
level==LocationDetailLevel.FULL_INCLUDING_SECRET)) {
             Location ll = mgmt.getLocationRegistry().resolveForPeeking(l);
             if (ll!=null) config = ll.getAllConfig(true);
         } else if (level==LocationDetailLevel.LOCAL_EXCLUDING_SECRET) {
             // get displayName
-            if (!config.containsKey(LocationConfigKeys.DISPLAY_NAME.getName())) {
+            if (mgmt != null && !config.containsKey(LocationConfigKeys.DISPLAY_NAME.getName()))
{
                 Location ll = mgmt.getLocationRegistry().resolveForPeeking(l);
                 if (ll!=null) {
                     Map<String, Object> configExtra = ll.getAllConfig(true);

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/af9c4c0d/usage/rest-server/src/main/java/brooklyn/rest/util/BrooklynRestResourceUtils.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/brooklyn/rest/util/BrooklynRestResourceUtils.java
b/usage/rest-server/src/main/java/brooklyn/rest/util/BrooklynRestResourceUtils.java
index 9db3f10..cec183d 100644
--- a/usage/rest-server/src/main/java/brooklyn/rest/util/BrooklynRestResourceUtils.java
+++ b/usage/rest-server/src/main/java/brooklyn/rest/util/BrooklynRestResourceUtils.java
@@ -97,7 +97,7 @@ public class BrooklynRestResourceUtils {
     }
 
     /** finds the policy indicated by the given ID or name.
-     * @see {@link getEntity(String,String)}; it then searches the policies of that
+     * @see {@link #getEntity(String,String)}; it then searches the policies of that
      * entity for one whose ID or name matches that given.
      * <p>
      * 
@@ -107,7 +107,7 @@ public class BrooklynRestResourceUtils {
     }
 
     /** finds the policy indicated by the given ID or name.
-     * @see {@link getPolicy(String,String,String)}.
+     * @see {@link #getPolicy(String,String,String)}.
      * <p>
      * 
      * @throws 404 or 412 (unless input is null in which case output is null) */


Mime
View raw message