You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by al...@apache.org on 2017/09/13 12:35:42 UTC

[1/4] brooklyn-library git commit: Improve config key descriptions

Repository: brooklyn-library
Updated Branches:
  refs/heads/master e6eb89a1a -> b4f1eaf1f


Improve config key descriptions

Also marks most important config keys as ‘CatalogConfig’ on some 
entities/policies/enrichers.


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

Branch: refs/heads/master
Commit: d1cb5c62ab6c72f2c8634c9b4023e9bd34f6d620
Parents: e6eb89a
Author: Aled Sage <al...@gmail.com>
Authored: Tue Sep 12 18:35:12 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Sep 12 18:35:12 2017 +0100

----------------------------------------------------------------------
 .../entity/database/DatastoreMixins.java        |  8 ++++-
 .../entity/database/mysql/MySqlNode.java        | 25 ++++++++-----
 .../brooklyn/entity/proxy/LoadBalancer.java     | 38 +++++++++++++++-----
 .../entity/proxy/nginx/NginxController.java     | 30 +++++++++++-----
 .../entity/webapp/tomcat/Tomcat8Server.java     |  6 ++--
 .../entity/webapp/tomcat/TomcatServer.java      | 20 +++++++----
 6 files changed, 93 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
index 5490e08..def05a3 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
@@ -25,6 +25,8 @@ import java.io.UnsupportedEncodingException;
 import javax.annotation.Nullable;
 
 import com.google.common.collect.ImmutableMap;
+
+import org.apache.brooklyn.api.catalog.CatalogConfig;
 import org.apache.brooklyn.api.effector.Effector;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.sensor.AttributeSensor;
@@ -69,22 +71,26 @@ public class DatastoreMixins {
     public static final ConfigKey<String> CREATION_SCRIPT_TEMPLATE = CanGiveCreationScript.CREATION_SCRIPT_TEMPLATE;
 
     public static interface CanGiveCreationScript {
+        @CatalogConfig(label = "Creation script contents")
         @SetFromFlag("creationScriptContents")
         public static final ConfigKey<String> CREATION_SCRIPT_CONTENTS = ConfigKeys.newStringConfigKey(
                 "datastore.creation.script.contents",
                 "Contents of creation script to initialize the datastore",
                 "");
 
+        @CatalogConfig(label = "Creation script URL")
         @SetFromFlag("creationScriptUrl")
         public static final ConfigKey<String> CREATION_SCRIPT_URL = ConfigKeys.newStringConfigKey(
                 "datastore.creation.script.url",
                 "URL of creation script to use to initialize the datastore (ignored if creationScriptContents is specified)",
                 "");
 
+        @CatalogConfig(label = "Creation script template URL")
         @SetFromFlag("creationScriptTemplateUrl")
         public static final ConfigKey<String> CREATION_SCRIPT_TEMPLATE = ConfigKeys.newStringConfigKey(
                 "datastore.creation.script.template.url",
-                "URL of creation script Freemarker template used to initialize the datastore (ignored if datastore.creation.script.contents or datastore.creation.script.url is specified)",
+                "URL of creation script Freemarker template used to initialize the datastore "
+                        + "(ignored if datastore.creation.script.contents or datastore.creation.script.url is specified)",
                 "");
     }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
index 568aac5..2996ff4 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlNode.java
@@ -61,7 +61,8 @@ public interface MySqlNode extends SoftwareProcess, HasShortName, DatastoreCommo
 
     @SetFromFlag("serverConf")
     MapConfigKey<Object> MYSQL_SERVER_CONF = new MapConfigKey<Object>(
-            Object.class, "mysql.server.conf", "Configuration options for mysqld");
+            Object.class, "mysql.server.conf", 
+            "Configuration options for mysqld (appended to mysql.conf in the format 'key = value')");
 
     ConfigKey<Object> MYSQL_SERVER_CONF_LOWER_CASE_TABLE_NAMES = MYSQL_SERVER_CONF.subKey("lower_case_table_names", "See MySQL guide. Set 1 to ignore case in table names (useful for OS portability)");
 
@@ -69,25 +70,31 @@ public interface MySqlNode extends SoftwareProcess, HasShortName, DatastoreCommo
     ConfigKey<Integer> MYSQL_SERVER_ID = ConfigKeys.newIntegerConfigKey("mysql.server_id", "Corresponds to server_id option", 0);
 
     @SetFromFlag("user")
-    AttributeSensor USER = Sensors.newStringSensor("mysql.user", "Database admin user (default is `root`)");
+    AttributeSensor<String> USER = Sensors.newStringSensor("mysql.user", 
+            "Database admin user (default is 'root')");
 
     @SetFromFlag("password")
     StringAttributeSensorAndConfigKey PASSWORD = new StringAttributeSensorAndConfigKey(
-            "mysql.password", "Database admin password (or randomly generated if not set)", null);
+            "mysql.password", 
+            "Database admin password (or randomly generated if not set)", 
+            null);
 
     @SetFromFlag("socketUid")
     StringAttributeSensorAndConfigKey SOCKET_UID = new StringAttributeSensorAndConfigKey(
-            "mysql.socketUid", "Socket uid, for use in file /tmp/mysql.sock.<uid>.3306 (or randomly generated if not set)", null);
+            "mysql.socketUid", 
+            "Socket uid, for use in file /tmp/mysql.sock.<uid>.3306 (or randomly generated if not set)", 
+            null);
 
     @SetFromFlag("generalLog")
-    ConfigKey GENERAL_LOG = ConfigKeys.newBooleanConfigKey("mysql.general_log", "Enable general log", false);
-
-    /** @deprecated since 0.7.0 use DATASTORE_URL */ @Deprecated
-    AttributeSensor<String> MYSQL_URL = DATASTORE_URL;
+    ConfigKey<Boolean> GENERAL_LOG = ConfigKeys.newBooleanConfigKey(
+            "mysql.general_log", 
+            "Enable general_log option in mysql.conf", 
+            false);
 
     @SetFromFlag("configurationTemplateUrl")
     BasicAttributeSensorAndConfigKey<String> TEMPLATE_CONFIGURATION_URL = new StringAttributeSensorAndConfigKey(
-            "mysql.template.configuration.url", "Template file (in freemarker format) for the mysql.conf file",
+            "mysql.template.configuration.url", 
+            "Template file (in freemarker format) for the mysql.conf file. The default respects other config options such as 'mysql.general_log'",
             "classpath://org/apache/brooklyn/entity/database/mysql/mysql.conf");
 
     AttributeSensor<Double> QUERIES_PER_SECOND_FROM_MYSQL = Sensors.newDoubleSensor("mysql.queries.perSec.fromMysql");

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/LoadBalancer.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/LoadBalancer.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/LoadBalancer.java
index 2a81d0d..6ff9cb4 100644
--- a/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/LoadBalancer.java
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/LoadBalancer.java
@@ -21,6 +21,7 @@ package org.apache.brooklyn.entity.proxy;
 import java.net.URI;
 import java.util.Map;
 
+import org.apache.brooklyn.api.catalog.CatalogConfig;
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.entity.Group;
 import org.apache.brooklyn.api.sensor.AttributeSensor;
@@ -55,45 +56,66 @@ import com.google.common.reflect.TypeToken;
  */
 public interface LoadBalancer extends Entity, Startable {
 
+    @CatalogConfig(label = "Server pool")
     @SetFromFlag("serverPool")
     ConfigKey<Group> SERVER_POOL = new BasicConfigKey<Group>(
-            Group.class, "loadbalancer.serverpool", "The default servers to route messages to");
+            Group.class, 
+            "loadbalancer.serverpool", 
+            "The default servers to route messages to (points at an entity of type 'Group' or 'Cluster')");
 
     @SetFromFlag("urlMappings")
     ConfigKey<Group> URL_MAPPINGS = new BasicConfigKey<Group>(
-            Group.class, "loadbalancer.urlmappings", "Special mapping rules (e.g. for domain/path matching, rewrite, etc); not supported by all load balancers");
+            Group.class, 
+            "loadbalancer.urlmappings", 
+            "Special mapping rules (e.g. for domain/path matching, rewrite, etc); not supported by all load balancers");
     
     /** sensor for port to forward to on target entities */
     @SuppressWarnings("serial")
     @SetFromFlag("portNumberSensor")
     public static final BasicAttributeSensorAndConfigKey<AttributeSensor<Integer>> PORT_NUMBER_SENSOR = new BasicAttributeSensorAndConfigKey<AttributeSensor<Integer>>(
-        new TypeToken<AttributeSensor<Integer>>() {}, "member.sensor.portNumber", "Port number sensor on members (defaults to http.port; not supported in all implementations)", Attributes.HTTP_PORT);
+        new TypeToken<AttributeSensor<Integer>>() {}, 
+        "member.sensor.portNumber", 
+        "Port number sensor on members (defaults to http.port; not supported in all implementations)", 
+        Attributes.HTTP_PORT);
 
     /** sensor for hostname to forward to on target entities */
     @SuppressWarnings("serial")
     @SetFromFlag("hostnameSensor")
     public static final BasicAttributeSensorAndConfigKey<AttributeSensor<String>> HOSTNAME_SENSOR = new BasicAttributeSensorAndConfigKey<AttributeSensor<String>>(
-        new TypeToken<AttributeSensor<String>>() {}, "member.sensor.hostname", "Hostname/IP sensor on members (defaults to host.subnet.hostname; not supported in all implementations)", Attributes.SUBNET_HOSTNAME);
+        new TypeToken<AttributeSensor<String>>() {}, 
+        "member.sensor.hostname", 
+        "Hostname/IP sensor on members (defaults to host.subnet.hostname; not supported in all implementations)", 
+        Attributes.SUBNET_HOSTNAME);
 
     /** sensor for hostname to forward to on target entities */
     @SuppressWarnings("serial")
     @SetFromFlag("hostAndPortSensor")
     public static final BasicAttributeSensorAndConfigKey<AttributeSensor<String>> HOST_AND_PORT_SENSOR = new BasicAttributeSensorAndConfigKey<AttributeSensor<String>>(
-            new TypeToken<AttributeSensor<String>>() {}, "member.sensor.hostandport", "host:port sensor on members (invalid to configure this and the portNumber or hostname sensors)", null);
+            new TypeToken<AttributeSensor<String>>() {}, 
+            "member.sensor.hostandport", 
+            "host:port sensor on members (invalid to configure this and the portNumber or hostname sensors)", 
+            null);
     
     @SetFromFlag("port")
     /** port where this controller should live */
     public static final PortAttributeSensorAndConfigKey PROXY_HTTP_PORT = new PortAttributeSensorAndConfigKey(
-            "proxy.http.port", "Main port where this proxy listens if using HTTP", ImmutableList.of(8000, "8001+"));
+            "proxy.http.port", 
+            "Main port where this proxy listens if using HTTP", 
+            ImmutableList.of(8000, "8001+"));
 
     @SetFromFlag("httpsPort")
     /** port where this controller should live */
     public static final PortAttributeSensorAndConfigKey PROXY_HTTPS_PORT = new PortAttributeSensorAndConfigKey(
-            "proxy.https.port", "Main port where this proxy listens if using HTTPS", ImmutableList.of(8443, "8443+"));
+            "proxy.https.port", 
+            "Main port where this proxy listens if using HTTPS", 
+            ImmutableList.of(8443, "8443+"));
 
     @SetFromFlag("protocol")
     public static final BasicAttributeSensorAndConfigKey<String> PROTOCOL = new BasicAttributeSensorAndConfigKey<String>(
-            String.class, "proxy.protocol", "Main URL protocol this proxy answers (typically http or https)", null);
+            String.class, 
+            "proxy.protocol", 
+            "Main URL protocol this proxy answers (typically http or https)", 
+            null);
     
     public static final AttributeSensor<String> HOSTNAME = Attributes.HOSTNAME;
     

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/nginx/NginxController.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/nginx/NginxController.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/nginx/NginxController.java
index a724a98..63cd317 100644
--- a/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/nginx/NginxController.java
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/proxy/nginx/NginxController.java
@@ -75,11 +75,15 @@ public interface NginxController extends AbstractController, HasShortName {
 
     @SetFromFlag("stickyVersion")
     ConfigKey<String> STICKY_VERSION = ConfigKeys.newStringConfigKey(
-            "nginx.sticky.version", "Version of ngnix-sticky-module to be installed, if required", "1.2.5");
+            "nginx.sticky.version", 
+            "Version of ngnix-sticky-module to be installed, if required", 
+            "1.2.5");
 
     @SetFromFlag("pcreVersion")
     ConfigKey<String> PCRE_VERSION = ConfigKeys.newStringConfigKey(
-            "pcre.version", "Version of PCRE to be installed, if required", "8.37");
+            "pcre.version", 
+            "Version of PCRE to be installed, if required", 
+            "8.37");
 
     @SetFromFlag("downloadUrl")
     AttributeSensorAndConfigKey<String, String> DOWNLOAD_URL = ConfigKeys.newSensorAndConfigKeyWithDefault(SoftwareProcess.DOWNLOAD_URL,
@@ -97,19 +101,25 @@ public interface NginxController extends AbstractController, HasShortName {
 
     @SetFromFlag("httpPollPeriod")
     ConfigKey<Long> HTTP_POLL_PERIOD = ConfigKeys.newLongConfigKey(
-            "nginx.sensorpoll.http", "Poll period (in milliseconds)", 1000L);
+            "nginx.sensorpoll.http", "Poll period (in milliseconds) for health-check over http", 1000L);
 
     @SetFromFlag("withLdOpt")
     ConfigKey<String> WITH_LD_OPT = ConfigKeys.newStringConfigKey(
-            "nginx.install.withLdOpt", "String to pass in with --with-ld-opt=\"<val>\" (and for OS X has pcre auto-appended to this)", "-L /usr/local/lib");
+            "nginx.install.withLdOpt", 
+            "String to pass in with --with-ld-opt=\"<val>\" (and for OS X has pcre auto-appended to this)", 
+            "-L /usr/local/lib");
 
     @SetFromFlag("withCcOpt")
     ConfigKey<String> WITH_CC_OPT = ConfigKeys.newStringConfigKey(
-            "nginx.install.withCcOpt", "String to pass in with --with-cc-opt=\"<val>\"", "-I /usr/local/include");
+            "nginx.install.withCcOpt", 
+            "String to pass in with --with-cc-opt=\"<val>\"", 
+            "-I /usr/local/include");
 
     @SetFromFlag("configGenerator")
     ConfigKey<NginxConfigFileGenerator> SERVER_CONF_GENERATOR = ConfigKeys.newConfigKey(NginxConfigFileGenerator.class,
-            "nginx.config.generator", "The server.conf generator class", new NginxDefaultConfigGenerator());
+            "nginx.config.generator", 
+            "The server.conf generator class", 
+            new NginxDefaultConfigGenerator());
 
     @SetFromFlag("configTemplate")
     ConfigKey<String> SERVER_CONF_TEMPLATE_URL = NginxTemplateConfigGenerator.SERVER_CONF_TEMPLATE_URL;
@@ -119,10 +129,14 @@ public interface NginxController extends AbstractController, HasShortName {
             "nginx.config.staticContentArchiveUrl", "The URL of an archive file of static content (To be copied to the server)");
 
     AttributeSensorAndConfigKey<String, String> ACCESS_LOG_LOCATION = ConfigKeys.newStringSensorAndConfigKey(
-            "nginx.log.access", "Nginx access log file location", "logs/access.log");
+            "nginx.log.access", 
+            "Nginx access log file location", 
+            "logs/access.log");
 
     AttributeSensorAndConfigKey<String, String> ERROR_LOG_LOCATION = ConfigKeys.newStringSensorAndConfigKey(
-            "nginx.log.error", "Nginx error log file location", "logs/error.log");
+            "nginx.log.error", 
+            "Nginx error log file location", 
+            "logs/error.log");
 
     boolean isSticky();
 

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
index f638483..47ce648 100644
--- a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/Tomcat8Server.java
@@ -48,11 +48,13 @@ public interface Tomcat8Server extends TomcatServer {
 
     @SetFromFlag("server.xml")
     ConfigKey<String> SERVER_XML_RESOURCE = ConfigKeys.newStringConfigKey(
-            "tomcat.serverxml", "The file to template and use as the Tomcat process' server.xml",
+            "tomcat.serverxml", 
+            "The file to template and use as the Tomcat's server.xml",
             JavaClassNames.resolveClasspathUrl(Tomcat8Server.class, "tomcat8-server.xml"));
 
     @SetFromFlag("web.xml")
     ConfigKey<String> WEB_XML_RESOURCE = ConfigKeys.newStringConfigKey(
-            "tomcat.webxml", "The file to template and use as the Tomcat process' web.xml",
+            "tomcat.webxml", 
+            "The file to template and use as the Tomcat's web.xml",
             JavaClassNames.resolveClasspathUrl(Tomcat8Server.class, "tomcat8-web.xml"));
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/d1cb5c62/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
index f71bd41..08849a4 100644
--- a/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
+++ b/software/webapp/src/main/java/org/apache/brooklyn/entity/webapp/tomcat/TomcatServer.java
@@ -19,6 +19,7 @@
 package org.apache.brooklyn.entity.webapp.tomcat;
 
 import org.apache.brooklyn.api.catalog.Catalog;
+import org.apache.brooklyn.api.catalog.CatalogConfig;
 import org.apache.brooklyn.api.entity.ImplementedBy;
 import org.apache.brooklyn.api.objs.HasShortName;
 import org.apache.brooklyn.api.sensor.AttributeSensor;
@@ -30,6 +31,7 @@ import org.apache.brooklyn.core.sensor.PortAttributeSensorAndConfigKey;
 import org.apache.brooklyn.core.sensor.Sensors;
 import org.apache.brooklyn.entity.java.UsesJmx;
 import org.apache.brooklyn.entity.software.base.SoftwareProcess;
+import org.apache.brooklyn.entity.webapp.JavaWebAppService;
 import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess;
 import org.apache.brooklyn.util.core.ResourcePredicates;
 import org.apache.brooklyn.util.core.flags.SetFromFlag;
@@ -45,6 +47,10 @@ import org.apache.brooklyn.util.time.Duration;
 @ImplementedBy(TomcatServerImpl.class)
 public interface TomcatServer extends JavaWebAppSoftwareProcess, UsesJmx, HasShortName {
 
+    @CatalogConfig(label = "Root WAR")
+    @SetFromFlag("war")
+    public static final ConfigKey<String> ROOT_WAR = JavaWebAppService.ROOT_WAR;
+
     @SetFromFlag("version")
     ConfigKey<String> SUGGESTED_VERSION = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.SUGGESTED_VERSION, "7.0.65");
 
@@ -61,13 +67,14 @@ public interface TomcatServer extends JavaWebAppSoftwareProcess, UsesJmx, HasSho
      * so override default here to a high-numbered port.
      */
     @SetFromFlag("shutdownPort")
-    PortAttributeSensorAndConfigKey SHUTDOWN_PORT =
-            ConfigKeys.newPortSensorAndConfigKey("tomcat.shutdownport", "Suggested shutdown port", PortRanges.fromString("31880+"));
+    PortAttributeSensorAndConfigKey SHUTDOWN_PORT = ConfigKeys.newPortSensorAndConfigKey(
+            "tomcat.shutdownport", 
+            "Suggested shutdown port", PortRanges.fromString("31880+"));
 
     @SetFromFlag("server.xml")
     ConfigKey<String> SERVER_XML_RESOURCE = ConfigKeys.builder(String.class)
             .name("tomcat.serverxml")
-            .description("The file to template and use as the Tomcat process' server.xml")
+            .description("The file to template and use as the Tomcat's server.xml")
             .defaultValue(JavaClassNames.resolveClasspathUrl(TomcatServer.class, "server.xml"))
             .constraint(ResourcePredicates.urlExists())
             .build();
@@ -75,15 +82,16 @@ public interface TomcatServer extends JavaWebAppSoftwareProcess, UsesJmx, HasSho
     @SetFromFlag("web.xml")
     ConfigKey<String> WEB_XML_RESOURCE = ConfigKeys.builder(String.class)
             .name("tomcat.webxml")
-            .description("The file to template and use as the Tomcat process' web.xml")
+            .description("The file to template and use as the Tomcat's web.xml")
             .defaultValue(JavaClassNames.resolveClasspathUrl(TomcatServer.class, "web.xml"))
             .constraint(ResourcePredicates.urlExists())
             .build();
 
     ConfigKey<Duration> START_TIMEOUT = ConfigKeys.newConfigKeyWithDefault(SoftwareProcess.START_TIMEOUT, Duration.FIVE_MINUTES);
 
-    AttributeSensor<String> CONNECTOR_STATUS =
-            Sensors.newStringSensor("webapp.tomcat.connectorStatus", "Catalina connector state name");
+    AttributeSensor<String> CONNECTOR_STATUS = Sensors.newStringSensor(
+            "webapp.tomcat.connectorStatus", 
+            "Catalina connector state name");
 
     AttributeSensor<String> JMX_SERVICE_URL = UsesJmx.JMX_URL;
 


[3/4] brooklyn-library git commit: DatastoreMixins.CanExecuteScript.COMMANDS: remove

Posted by al...@apache.org.
DatastoreMixins.CanExecuteScript.COMMANDS: remove

Because entities extend this interface, they were reporting this as a
config key on the entity rather than just on the effector. Therefore
remove it as a constant.

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

Branch: refs/heads/master
Commit: 0d59c30c6fe7d84cd9e9ce9fc84851cd4399ec6a
Parents: 021400c
Author: Aled Sage <al...@gmail.com>
Authored: Tue Sep 12 18:36:33 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Sep 12 18:36:33 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/brooklyn/entity/database/DatastoreMixins.java | 3 +--
 .../apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java  | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/0d59c30c/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
index def05a3..dc46f68 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/DatastoreMixins.java
@@ -58,10 +58,9 @@ public class DatastoreMixins {
     public static final Effector<String> EXECUTE_SCRIPT = CanExecuteScript.EXECUTE_SCRIPT;
     
     public static interface CanExecuteScript {
-        ConfigKey<String> COMMANDS = ConfigKeys.newStringConfigKey("commands");
         Effector<String> EXECUTE_SCRIPT = Effectors.effector(String.class, "executeScript")
             .description("executes the given script contents")
-            .parameter(COMMANDS)
+            .parameter(ConfigKeys.newStringConfigKey("commands"))
             .buildAbstract();
     }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/0d59c30c/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java
----------------------------------------------------------------------
diff --git a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java
index 9f8dc6d..7ba1ce0 100644
--- a/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java
+++ b/software/database/src/main/java/org/apache/brooklyn/entity/database/mysql/MySqlClusterUtils.java
@@ -37,7 +37,7 @@ public class MySqlClusterUtils {
 
     // Can't call node.executeScript directly, need to change execution context, so use an effector task
     protected static Task<String> executeSqlOnNodeAsync(MySqlNode node, String commands) {
-        return DynamicTasks.queue(Effectors.invocation(node, MySqlNode.EXECUTE_SCRIPT, ImmutableMap.of(CanExecuteScript.COMMANDS.getName(), commands))).asTask();
+        return DynamicTasks.queue(Effectors.invocation(node, MySqlNode.EXECUTE_SCRIPT, ImmutableMap.of("commands", commands))).asTask();
     }
 
     protected static String validateSqlParam(String config) {


[4/4] brooklyn-library git commit: This closes #125

Posted by al...@apache.org.
This closes #125


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

Branch: refs/heads/master
Commit: b4f1eaf1f70fbc6036e4d4d60858d48fd2dda3fb
Parents: e6eb89a 0d59c30
Author: Aled Sage <al...@gmail.com>
Authored: Wed Sep 13 13:35:27 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Wed Sep 13 13:35:27 2017 +0100

----------------------------------------------------------------------
 .../entity/database/DatastoreMixins.java        | 11 ++++--
 .../database/mysql/MySqlClusterUtils.java       |  2 +-
 .../entity/database/mysql/MySqlNode.java        | 25 ++++++++-----
 .../database/src/main/resources/catalog.bom     |  5 +++
 .../messaging/src/main/resources/catalog.bom    |  6 ++++
 software/nosql/src/main/resources/catalog.bom   | 12 +++++++
 .../brooklyn/entity/proxy/LoadBalancer.java     | 38 +++++++++++++++-----
 .../entity/proxy/nginx/NginxController.java     | 30 +++++++++++-----
 .../entity/webapp/tomcat/Tomcat8Server.java     |  6 ++--
 .../entity/webapp/tomcat/TomcatServer.java      | 20 +++++++----
 software/webapp/src/main/resources/catalog.bom  | 23 ++++++++----
 11 files changed, 134 insertions(+), 44 deletions(-)
----------------------------------------------------------------------



[2/4] brooklyn-library git commit: catalog.bom: improve names/descriptions

Posted by al...@apache.org.
catalog.bom: improve names/descriptions

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

Branch: refs/heads/master
Commit: 021400ced7b1e94eb78bed074509fa67af0d37a1
Parents: d1cb5c6
Author: Aled Sage <al...@gmail.com>
Authored: Tue Sep 12 18:35:28 2017 +0100
Committer: Aled Sage <al...@gmail.com>
Committed: Tue Sep 12 18:35:28 2017 +0100

----------------------------------------------------------------------
 .../database/src/main/resources/catalog.bom     |  5 +++++
 .../messaging/src/main/resources/catalog.bom    |  6 +++++
 software/nosql/src/main/resources/catalog.bom   | 12 ++++++++++
 software/webapp/src/main/resources/catalog.bom  | 23 ++++++++++++++------
 4 files changed, 39 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/021400ce/software/database/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/software/database/src/main/resources/catalog.bom b/software/database/src/main/resources/catalog.bom
index 6af8b72..e033aa7 100644
--- a/software/database/src/main/resources/catalog.bom
+++ b/software/database/src/main/resources/catalog.bom
@@ -22,6 +22,8 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.database.crate.CrateNode
       item:
         type: org.apache.brooklyn.entity.database.crate.CrateNode
+        name: Crate Node
+        description: CrateDB offers Standard-SQL real-time queries and document support
     - id: org.apache.brooklyn.entity.database.mysql.MySqlNode
       item:
         type: org.apache.brooklyn.entity.database.mysql.MySqlNode
@@ -40,6 +42,9 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.database.rubyrep.RubyRepNode
       item:
         type: org.apache.brooklyn.entity.database.rubyrep.RubyRepNode
+        name: RubyRep Node
+        description: RubyRep is a database replication system
+        iconUrl: classpath:///rubyrep-logo.jpeg
     - id: org.apache.brooklyn.entity.database.mariadb.MariaDbNode
       item:
         type: org.apache.brooklyn.entity.database.mariadb.MariaDbNode

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/021400ce/software/messaging/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/software/messaging/src/main/resources/catalog.bom b/software/messaging/src/main/resources/catalog.bom
index 5d2cbfb..43cd9ca 100644
--- a/software/messaging/src/main/resources/catalog.bom
+++ b/software/messaging/src/main/resources/catalog.bom
@@ -42,6 +42,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.messaging.activemq.ActiveMQQueue
       item:
         type: org.apache.brooklyn.entity.messaging.activemq.ActiveMQQueue
+        name: ActiveMQ Queue
     - id: org.apache.brooklyn.entity.zookeeper.ZooKeeperEnsemble
       item:
         type: org.apache.brooklyn.entity.zookeeper.ZooKeeperEnsemble
@@ -50,12 +51,15 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.messaging.kafka.KafkaZooKeeper
       item:
         type: org.apache.brooklyn.entity.messaging.kafka.KafkaZooKeeper
+        name: Kafka ZooKeeper
     - id: org.apache.brooklyn.entity.messaging.activemq.ActiveMQTopic
       item:
         type: org.apache.brooklyn.entity.messaging.activemq.ActiveMQTopic
+        name: ActiveMQ Topic
     - id: org.apache.brooklyn.entity.messaging.qpid.QpidQueue
       item:
         type: org.apache.brooklyn.entity.messaging.qpid.QpidQueue
+        name: Qpid Queue
     - id: org.apache.brooklyn.entity.zookeeper.ZooKeeperNode
       item:
         type: org.apache.brooklyn.entity.zookeeper.ZooKeeperNode
@@ -69,9 +73,11 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.messaging.kafka.KafkaBroker
       item:
         type: org.apache.brooklyn.entity.messaging.kafka.KafkaBroker
+        name: Kafka Broker
     - id: org.apache.brooklyn.entity.messaging.qpid.QpidTopic
       item:
         type: org.apache.brooklyn.entity.messaging.qpid.QpidTopic
+        name: Qpid Topic
     - id: org.apache.brooklyn.entity.messaging.storm.StormDeployment
       item:
         type: org.apache.brooklyn.entity.messaging.storm.StormDeployment

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/021400ce/software/nosql/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/software/nosql/src/main/resources/catalog.bom b/software/nosql/src/main/resources/catalog.bom
index 0779dc2..f9976f1 100644
--- a/software/nosql/src/main/resources/catalog.bom
+++ b/software/nosql/src/main/resources/catalog.bom
@@ -27,6 +27,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBRouterCluster
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBRouterCluster
+        name: MongoDB Router Cluster
     - id: org.apache.brooklyn.entity.nosql.cassandra.CassandraDatacenter
       item:
         type: org.apache.brooklyn.entity.nosql.cassandra.CassandraDatacenter
@@ -44,6 +45,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.redis.RedisShard
       item:
         type: org.apache.brooklyn.entity.nosql.redis.RedisShard
+        name: Redis Shard
     - id: org.apache.brooklyn.entity.nosql.redis.RedisCluster
       item:
         type: org.apache.brooklyn.entity.nosql.redis.RedisCluster
@@ -57,6 +59,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.couchdb.CouchDBCluster
       item:
         type: org.apache.brooklyn.entity.nosql.couchdb.CouchDBCluster
+        name: CouchDB Cluster
     - id: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseNode
       item:
         type: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseNode
@@ -79,6 +82,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBConfigServerCluster
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBConfigServerCluster
+        name: MongoDB Config Server Cluster
     - id: org.apache.brooklyn.entity.nosql.mongodb.MongoDBServer
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.MongoDBServer
@@ -90,12 +94,15 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.mongodb.MongoDBReplicaSet
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.MongoDBReplicaSet
+        name: MongoDB Replica Set
     - id: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBShardCluster
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBShardCluster
+        name: MongoDB Shard Cluster
     - id: org.apache.brooklyn.entity.nosql.mongodb.MongoDBClient
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.MongoDBClient
+        name: MongoDB Client
     - id: org.apache.brooklyn.entity.nosql.elasticsearch.ElasticSearchNode
       item:
         type: org.apache.brooklyn.entity.nosql.elasticsearch.ElasticSearchNode
@@ -114,12 +121,15 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.cassandra.CassandraCluster
       item:
         type: org.apache.brooklyn.entity.nosql.cassandra.CassandraCluster
+        name: Cassandra Cluster
     - id: org.apache.brooklyn.entity.nosql.redis.RedisSlave
       item:
         type: org.apache.brooklyn.entity.nosql.redis.RedisSlave
+        name: Redis Slave
     - id: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBConfigServer
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.sharding.MongoDBConfigServer
+        name: MongoDB Config Server
     - id: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseCluster
       item:
         type: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseCluster
@@ -128,6 +138,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseSyncGateway
       item:
         type: org.apache.brooklyn.entity.nosql.couchbase.CouchbaseSyncGateway
+        name: Couchbase Sync Gateway
     - id: org.apache.brooklyn.entity.nosql.hazelcast.HazelcastNode
       item:
         type: org.apache.brooklyn.entity.nosql.hazelcast.HazelcastNode
@@ -141,6 +152,7 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.nosql.mongodb.sharding.CoLocatedMongoDBRouter
       item:
         type: org.apache.brooklyn.entity.nosql.mongodb.sharding.CoLocatedMongoDBRouter
+        name: Co-located MongoDB Router
 
 
     - id: bash-web-and-riak-template

http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/021400ce/software/webapp/src/main/resources/catalog.bom
----------------------------------------------------------------------
diff --git a/software/webapp/src/main/resources/catalog.bom b/software/webapp/src/main/resources/catalog.bom
index 7e2fdd3..c694bdd 100644
--- a/software/webapp/src/main/resources/catalog.bom
+++ b/software/webapp/src/main/resources/catalog.bom
@@ -31,9 +31,11 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.proxy.nginx.UrlMapping
       item:
         type: org.apache.brooklyn.entity.proxy.nginx.UrlMapping
+        name: URL Mapping
     - id: org.apache.brooklyn.entity.webapp.DynamicWebAppFabric
       item:
         type: org.apache.brooklyn.entity.webapp.DynamicWebAppFabric
+        name: Dynamic Web App Fabric
     - id: org.apache.brooklyn.entity.proxy.nginx.NginxController
       item:
         type: org.apache.brooklyn.entity.proxy.nginx.NginxController
@@ -47,10 +49,14 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server
       item:
         type: org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server
-        name: Tomcat Server
+        name: Tomcat 8 Server
     - id: org.apache.brooklyn.entity.proxy.LoadBalancerCluster
       item:
         type: org.apache.brooklyn.entity.proxy.LoadBalancerCluster
+        name: Load-balanced Cluster
+        description: |
+          A cluster of load balancers; configuring the cluster (through the LoadBalancer interface)
+          will configure all load balancers in the cluster.
     - id: org.apache.brooklyn.entity.webapp.jetty.Jetty6Server
       item:
         type: org.apache.brooklyn.entity.webapp.jetty.Jetty6Server
@@ -64,10 +70,12 @@ brooklyn.catalog:
     - id: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
       item:
         type: org.apache.brooklyn.entity.webapp.tomcat.TomcatServer
-        name: Tomcat Server
+        name: Tomcat 7 Server
     - id: org.apache.brooklyn.entity.dns.geoscaling.GeoscalingDnsService
       item:
         type: org.apache.brooklyn.entity.dns.geoscaling.GeoscalingDnsService
+        name: Geoscaling DNS Service
+        description: A geo-DNS service using geoscaling.com
     - id: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
       item:
         type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster
@@ -75,14 +83,15 @@ brooklyn.catalog:
         description: A cluster of load-balanced web-apps, which can be dynamically re-sized
 
     - id: load-balancer
-      description: |
-        Create a load balancer which will point at members in the group entity
-        referred to by the config key "serverPool".
-        The sensor advertising the port can be configured with the "member.sensor.portNumber" config key,
-        defaulting to `http.port`; all member entities which have published "service.up" will then be picked up.
       item:
         type: org.apache.brooklyn.entity.proxy.nginx.NginxController
         name: Load Balancer (nginx)
+        description: |
+          Synonym for 'Nginx Server'.
+          Create a load balancer which will point at members in the group entity
+          referred to by the config key "serverPool".
+          The sensor advertising the port can be configured with the "member.sensor.portNumber" config key,
+          defaulting to `http.port`; all member entities which have published "service.up" will then be picked up.
 
     - id: resilient-bash-web-cluster-template
       itemType: template