Return-Path: X-Original-To: apmail-brooklyn-commits-archive@minotaur.apache.org Delivered-To: apmail-brooklyn-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99E3A1866F for ; Thu, 13 Aug 2015 16:46:10 +0000 (UTC) Received: (qmail 42004 invoked by uid 500); 13 Aug 2015 16:45:54 -0000 Delivered-To: apmail-brooklyn-commits-archive@brooklyn.apache.org Received: (qmail 41980 invoked by uid 500); 13 Aug 2015 16:45:54 -0000 Mailing-List: contact commits-help@brooklyn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@brooklyn.incubator.apache.org Delivered-To: mailing list commits@brooklyn.incubator.apache.org Received: (qmail 41971 invoked by uid 99); 13 Aug 2015 16:45:54 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Aug 2015 16:45:54 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 117C3C20E5 for ; Thu, 13 Aug 2015 16:45:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.301 X-Spam-Level: **** X-Spam-Status: No, score=4.301 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RDNS_NONE=2.5, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id U37OCi_Ac5Tb for ; Thu, 13 Aug 2015 16:45:15 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id 506E032561 for ; Wed, 12 Aug 2015 23:17:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 08BFBC12DC for ; Wed, 12 Aug 2015 23:17:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id vz_eo6-_mFIr for ; Wed, 12 Aug 2015 23:15:40 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTP id 161D7512B9 for ; Wed, 12 Aug 2015 23:15:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 9B419C027A for ; Wed, 12 Aug 2015 23:15:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id p4a4dcfYAz5T for ; Wed, 12 Aug 2015 23:14:41 +0000 (UTC) Received: from spamd1-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id BD3F734BE6 for ; Wed, 12 Aug 2015 20:38:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 22410DCBA7 for ; Wed, 12 Aug 2015 20:38:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 9Wu-LcICfq7u for ; Wed, 12 Aug 2015 20:37:57 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 3A7DC34BE6 for ; Wed, 12 Aug 2015 17:24:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 992D3C12DC for ; Wed, 12 Aug 2015 17:24:13 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id csWThX4YwuJh for ; Wed, 12 Aug 2015 17:22:36 +0000 (UTC) Received: from spamd1-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id 1556134A3E for ; Wed, 12 Aug 2015 17:17:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4DBE9DCA79 for ; Wed, 12 Aug 2015 17:17:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Yid7NtZUvPA4 for ; Wed, 12 Aug 2015 17:16:46 +0000 (UTC) Received: from spamd4-us-west.apache.org (unknown [209.188.14.142]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTP id AE3CE34A71 for ; Wed, 12 Aug 2015 15:56:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E290DC1320 for ; Wed, 12 Aug 2015 15:56:31 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id BHyoQlhypC_4 for ; Wed, 12 Aug 2015 15:55:33 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id 25B0642BF2 for ; Wed, 12 Aug 2015 15:55:21 +0000 (UTC) Received: (qmail 66331 invoked by uid 99); 12 Aug 2015 15:55:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Aug 2015 15:55:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B6509E3619; Wed, 12 Aug 2015 15:55:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aledsage@apache.org To: commits@brooklyn.incubator.apache.org Date: Wed, 12 Aug 2015 15:55:45 -0000 Message-Id: <16c45476174a481e9cd5d95b339b4dc8@git.apache.org> In-Reply-To: <86a4cb0cc0ac4b3c8aa5cd4b2a09ae2e@git.apache.org> References: <86a4cb0cc0ac4b3c8aa5cd4b2a09ae2e@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [27/35] incubator-brooklyn git commit: [BROOKLYN-162] package rename to org.apache.brooklyn: software/webapp [BROOKLYN-162] package rename to org.apache.brooklyn: software/webapp Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/77dff880 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/77dff880 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/77dff880 Branch: refs/heads/master Commit: 77dff8809498bc3b50d487f79926cafd877644cf Parents: e0ee89e Author: Yavor Yanchev Authored: Wed Aug 12 15:24:37 2015 +0300 Committer: Yavor Yanchev Committed: Wed Aug 12 15:24:37 2015 +0300 ---------------------------------------------------------------------- .../brooklyn/demo/GlobalWebFabricExample.java | 9 +- .../brooklyn/demo/CumulusRDFApplication.java | 4 +- .../brooklyn/demo/NodeJsTodoApplication.java | 2 +- .../brooklyn/demo/SingleWebServerExample.java | 5 +- .../demo/WebClusterDatabaseExample.java | 11 +- .../demo/WebClusterDatabaseExampleApp.java | 11 +- .../apache/brooklyn/demo/WebClusterExample.java | 9 +- .../apache/brooklyn/demo/nodejs-riak-todo.yaml | 2 +- .../org/apache/brooklyn/demo/nodejs-todo.yaml | 2 +- ...lusterDatabaseExampleAppIntegrationTest.java | 8 +- .../entity/nosql/couchdb/CouchDBNode.java | 3 +- .../entity/nosql/couchdb/CouchDBNodeImpl.java | 4 +- .../nosql/elasticsearch/ElasticSearchNode.java | 3 +- .../entity/nosql/riak/RiakNodeImpl.java | 3 +- .../nosql/riak/riak-with-webapp-cluster.yaml | 4 +- .../entity/nosql/riak/riak-with-webapp.yaml | 2 +- .../apache/brooklyn/entity/nosql/riak/riak.md | 2 +- ...assandraDatacenterRebindIntegrationTest.java | 2 +- software/webapp/pom.xml | 4 +- .../entity/dns/AbstractGeoDnsService.java | 59 - .../entity/dns/AbstractGeoDnsServiceImpl.java | 373 -- .../dns/geoscaling/GeoscalingDnsService.java | 70 - .../geoscaling/GeoscalingDnsServiceImpl.java | 200 - .../geoscaling/GeoscalingScriptGenerator.java | 79 - .../dns/geoscaling/GeoscalingWebClient.java | 459 -- .../entity/proxy/AbstractController.java | 74 - .../entity/proxy/AbstractControllerImpl.java | 516 -- .../proxy/AbstractNonProvisionedController.java | 28 - .../AbstractNonProvisionedControllerImpl.java | 277 -- .../brooklyn/entity/proxy/LoadBalancer.java | 124 - .../entity/proxy/LoadBalancerCluster.java | 37 - .../entity/proxy/LoadBalancerClusterImpl.java | 76 - .../brooklyn/entity/proxy/ProxySslConfig.java | 219 - .../proxy/nginx/NginxConfigFileGenerator.java | 33 - .../entity/proxy/nginx/NginxController.java | 145 - .../entity/proxy/nginx/NginxControllerImpl.java | 370 -- .../nginx/NginxDefaultConfigGenerator.java | 258 - .../entity/proxy/nginx/NginxDriver.java | 31 - .../entity/proxy/nginx/NginxSshDriver.java | 477 -- .../nginx/NginxTemplateConfigGenerator.java | 82 - .../brooklyn/entity/proxy/nginx/UrlMapping.java | 102 - .../entity/proxy/nginx/UrlMappingImpl.java | 223 - .../entity/proxy/nginx/UrlRewriteRule.java | 74 - .../webapp/ControlledDynamicWebAppCluster.java | 113 - .../ControlledDynamicWebAppClusterImpl.java | 327 -- .../entity/webapp/DynamicWebAppCluster.java | 69 - .../entity/webapp/DynamicWebAppClusterImpl.java | 263 - .../entity/webapp/DynamicWebAppFabric.java | 48 - .../entity/webapp/DynamicWebAppFabricImpl.java | 83 - .../entity/webapp/ElasticJavaWebAppService.java | 60 - .../webapp/FilenameToWebContextMapper.java | 92 - .../brooklyn/entity/webapp/HttpsSslConfig.java | 74 - .../entity/webapp/JavaWebAppDriver.java | 54 - .../entity/webapp/JavaWebAppService.java | 109 - .../webapp/JavaWebAppSoftwareProcess.java | 34 - .../webapp/JavaWebAppSoftwareProcessImpl.java | 206 - .../entity/webapp/JavaWebAppSshDriver.java | 201 - .../brooklyn/entity/webapp/WebAppService.java | 24 - .../entity/webapp/WebAppServiceConstants.java | 61 - .../entity/webapp/WebAppServiceMethods.java | 89 - .../entity/webapp/WebAppServiceMetrics.java | 77 - .../entity/webapp/jboss/JBoss6Driver.java | 24 - .../entity/webapp/jboss/JBoss6Server.java | 62 - .../entity/webapp/jboss/JBoss6ServerImpl.java | 103 - .../entity/webapp/jboss/JBoss6SshDriver.java | 243 - .../entity/webapp/jboss/JBoss7Driver.java | 30 - .../entity/webapp/jboss/JBoss7Server.java | 104 - .../entity/webapp/jboss/JBoss7ServerImpl.java | 199 - .../entity/webapp/jboss/JBoss7SshDriver.java | 276 -- .../entity/webapp/jetty/Jetty6Driver.java | 24 - .../entity/webapp/jetty/Jetty6Server.java | 60 - .../entity/webapp/jetty/Jetty6ServerImpl.java | 141 - .../entity/webapp/jetty/Jetty6SshDriver.java | 173 - .../webapp/nodejs/NodeJsWebAppDriver.java | 29 - .../webapp/nodejs/NodeJsWebAppService.java | 74 - .../webapp/nodejs/NodeJsWebAppServiceImpl.java | 92 - .../webapp/nodejs/NodeJsWebAppSshDriver.java | 185 - .../entity/webapp/tomcat/Tomcat7Driver.java | 23 - .../entity/webapp/tomcat/Tomcat7SshDriver.java | 29 - .../entity/webapp/tomcat/Tomcat8Server.java | 55 - .../entity/webapp/tomcat/Tomcat8ServerImpl.java | 26 - .../entity/webapp/tomcat/TomcatDriver.java | 24 - .../entity/webapp/tomcat/TomcatServer.java | 80 - .../entity/webapp/tomcat/TomcatServerImpl.java | 120 - .../entity/webapp/tomcat/TomcatSshDriver.java | 174 - .../entity/dns/AbstractGeoDnsService.java | 59 + .../entity/dns/AbstractGeoDnsServiceImpl.java | 373 ++ .../dns/geoscaling/GeoscalingDnsService.java | 71 + .../geoscaling/GeoscalingDnsServiceImpl.java | 200 + .../geoscaling/GeoscalingScriptGenerator.java | 79 + .../dns/geoscaling/GeoscalingWebClient.java | 459 ++ .../entity/proxy/AbstractController.java | 74 + .../entity/proxy/AbstractControllerImpl.java | 516 ++ .../proxy/AbstractNonProvisionedController.java | 28 + .../AbstractNonProvisionedControllerImpl.java | 277 ++ .../brooklyn/entity/proxy/LoadBalancer.java | 125 + .../entity/proxy/LoadBalancerCluster.java | 37 + .../entity/proxy/LoadBalancerClusterImpl.java | 76 + .../brooklyn/entity/proxy/ProxySslConfig.java | 219 + .../proxy/nginx/NginxConfigFileGenerator.java | 33 + .../entity/proxy/nginx/NginxController.java | 146 + .../entity/proxy/nginx/NginxControllerImpl.java | 370 ++ .../nginx/NginxDefaultConfigGenerator.java | 258 + .../entity/proxy/nginx/NginxDriver.java | 31 + .../entity/proxy/nginx/NginxSshDriver.java | 477 ++ .../nginx/NginxTemplateConfigGenerator.java | 83 + .../brooklyn/entity/proxy/nginx/UrlMapping.java | 103 + .../entity/proxy/nginx/UrlMappingImpl.java | 223 + .../entity/proxy/nginx/UrlRewriteRule.java | 74 + .../webapp/ControlledDynamicWebAppCluster.java | 114 + .../ControlledDynamicWebAppClusterImpl.java | 327 ++ .../entity/webapp/DynamicWebAppCluster.java | 69 + .../entity/webapp/DynamicWebAppClusterImpl.java | 263 + .../entity/webapp/DynamicWebAppFabric.java | 48 + .../entity/webapp/DynamicWebAppFabricImpl.java | 83 + .../entity/webapp/ElasticJavaWebAppService.java | 60 + .../webapp/FilenameToWebContextMapper.java | 92 + .../brooklyn/entity/webapp/HttpsSslConfig.java | 74 + .../entity/webapp/JavaWebAppDriver.java | 54 + .../entity/webapp/JavaWebAppService.java | 109 + .../webapp/JavaWebAppSoftwareProcess.java | 34 + .../webapp/JavaWebAppSoftwareProcessImpl.java | 206 + .../entity/webapp/JavaWebAppSshDriver.java | 201 + .../brooklyn/entity/webapp/WebAppService.java | 24 + .../entity/webapp/WebAppServiceConstants.java | 61 + .../entity/webapp/WebAppServiceMethods.java | 89 + .../entity/webapp/WebAppServiceMetrics.java | 77 + .../entity/webapp/jboss/JBoss6Driver.java | 24 + .../entity/webapp/jboss/JBoss6Server.java | 63 + .../entity/webapp/jboss/JBoss6ServerImpl.java | 103 + .../entity/webapp/jboss/JBoss6SshDriver.java | 244 + .../entity/webapp/jboss/JBoss7Driver.java | 30 + .../entity/webapp/jboss/JBoss7Server.java | 105 + .../entity/webapp/jboss/JBoss7ServerImpl.java | 199 + .../entity/webapp/jboss/JBoss7SshDriver.java | 276 ++ .../entity/webapp/jetty/Jetty6Driver.java | 24 + .../entity/webapp/jetty/Jetty6Server.java | 61 + .../entity/webapp/jetty/Jetty6ServerImpl.java | 141 + .../entity/webapp/jetty/Jetty6SshDriver.java | 174 + .../webapp/nodejs/NodeJsWebAppDriver.java | 29 + .../webapp/nodejs/NodeJsWebAppService.java | 75 + .../webapp/nodejs/NodeJsWebAppServiceImpl.java | 92 + .../webapp/nodejs/NodeJsWebAppSshDriver.java | 185 + .../entity/webapp/tomcat/Tomcat7Driver.java | 23 + .../entity/webapp/tomcat/Tomcat7SshDriver.java | 29 + .../entity/webapp/tomcat/Tomcat8Server.java | 55 + .../entity/webapp/tomcat/Tomcat8ServerImpl.java | 26 + .../entity/webapp/tomcat/TomcatDriver.java | 24 + .../entity/webapp/tomcat/TomcatServer.java | 81 + .../entity/webapp/tomcat/TomcatServerImpl.java | 120 + .../entity/webapp/tomcat/TomcatSshDriver.java | 175 + .../brooklyn/entity/dns/geoscaling/template.php | 68 - .../brooklyn/entity/proxy/nginx/server.conf | 84 - .../entity/webapp/jboss/jboss7-standalone.xml | 311 -- .../entity/webapp/jetty/jetty-brooklyn.xml | 41 - .../entity/webapp/sample-java-keystore.jks | Bin 1355 -> 0 bytes .../entity/webapp/sample-java-keystore.txt | 22 - .../brooklyn/entity/webapp/tomcat/server.xml | 206 - .../entity/webapp/tomcat/tomcat8-server.xml | 149 - .../entity/webapp/tomcat/tomcat8-web.xml | 4615 ------------------ .../brooklyn/entity/webapp/tomcat/web.xml | 4615 ------------------ .../brooklyn/entity/dns/geoscaling/template.php | 68 + .../brooklyn/entity/proxy/nginx/server.conf | 84 + .../entity/webapp/jboss/jboss7-standalone.xml | 311 ++ .../entity/webapp/jetty/jetty-brooklyn.xml | 41 + .../entity/webapp/sample-java-keystore.jks | Bin 0 -> 1355 bytes .../entity/webapp/sample-java-keystore.txt | 22 + .../brooklyn/entity/webapp/tomcat/server.xml | 206 + .../entity/webapp/tomcat/tomcat8-server.xml | 149 + .../entity/webapp/tomcat/tomcat8-web.xml | 4615 ++++++++++++++++++ .../brooklyn/entity/webapp/tomcat/web.xml | 4615 ++++++++++++++++++ .../entity/dns/AbstractGeoDnsServiceTest.java | 320 -- .../geoscaling/GeoscalingIntegrationTest.java | 211 - .../GeoscalingScriptGeneratorTest.java | 58 - .../dns/geoscaling/GeoscalingWebClientTest.java | 117 - .../entity/proxy/AbstractControllerTest.java | 363 -- .../entity/proxy/ProxySslConfigTest.java | 60 - .../brooklyn/entity/proxy/StubAppServer.java | 86 - .../proxy/TrackingAbstractController.java | 29 - .../proxy/TrackingAbstractControllerImpl.java | 67 - .../brooklyn/entity/proxy/UrlMappingTest.java | 216 - .../nginx/NginxClusterIntegrationTest.java | 241 - .../entity/proxy/nginx/NginxEc2LiveTest.java | 72 - .../nginx/NginxHttpsSslIntegrationTest.java | 238 - .../proxy/nginx/NginxIntegrationTest.java | 453 -- .../proxy/nginx/NginxLightIntegrationTest.java | 74 - .../proxy/nginx/NginxRebindIntegrationTest.java | 292 -- .../nginx/NginxRebindWithHaIntegrationTest.java | 182 - .../nginx/NginxUrlMappingIntegrationTest.java | 525 -- .../proxy/nginx/NginxWebClusterEc2LiveTest.java | 115 - .../AbstractWebAppFixtureIntegrationTest.java | 502 -- ...lledDynamicWebAppClusterIntegrationTest.java | 182 - .../ControlledDynamicWebAppClusterTest.java | 211 - .../entity/webapp/DynamicWebAppClusterTest.java | 131 - .../entity/webapp/DynamicWebAppFabricTest.java | 124 - .../webapp/ElasticCustomLocationTest.java | 90 - ...ElasticJavaWebAppServiceIntegrationTest.java | 69 - .../webapp/FilenameToWebContextMapperTest.java | 85 - .../entity/webapp/HttpsSslConfigTest.java | 38 - .../webapp/TomcatAutoScalerPolicyTest.java | 124 - .../webapp/WebAppConcurrentDeployTest.java | 105 - .../webapp/WebAppLiveIntegrationTest.groovy | 115 - ...namicWebAppClusterRebindIntegrationTest.java | 162 - ...namicWebAppClusterRebindIntegrationTest.java | 152 - .../jboss/JBoss6ServerAwsEc2LiveTest.java | 72 - ...Boss6ServerNonInheritingIntegrationTest.java | 103 - .../webapp/jboss/JBoss7PasswordHashingTest.java | 60 - .../jboss/JBoss7ServerAwsEc2LiveTest.java | 78 - .../jboss/JBoss7ServerDockerLiveTest.java | 77 - ...Boss7ServerNonInheritingIntegrationTest.java | 191 - .../JBoss7ServerRebindingIntegrationTest.java | 125 - ...ultiVersionWebAppFixtureIntegrationTest.java | 106 - .../Jboss7ServerGoogleComputeLiveTest.java | 78 - .../JettyWebAppFixtureIntegrationTest.java | 68 - .../webapp/nodejs/NodeJsWebAppEc2LiveTest.java | 60 - .../NodeJsWebAppFixtureIntegrationTest.java | 171 - .../NodeJsWebAppSimpleIntegrationTest.java | 82 - .../nodejs/NodeJsWebAppSoftlayerLiveTest.java | 59 - .../webapp/tomcat/Tomcat8ServerEc2LiveTest.java | 68 - .../Tomcat8ServerRestartIntegrationTest.java | 45 - .../tomcat/Tomcat8ServerSoftlayerLiveTest.java | 77 - ...mcat8ServerWebAppFixtureIntegrationTest.java | 176 - ...ableRetrieveUsageMetricsIntegrationTest.java | 65 - .../webapp/tomcat/TomcatServerEc2LiveTest.java | 70 - .../TomcatServerRestartIntegrationTest.java | 44 - .../tomcat/TomcatServerSoftlayerLiveTest.java | 78 - ...omcatServerWebAppFixtureIntegrationTest.java | 175 - .../test/entity/TestJavaWebAppEntity.java | 78 - .../test/entity/TestJavaWebAppEntityImpl.java | 61 - .../entity/dns/AbstractGeoDnsServiceTest.java | 323 ++ .../geoscaling/GeoscalingIntegrationTest.java | 213 + .../GeoscalingScriptGeneratorTest.java | 59 + .../dns/geoscaling/GeoscalingWebClientTest.java | 118 + .../entity/proxy/AbstractControllerTest.java | 363 ++ .../entity/proxy/ProxySslConfigTest.java | 61 + .../brooklyn/entity/proxy/StubAppServer.java | 86 + .../proxy/TrackingAbstractController.java | 31 + .../proxy/TrackingAbstractControllerImpl.java | 68 + .../brooklyn/entity/proxy/UrlMappingTest.java | 216 + .../nginx/NginxClusterIntegrationTest.java | 243 + .../entity/proxy/nginx/NginxEc2LiveTest.java | 73 + .../nginx/NginxHttpsSslIntegrationTest.java | 239 + .../proxy/nginx/NginxIntegrationTest.java | 454 ++ .../proxy/nginx/NginxLightIntegrationTest.java | 75 + .../proxy/nginx/NginxRebindIntegrationTest.java | 295 ++ .../nginx/NginxRebindWithHaIntegrationTest.java | 183 + .../nginx/NginxUrlMappingIntegrationTest.java | 528 ++ .../proxy/nginx/NginxWebClusterEc2LiveTest.java | 116 + .../AbstractWebAppFixtureIntegrationTest.java | 506 ++ ...lledDynamicWebAppClusterIntegrationTest.java | 184 + .../ControlledDynamicWebAppClusterTest.java | 213 + .../entity/webapp/DynamicWebAppClusterTest.java | 133 + .../entity/webapp/DynamicWebAppFabricTest.java | 127 + .../webapp/ElasticCustomLocationTest.java | 91 + ...ElasticJavaWebAppServiceIntegrationTest.java | 70 + .../webapp/FilenameToWebContextMapperTest.java | 86 + .../entity/webapp/HttpsSslConfigTest.java | 39 + .../webapp/TomcatAutoScalerPolicyTest.java | 125 + .../webapp/WebAppConcurrentDeployTest.java | 106 + .../webapp/WebAppLiveIntegrationTest.groovy | 115 + ...namicWebAppClusterRebindIntegrationTest.java | 163 + ...namicWebAppClusterRebindIntegrationTest.java | 153 + .../jboss/JBoss6ServerAwsEc2LiveTest.java | 73 + ...Boss6ServerNonInheritingIntegrationTest.java | 104 + .../webapp/jboss/JBoss7PasswordHashingTest.java | 62 + .../jboss/JBoss7ServerAwsEc2LiveTest.java | 79 + .../jboss/JBoss7ServerDockerLiveTest.java | 78 + ...Boss7ServerNonInheritingIntegrationTest.java | 192 + .../JBoss7ServerRebindingIntegrationTest.java | 126 + ...ultiVersionWebAppFixtureIntegrationTest.java | 108 + .../Jboss7ServerGoogleComputeLiveTest.java | 79 + .../JettyWebAppFixtureIntegrationTest.java | 70 + .../webapp/nodejs/NodeJsWebAppEc2LiveTest.java | 61 + .../NodeJsWebAppFixtureIntegrationTest.java | 172 + .../NodeJsWebAppSimpleIntegrationTest.java | 84 + .../nodejs/NodeJsWebAppSoftlayerLiveTest.java | 60 + .../webapp/tomcat/Tomcat8ServerEc2LiveTest.java | 68 + .../Tomcat8ServerRestartIntegrationTest.java | 45 + .../tomcat/Tomcat8ServerSoftlayerLiveTest.java | 77 + ...mcat8ServerWebAppFixtureIntegrationTest.java | 177 + ...ableRetrieveUsageMetricsIntegrationTest.java | 66 + .../webapp/tomcat/TomcatServerEc2LiveTest.java | 71 + .../TomcatServerRestartIntegrationTest.java | 45 + .../tomcat/TomcatServerSoftlayerLiveTest.java | 79 + ...omcatServerWebAppFixtureIntegrationTest.java | 176 + .../test/entity/TestJavaWebAppEntity.java | 78 + .../test/entity/TestJavaWebAppEntityImpl.java | 62 + .../entity/dns/geoscaling/expectedScript.php | 79 - .../webapp/nodejs/nodejs-hello-world.yaml | 31 - .../entity/dns/geoscaling/expectedScript.php | 79 + .../webapp/nodejs/nodejs-hello-world.yaml | 31 + .../service/CatalogServiceTypeResolver.java | 2 +- .../brooklyn/camp/brooklyn/AppYamlTest.java | 12 +- .../EnrichersSlightlySimplerYamlTest.java | 2 +- .../camp/brooklyn/EnrichersYamlTest.java | 2 +- .../brooklyn/EntitiesYamlIntegrationTest.java | 6 +- .../camp/brooklyn/EntitiesYamlTest.java | 42 +- .../brooklyn/JavaWebAppsIntegrationTest.java | 6 +- .../camp/brooklyn/LocationsYamlTest.java | 26 +- .../camp/brooklyn/MapReferenceYamlTest.java | 6 +- .../brooklyn/camp/brooklyn/ObjectsYamlTest.java | 14 +- .../camp/brooklyn/PoliciesYamlTest.java | 4 +- .../brooklyn/camp/brooklyn/WrapAppTest.java | 12 +- .../test/resources/example-with-function.yaml | 2 +- .../java-web-app-and-db-with-function-2.yaml | 2 +- .../java-web-app-and-db-with-function.yaml | 2 +- .../java-web-app-and-db-with-policy.yaml | 4 +- .../src/test/resources/java-web-app-simple.yaml | 2 +- ...est-app-with-enrichers-slightly-simpler.yaml | 2 +- .../test-cluster-with-member-spec.yaml | 2 +- .../resources/test-entity-basic-template.yaml | 2 +- .../test-entity-reference-map-template.yaml | 2 +- .../resources/test-entity-with-enricher.yaml | 2 +- .../resources/test-entity-with-init-config.yaml | 2 +- .../test/resources/test-entity-with-policy.yaml | 2 +- ...-java-web-app-spec-and-db-with-function.yaml | 4 +- .../resources/test-propagating-enricher.yaml | 2 +- .../src/test/resources/test-tomcat-cluster.yaml | 4 +- .../src/test/resources/test-tomcat-https.yaml | 4 +- .../test-webapp-with-averaging-enricher.yaml | 4 +- .../main/resources/brooklyn/default.catalog.bom | 2 +- .../app-add-wizard/required-config-entry.html | 2 +- .../javascript/specs/model/app-tree-spec.js | 2 +- .../specs/model/entity-summary-spec.js | 4 +- .../brooklyn/launcher/BrooklynLauncherTest.java | 2 +- .../src/test/resources/couchbase-w-loadgen.yaml | 2 +- .../java-web-app-and-db-with-function.yaml | 2 +- .../src/test/resources/mongo-sharded.yaml | 6 +- usage/launcher/src/test/resources/nginx.yaml | 2 +- .../src/test/resources/opengamma-cluster.yaml | 4 +- usage/launcher/src/test/resources/web.yaml | 2 +- .../qa/load/SimulatedJBoss7ServerImpl.java | 5 +- .../qa/load/SimulatedNginxControllerImpl.java | 6 +- .../brooklyn/qa/load/SimulatedTheeTierApp.java | 15 +- .../qa/longevity/webcluster/WebClusterApp.java | 6 +- .../BrooklynPropertiesSecurityFilterTest.java | 2 +- .../rest/resources/CatalogResourceTest.java | 8 +- 337 files changed, 27277 insertions(+), 27182 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/global-web-fabric/src/main/java/org/apache/brooklyn/demo/GlobalWebFabricExample.java ---------------------------------------------------------------------- diff --git a/examples/global-web-fabric/src/main/java/org/apache/brooklyn/demo/GlobalWebFabricExample.java b/examples/global-web-fabric/src/main/java/org/apache/brooklyn/demo/GlobalWebFabricExample.java index a3830b8..689117d 100644 --- a/examples/global-web-fabric/src/main/java/org/apache/brooklyn/demo/GlobalWebFabricExample.java +++ b/examples/global-web-fabric/src/main/java/org/apache/brooklyn/demo/GlobalWebFabricExample.java @@ -28,18 +28,19 @@ import org.slf4j.LoggerFactory; import org.apache.brooklyn.catalog.Catalog; import org.apache.brooklyn.catalog.CatalogConfig; +import org.apache.brooklyn.entity.dns.geoscaling.GeoscalingDnsService; +import org.apache.brooklyn.entity.proxy.AbstractController; +import org.apache.brooklyn.entity.webapp.ElasticJavaWebAppService; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; + import brooklyn.config.ConfigKey; import brooklyn.config.StringConfigMap; import brooklyn.entity.basic.AbstractApplication; import brooklyn.entity.basic.ConfigKeys; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.StartableApplication; -import brooklyn.entity.dns.geoscaling.GeoscalingDnsService; import brooklyn.entity.group.DynamicRegionsFabric; -import brooklyn.entity.proxy.AbstractController; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.ElasticJavaWebAppService; -import brooklyn.entity.webapp.JavaWebAppService; import brooklyn.event.basic.PortAttributeSensorAndConfigKey; import org.apache.brooklyn.launcher.BrooklynLauncher; import brooklyn.location.basic.PortRanges; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-nosql-cluster/src/main/java/org/apache/brooklyn/demo/CumulusRDFApplication.java ---------------------------------------------------------------------- diff --git a/examples/simple-nosql-cluster/src/main/java/org/apache/brooklyn/demo/CumulusRDFApplication.java b/examples/simple-nosql-cluster/src/main/java/org/apache/brooklyn/demo/CumulusRDFApplication.java index 782d15c..34926ef 100644 --- a/examples/simple-nosql-cluster/src/main/java/org/apache/brooklyn/demo/CumulusRDFApplication.java +++ b/examples/simple-nosql-cluster/src/main/java/org/apache/brooklyn/demo/CumulusRDFApplication.java @@ -29,6 +29,8 @@ import org.apache.brooklyn.catalog.CatalogConfig; import org.apache.brooklyn.entity.nosql.cassandra.CassandraDatacenter; import org.apache.brooklyn.entity.nosql.cassandra.CassandraFabric; import org.apache.brooklyn.entity.nosql.cassandra.CassandraNode; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.tomcat.TomcatServer; import brooklyn.config.ConfigKey; import brooklyn.entity.Effector; @@ -47,8 +49,6 @@ import brooklyn.entity.java.UsesJmx; import brooklyn.entity.proxying.EntitySpec; import brooklyn.entity.software.SshEffectorTasks; import brooklyn.entity.trait.Startable; -import brooklyn.entity.webapp.JavaWebAppService; -import brooklyn.entity.webapp.tomcat.TomcatServer; import brooklyn.event.SensorEvent; import brooklyn.event.SensorEventListener; import brooklyn.event.basic.DependentConfiguration; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/NodeJsTodoApplication.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/NodeJsTodoApplication.java b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/NodeJsTodoApplication.java index 993b549..85ba7d2 100644 --- a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/NodeJsTodoApplication.java +++ b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/NodeJsTodoApplication.java @@ -21,6 +21,7 @@ package org.apache.brooklyn.demo; import static brooklyn.event.basic.DependentConfiguration.attributeWhenReady; import org.apache.brooklyn.catalog.Catalog; import org.apache.brooklyn.entity.nosql.redis.RedisStore; +import org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService; import brooklyn.entity.basic.AbstractApplication; import brooklyn.entity.basic.Attributes; @@ -28,7 +29,6 @@ import brooklyn.entity.basic.SoftwareProcess; import brooklyn.entity.basic.StartableApplication; import brooklyn.entity.proxying.EntitySpec; import brooklyn.entity.trait.Startable; -import brooklyn.entity.webapp.nodejs.NodeJsWebAppService; import brooklyn.event.basic.DependentConfiguration; import com.google.common.collect.ImmutableList; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/SingleWebServerExample.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/SingleWebServerExample.java b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/SingleWebServerExample.java index 34eda75..29d34f9 100644 --- a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/SingleWebServerExample.java +++ b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/SingleWebServerExample.java @@ -28,8 +28,9 @@ import brooklyn.entity.basic.Attributes; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.StartableApplication; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.JavaWebAppService; -import brooklyn.entity.webapp.jboss.JBoss7Server; + +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.jboss.JBoss7Server; import org.apache.brooklyn.launcher.BrooklynLauncher; import brooklyn.location.basic.PortRanges; import brooklyn.util.CommandLineUtil; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExample.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExample.java b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExample.java index c308b5b..e41d624 100644 --- a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExample.java +++ b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExample.java @@ -35,13 +35,14 @@ import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.StartableApplication; import brooklyn.entity.database.mysql.MySqlNode; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.ControlledDynamicWebAppCluster; -import brooklyn.entity.webapp.DynamicWebAppCluster; -import brooklyn.entity.webapp.JavaWebAppService; -import brooklyn.entity.webapp.WebAppService; -import brooklyn.entity.webapp.WebAppServiceConstants; import brooklyn.event.AttributeSensor; import brooklyn.event.basic.Sensors; + +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.WebAppService; +import org.apache.brooklyn.entity.webapp.WebAppServiceConstants; import org.apache.brooklyn.launcher.BrooklynLauncher; import brooklyn.location.basic.PortRanges; import brooklyn.policy.autoscaling.AutoScalerPolicy; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExampleApp.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExampleApp.java b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExampleApp.java index 65193ad..b8205a0 100644 --- a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExampleApp.java +++ b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterDatabaseExampleApp.java @@ -29,6 +29,12 @@ import org.slf4j.LoggerFactory; import org.apache.brooklyn.catalog.Catalog; import org.apache.brooklyn.catalog.CatalogConfig; +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.JavaWebAppService; +import org.apache.brooklyn.entity.webapp.WebAppService; +import org.apache.brooklyn.entity.webapp.WebAppServiceConstants; + import brooklyn.config.ConfigKey; import brooklyn.enricher.Enrichers; import brooklyn.enricher.HttpLatencyDetector; @@ -40,11 +46,6 @@ import brooklyn.entity.database.mysql.MySqlNode; import brooklyn.entity.group.DynamicCluster; import brooklyn.entity.java.JavaEntityMethods; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.ControlledDynamicWebAppCluster; -import brooklyn.entity.webapp.DynamicWebAppCluster; -import brooklyn.entity.webapp.JavaWebAppService; -import brooklyn.entity.webapp.WebAppService; -import brooklyn.entity.webapp.WebAppServiceConstants; import brooklyn.event.AttributeSensor; import brooklyn.event.basic.Sensors; import org.apache.brooklyn.launcher.BrooklynLauncher; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterExample.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterExample.java b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterExample.java index 57215fa..fd5385e 100644 --- a/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterExample.java +++ b/examples/simple-web-cluster/src/main/java/org/apache/brooklyn/demo/WebClusterExample.java @@ -26,11 +26,12 @@ import org.slf4j.LoggerFactory; import brooklyn.config.BrooklynProperties; import brooklyn.entity.basic.AbstractApplication; import brooklyn.entity.basic.Entities; -import brooklyn.entity.proxy.nginx.NginxController; import brooklyn.entity.proxying.EntitySpec; -import brooklyn.entity.webapp.ControlledDynamicWebAppCluster; -import brooklyn.entity.webapp.DynamicWebAppCluster; -import brooklyn.entity.webapp.jboss.JBoss7Server; + +import org.apache.brooklyn.entity.proxy.nginx.NginxController; +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.jboss.JBoss7Server; import org.apache.brooklyn.launcher.BrooklynLauncher; import brooklyn.policy.autoscaling.AutoScalerPolicy; import brooklyn.util.CommandLineUtil; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-riak-todo.yaml ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-riak-todo.yaml b/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-riak-todo.yaml index 7cdf546..958d29d 100644 --- a/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-riak-todo.yaml +++ b/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-riak-todo.yaml @@ -29,7 +29,7 @@ services: osFamily: centos minCores: 4 minRam: 2048 -- type: brooklyn.entity.webapp.nodejs.NodeJsWebAppService +- type: org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService id: nodejs-riak1 name: "Node.JS" brooklyn.config: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-todo.yaml ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-todo.yaml b/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-todo.yaml index 82bc686..6aab1db 100644 --- a/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-todo.yaml +++ b/examples/simple-web-cluster/src/main/resources/org/apache/brooklyn/demo/nodejs-todo.yaml @@ -24,7 +24,7 @@ services: - type: org.apache.brooklyn.entity.nosql.redis.RedisStore id: redis name: "Redis" -- type: brooklyn.entity.webapp.nodejs.NodeJsWebAppService +- type: org.apache.brooklyn.entity.webapp.nodejs.NodeJsWebAppService id: nodejs name: "Node.JS" brooklyn.config: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/examples/simple-web-cluster/src/test/java/org/apache/brooklyn/demo/RebindWebClusterDatabaseExampleAppIntegrationTest.java ---------------------------------------------------------------------- diff --git a/examples/simple-web-cluster/src/test/java/org/apache/brooklyn/demo/RebindWebClusterDatabaseExampleAppIntegrationTest.java b/examples/simple-web-cluster/src/test/java/org/apache/brooklyn/demo/RebindWebClusterDatabaseExampleAppIntegrationTest.java index 8ebdd12..156653f 100644 --- a/examples/simple-web-cluster/src/test/java/org/apache/brooklyn/demo/RebindWebClusterDatabaseExampleAppIntegrationTest.java +++ b/examples/simple-web-cluster/src/test/java/org/apache/brooklyn/demo/RebindWebClusterDatabaseExampleAppIntegrationTest.java @@ -19,6 +19,10 @@ package org.apache.brooklyn.demo; import org.apache.brooklyn.demo.WebClusterDatabaseExampleApp; +import org.apache.brooklyn.entity.proxy.nginx.NginxController; +import org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.DynamicWebAppCluster; +import org.apache.brooklyn.entity.webapp.tomcat.Tomcat8Server; import org.apache.brooklyn.policy.Enricher; import org.apache.brooklyn.test.EntityTestUtils; import org.apache.brooklyn.test.HttpTestUtils; @@ -49,13 +53,9 @@ import brooklyn.entity.basic.StartableApplication; import brooklyn.entity.database.mysql.MySqlNode; import brooklyn.entity.group.DynamicCluster; import brooklyn.entity.java.JavaEntityMethods; -import brooklyn.entity.proxy.nginx.NginxController; import brooklyn.entity.proxying.EntitySpec; import brooklyn.entity.rebind.RebindOptions; import brooklyn.entity.rebind.RebindTestFixture; -import brooklyn.entity.webapp.ControlledDynamicWebAppCluster; -import brooklyn.entity.webapp.DynamicWebAppCluster; -import brooklyn.entity.webapp.tomcat.Tomcat8Server; import brooklyn.location.Location; import brooklyn.policy.autoscaling.AutoScalerPolicy; import brooklyn.test.Asserts; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNode.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNode.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNode.java index be169b9..3cba660 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNode.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNode.java @@ -19,11 +19,12 @@ package org.apache.brooklyn.entity.nosql.couchdb; import org.apache.brooklyn.catalog.Catalog; +import org.apache.brooklyn.entity.webapp.WebAppService; + import brooklyn.config.ConfigKey; import brooklyn.entity.basic.ConfigKeys; import brooklyn.entity.basic.SoftwareProcess; import brooklyn.entity.proxying.ImplementedBy; -import brooklyn.entity.webapp.WebAppService; import brooklyn.event.basic.BasicAttributeSensorAndConfigKey; import brooklyn.util.flags.SetFromFlag; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeImpl.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeImpl.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeImpl.java index 2f5bd36..b200f6e 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeImpl.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/couchdb/CouchDBNodeImpl.java @@ -22,12 +22,12 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; +import org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcessImpl; +import org.apache.brooklyn.entity.webapp.WebAppServiceMethods; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import brooklyn.entity.basic.SoftwareProcessImpl; -import brooklyn.entity.webapp.JavaWebAppSoftwareProcessImpl; -import brooklyn.entity.webapp.WebAppServiceMethods; import brooklyn.event.feed.http.HttpFeed; import brooklyn.event.feed.http.HttpPollConfig; import brooklyn.event.feed.http.HttpValueFunctions; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNode.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNode.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNode.java index 34be8f1..4911c04 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNode.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/elasticsearch/ElasticSearchNode.java @@ -19,12 +19,13 @@ package org.apache.brooklyn.entity.nosql.elasticsearch; import org.apache.brooklyn.catalog.Catalog; +import org.apache.brooklyn.entity.webapp.WebAppServiceConstants; + import brooklyn.config.ConfigKey; import brooklyn.entity.basic.ConfigKeys; import brooklyn.entity.basic.SoftwareProcess; import brooklyn.entity.database.DatastoreMixins; import brooklyn.entity.proxying.ImplementedBy; -import brooklyn.entity.webapp.WebAppServiceConstants; import brooklyn.event.AttributeSensor; import brooklyn.event.basic.BasicAttributeSensorAndConfigKey; import brooklyn.event.basic.BasicAttributeSensorAndConfigKey.StringAttributeSensorAndConfigKey; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java index d631516..7d6e143 100644 --- a/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java +++ b/software/nosql/src/main/java/org/apache/brooklyn/entity/nosql/riak/RiakNodeImpl.java @@ -27,10 +27,11 @@ import java.util.concurrent.TimeUnit; import javax.annotation.Nullable; +import org.apache.brooklyn.entity.webapp.WebAppServiceMethods; + import brooklyn.enricher.Enrichers; import brooklyn.entity.basic.Entities; import brooklyn.entity.basic.SoftwareProcessImpl; -import brooklyn.entity.webapp.WebAppServiceMethods; import brooklyn.event.AttributeSensor; import brooklyn.event.basic.AttributeSensorAndConfigKey; import brooklyn.event.feed.http.HttpFeed; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp-cluster.yaml ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp-cluster.yaml b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp-cluster.yaml index 5e184ac..e1acf35 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp-cluster.yaml +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp-cluster.yaml @@ -25,13 +25,13 @@ services: id: cluster brooklyn.config: install.version: 2.0.0 -- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster name: Web Cluster brooklyn.config: initialSize: 2 controlleddynamicwebappcluster.controllerSpec: $brooklyn:entitySpec: - type: brooklyn.entity.proxy.nginx.NginxController + type: org.apache.brooklyn.entity.proxy.nginx.NginxController brooklyn.config: member.sensor.hostname: "host.subnet.hostname" wars.root: "https://s3-eu-west-1.amazonaws.com/brooklyn-clocker/brooklyn-example-hello-world-sql-webapp.war" http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp.yaml ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp.yaml b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp.yaml index d2b08ff..6bece30 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp.yaml +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak-with-webapp.yaml @@ -23,7 +23,7 @@ services: - type: org.apache.brooklyn.entity.nosql.riak.RiakCluster initialSize: 2 id: cluster -- type: brooklyn.entity.webapp.jboss.JBoss7Server +- type: org.apache.brooklyn.entity.webapp.jboss.JBoss7Server name: Web brooklyn.config: wars.root: "https://s3-eu-west-1.amazonaws.com/brooklyn-clocker/brooklyn-example-hello-world-sql-webapp.war" http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak.md ---------------------------------------------------------------------- diff --git a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak.md b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak.md index 1523b5f..1efdde9 100644 --- a/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak.md +++ b/software/nosql/src/main/resources/org/apache/brooklyn/entity/nosql/riak/riak.md @@ -40,7 +40,7 @@ services: brooklyn.config: initialSize: 2 install.version: 2.0.0 -- type: brooklyn.entity.webapp.ControlledDynamicWebAppCluster +- type: org.apache.brooklyn.entity.webapp.ControlledDynamicWebAppCluster brooklyn.config: initialSize: 2 wars.root: https://s3-eu-west-1.amazonaws.com/brooklyn-clocker/brooklyn-example-hello-world-sql-webapp.war http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/cassandra/CassandraDatacenterRebindIntegrationTest.java ---------------------------------------------------------------------- diff --git a/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/cassandra/CassandraDatacenterRebindIntegrationTest.java b/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/cassandra/CassandraDatacenterRebindIntegrationTest.java index 5c45153..40446f5 100644 --- a/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/cassandra/CassandraDatacenterRebindIntegrationTest.java +++ b/software/nosql/src/test/java/org/apache/brooklyn/entity/nosql/cassandra/CassandraDatacenterRebindIntegrationTest.java @@ -25,6 +25,7 @@ import java.util.Set; import org.apache.brooklyn.entity.nosql.cassandra.CassandraDatacenter; import org.apache.brooklyn.entity.nosql.cassandra.CassandraNode; +import org.apache.brooklyn.entity.proxy.nginx.NginxController; import org.apache.brooklyn.test.EntityTestUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,7 +33,6 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import brooklyn.entity.proxy.nginx.NginxController; import brooklyn.entity.proxying.EntitySpec; import brooklyn.entity.rebind.RebindOptions; import brooklyn.entity.rebind.RebindTestFixtureWithApp; http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/pom.xml ---------------------------------------------------------------------- diff --git a/software/webapp/pom.xml b/software/webapp/pom.xml index c4b2fb2..fa619f2 100644 --- a/software/webapp/pom.xml +++ b/software/webapp/pom.xml @@ -46,8 +46,8 @@ the given components. These are files "without any degree of creativity" from the perspective of the Brooklyn/Apache contribution. --> - src/main/resources/brooklyn/entity/webapp/jboss/jboss7-standalone.xml - src/main/resources/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml + src/main/resources/org/apache/brooklyn/entity/webapp/jboss/jboss7-standalone.xml + src/main/resources/org/apache/brooklyn/entity/webapp/jetty/jetty-brooklyn.xml http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsService.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsService.java b/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsService.java deleted file mode 100644 index 0f053bc..0000000 --- a/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsService.java +++ /dev/null @@ -1,59 +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.dns; - -import java.util.Map; - -import brooklyn.config.ConfigKey; -import brooklyn.entity.Entity; -import brooklyn.entity.Group; -import brooklyn.entity.basic.Attributes; -import brooklyn.entity.basic.ConfigKeys; -import brooklyn.entity.basic.Lifecycle; -import brooklyn.entity.trait.Startable; -import brooklyn.event.AttributeSensor; -import brooklyn.event.basic.BasicAttributeSensor; -import brooklyn.location.geo.HostGeoInfo; - -import com.google.common.reflect.TypeToken; - -public interface AbstractGeoDnsService extends Entity { - - public static final ConfigKey INCLUDE_HOMELESS_ENTITIES = ConfigKeys.newBooleanConfigKey("geodns.includeHomeless", "Whether to include entities whose geo-coordinates cannot be inferred", false); - public static final ConfigKey USE_HOSTNAMES = ConfigKeys.newBooleanConfigKey("geodns.useHostnames", "Whether to use the hostname for the returned value for routing, rather than IP address (defaults to true)", true); - - public static final AttributeSensor SERVICE_STATE_ACTUAL = Attributes.SERVICE_STATE_ACTUAL; - public static final AttributeSensor SERVICE_UP = Startable.SERVICE_UP; - public static final AttributeSensor HOSTNAME = Attributes.HOSTNAME; - public static final AttributeSensor ADDRESS = Attributes.ADDRESS; - @SuppressWarnings("serial") - public static final AttributeSensor> TARGETS = new BasicAttributeSensor>( - new TypeToken>() {}, "geodns.targets", "Map of targets currently being managed (entity ID to URL)"); - - public void setServiceState(Lifecycle state); - - /** sets target to be a group whose *members* will be searched (non-Group items not supported) */ - // prior to 0.7.0 the API accepted non-group items, but did not handle them correctly - public void setTargetEntityProvider(final Group entityProvider); - - /** should return the hostname which this DNS service is configuring */ - public String getHostname(); - - public Map getTargetHosts(); -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsServiceImpl.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsServiceImpl.java b/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsServiceImpl.java deleted file mode 100644 index 78089dc..0000000 --- a/software/webapp/src/main/java/brooklyn/entity/dns/AbstractGeoDnsServiceImpl.java +++ /dev/null @@ -1,373 +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.dns; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URL; -import java.net.UnknownHostException; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -import org.apache.brooklyn.policy.PolicySpec; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import brooklyn.entity.Entity; -import brooklyn.entity.Group; -import brooklyn.entity.basic.AbstractEntity; -import brooklyn.entity.basic.Attributes; -import brooklyn.entity.basic.DynamicGroup; -import brooklyn.entity.basic.Lifecycle; -import brooklyn.entity.basic.ServiceStateLogic; -import brooklyn.entity.basic.ServiceStateLogic.ServiceNotUpLogic; -import brooklyn.entity.group.AbstractMembershipTrackingPolicy; -import brooklyn.entity.webapp.WebAppService; -import brooklyn.location.geo.HostGeoInfo; -import brooklyn.util.collections.MutableSet; -import brooklyn.util.exceptions.Exceptions; -import brooklyn.util.flags.SetFromFlag; -import brooklyn.util.net.Networking; -import brooklyn.util.time.Duration; -import brooklyn.util.time.Time; - -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Maps; - -public abstract class AbstractGeoDnsServiceImpl extends AbstractEntity implements AbstractGeoDnsService { - private static final Logger log = LoggerFactory.getLogger(AbstractGeoDnsService.class); - - @SetFromFlag - protected Group targetEntityProvider; - protected AbstractMembershipTrackingPolicy tracker; - - protected Map targetHosts = Collections.synchronizedMap(new LinkedHashMap()); - - // We complain (at debug) when we encounter a target entity for whom we can't derive hostname/ip information; - // this is the commonest case for the transient condition between the time the entity is created and the time - // it is started (at which point the location is specified). This set contains those entities we've complained - // about already, to avoid repetitive logging. - transient protected Set entitiesWithoutHostname = new HashSet(); - - // We complain (at info/warn) when we encounter a target entity for whom we can't derive geo information, even - // when hostname/ip is known. This set contains those entities we've complained about already, to avoid repetitive - // logging. - transient protected Set entitiesWithoutGeoInfo = new HashSet(); - - public AbstractGeoDnsServiceImpl() { - super(); - } - - @Override - public Map getTargetHosts() { - return targetHosts; - } - - @Override - public void onManagementBecomingMaster() { - super.onManagementBecomingMaster(); - startTracker(); - } - @Override - public void onManagementNoLongerMaster() { - endTracker(); - super.onManagementNoLongerMaster(); - } - - @Override - public void destroy() { - setServiceState(Lifecycle.DESTROYED); - super.destroy(); - } - - @Override - public void setServiceState(Lifecycle state) { - setAttribute(HOSTNAME, getHostname()); - ServiceStateLogic.setExpectedState(this, state); - if (state==Lifecycle.RUNNING) - ServiceNotUpLogic.clearNotUpIndicator(this, SERVICE_STATE_ACTUAL); - else - ServiceNotUpLogic.updateNotUpIndicator(this, SERVICE_STATE_ACTUAL, "Not in RUNNING state"); - } - - @Override - public void setTargetEntityProvider(final Group entityProvider) { - this.targetEntityProvider = checkNotNull(entityProvider, "targetEntityProvider"); - startTracker(); - } - - /** should set up so these hosts are targeted, and setServiceState appropriately */ - protected abstract void reconfigureService(Collection targetHosts); - - protected synchronized void startTracker() { - if (targetEntityProvider==null || !getManagementSupport().isDeployed()) { - log.debug("Tracker for "+this+" not yet active: "+targetEntityProvider+" / "+getManagementContext()); - return; - } - endTracker(); - log.debug("Initializing tracker for "+this+", following "+targetEntityProvider); - tracker = addPolicy(PolicySpec.create(MemberTrackingPolicy.class) - .displayName("GeoDNS targets tracker") - .configure("sensorsToTrack", ImmutableSet.of(HOSTNAME, ADDRESS, Attributes.MAIN_URI, WebAppService.ROOT_URL)) - .configure("group", targetEntityProvider)); - refreshGroupMembership(); - } - - protected synchronized void endTracker() { - if (tracker == null || targetEntityProvider==null) return; - removePolicy(tracker); - tracker = null; - } - - public static class MemberTrackingPolicy extends AbstractMembershipTrackingPolicy { - @Override - protected void onEntityEvent(EventType type, Entity entity) { - ((AbstractGeoDnsServiceImpl)super.entity).refreshGroupMembership(); - } - } - - @Override - public abstract String getHostname(); - - long lastUpdate = -1; - - // TODO: remove group member polling once locations can be determined via subscriptions - protected void refreshGroupMembership() { - try { - if (log.isDebugEnabled()) log.debug("GeoDns {} refreshing targets", this); - if (targetEntityProvider == null) - return; - if (targetEntityProvider instanceof DynamicGroup) - ((DynamicGroup) targetEntityProvider).rescanEntities(); - Set pool = MutableSet.copyOf(targetEntityProvider instanceof Group ? ((Group)targetEntityProvider).getMembers(): targetEntityProvider.getChildren()); - if (log.isDebugEnabled()) log.debug("GeoDns {} refreshing targets, pool now {}", this, pool); - - boolean changed = false; - Set previousOnes = MutableSet.copyOf(targetHosts.keySet()); - for (Entity e: pool) { - previousOnes.remove(e); - changed |= addTargetHost(e); - } - // anything left in previousOnes is no longer applicable - for (Entity e: previousOnes) { - changed = true; - removeTargetHost(e, false); - } - - // do a periodic full update hourly once we are active (the latter is probably not needed) - if (changed || (lastUpdate>0 && Time.hasElapsedSince(lastUpdate, Duration.ONE_HOUR))) - update(); - - } catch (Exception e) { - log.error("Problem refreshing group membership: "+e, e); - } - } - - /** - * Adds this host, if it is absent or if its hostname has changed. - *

- * For whether to use hostname or ip, see config and attributes {@link AbstractGeoDnsService#USE_HOSTNAMES}, - * {@link Attributes#HOSTNAME} and {@link Attributes#ADDRESS} (via {@link #inferHostname(Entity)} and {@link #inferIp(Entity)}. - * Note that the "hostname" could in fact be an IP address, if {@link #inferHostname(Entity)} returns an IP! - *

- * TODO in a future release, we may change this to explicitly set the sensor(s) to look at on the entity, and - * be stricter about using them in order. - * - * @return true if host is added or changed - */ - protected boolean addTargetHost(Entity entity) { - try { - HostGeoInfo oldGeo = targetHosts.get(entity); - String hostname = inferHostname(entity); - String ip = inferIp(entity); - String addr = (getConfig(USE_HOSTNAMES) || ip == null) ? hostname : ip; - - if (addr==null) addr = ip; - if (addr == null) { - if (entitiesWithoutHostname.add(entity)) { - log.debug("GeoDns ignoring {} (no hostname/ip/URL info yet available)", entity); - } - return false; - } - - // prefer the geo from the entity (or location parent), but fall back to inferring - // e.g. if it supplies a URL - HostGeoInfo geo = HostGeoInfo.fromEntity(entity); - if (geo==null) geo = inferHostGeoInfo(hostname, ip); - - if (Networking.isPrivateSubnet(addr) && ip!=null && !Networking.isPrivateSubnet(ip)) { - // fix for #1216 - log.debug("GeoDns using IP "+ip+" for "+entity+" as addr "+addr+" resolves to private subnet"); - addr = ip; - } - if (Networking.isPrivateSubnet(addr)) { - if (getConfig(INCLUDE_HOMELESS_ENTITIES)) { - if (entitiesWithoutGeoInfo.add(entity)) { - log.info("GeoDns including {}, even though {} is a private subnet (homeless entities included)", entity, addr); - } - } else { - if (entitiesWithoutGeoInfo.add(entity)) { - log.warn("GeoDns ignoring {} (private subnet detected for {})", entity, addr); - } - return false; - } - } - - if (geo == null) { - if (getConfig(INCLUDE_HOMELESS_ENTITIES)) { - if (entitiesWithoutGeoInfo.add(entity)) { - log.info("GeoDns including {}, even though no geography info available for {})", entity, addr); - } - geo = HostGeoInfo.create(addr, "unknownLocation("+addr+")", 0, 0); - } else { - if (entitiesWithoutGeoInfo.add(entity)) { - log.warn("GeoDns ignoring {} (no geography info available for {})", entity, addr); - } - return false; - } - } - - if (!addr.equals(geo.getAddress())) { - // if the location provider did not have an address, create a new one with it - geo = HostGeoInfo.create(addr, geo.displayName, geo.latitude, geo.longitude); - } - - // If we already knew about it, and it hasn't changed, then nothing to do - if (oldGeo != null && geo.getAddress().equals(oldGeo.getAddress())) { - return false; - } - - entitiesWithoutHostname.remove(entity); - entitiesWithoutGeoInfo.remove(entity); - log.info("GeoDns adding "+entity+" at "+geo+(oldGeo != null ? " (previously "+oldGeo+")" : "")); - targetHosts.put(entity, geo); - return true; - - } catch (Exception ee) { - log.warn("GeoDns ignoring "+entity+" (error analysing location): "+ee, ee); - return false; - } - } - - /** remove if host removed */ - protected boolean removeTargetHost(Entity e, boolean doUpdate) { - if (targetHosts.remove(e) != null) { - log.info("GeoDns removing reference to {}", e); - if (doUpdate) update(); - return true; - } - return false; - } - - protected void update() { - lastUpdate = System.currentTimeMillis(); - - Map m; - synchronized(targetHosts) { m = ImmutableMap.copyOf(targetHosts); } - if (log.isDebugEnabled()) log.debug("Full update of "+this+" ("+m.size()+" target hosts)"); - - Map entityIdToAddress = Maps.newLinkedHashMap(); - for (Map.Entry entry : m.entrySet()) { - entityIdToAddress.put(entry.getKey().getId(), entry.getValue().address); - } - - reconfigureService(new LinkedHashSet(m.values())); - - if (log.isDebugEnabled()) log.debug("Targets being set as "+entityIdToAddress); - setAttribute(TARGETS, entityIdToAddress); - } - - protected String inferHostname(Entity entity) { - String hostname = entity.getAttribute(Attributes.HOSTNAME); - URI url = entity.getAttribute(Attributes.MAIN_URI); - if (url!=null) { - try { - URL u = url.toURL(); - - String hostname2 = u.getHost(); - if (hostname==null) { - if (!entitiesWithoutGeoInfo.contains(entity)) //don't log repeatedly - log.warn("GeoDns "+this+" using URL {} to redirect to {} (HOSTNAME attribute is preferred, but not available)", url, entity); - hostname = hostname2; - } else if (!hostname.equals(hostname2)) { - if (!entitiesWithoutGeoInfo.contains(entity)) //don't log repeatedly - log.warn("GeoDns "+this+" URL {} of "+entity+" does not match advertised HOSTNAME {}; using hostname, not URL", url, hostname); - } - - if (u.getPort() > 0 && u.getPort() != 80 && u.getPort() != 443) { - if (!entitiesWithoutGeoInfo.contains(entity)) //don't log repeatedly - log.warn("GeoDns "+this+" detected non-standard port in URL {} for {}; forwarding may not work", url, entity); - } - - } catch (MalformedURLException e) { - log.warn("Invalid URL {} for entity {} in {}", new Object[] {url, entity, this}); - } - } - return hostname; - } - - protected String inferIp(Entity entity) { - return entity.getAttribute(Attributes.ADDRESS); - } - - protected HostGeoInfo inferHostGeoInfo(String hostname, String ip) throws UnknownHostException { - HostGeoInfo geoH = null; - if (hostname != null) { - try { - // For some entities, the hostname can actually be an IP! Therefore use Networking.getInetAddressWithFixedName - InetAddress addr = Networking.getInetAddressWithFixedName(hostname); - geoH = HostGeoInfo.fromIpAddress(addr); - } catch (RuntimeException e) { - // Most likely caused by (a wrapped) UnknownHostException - Exceptions.propagateIfFatal(e); - if (ip == null) { - if (log.isTraceEnabled()) log.trace("inferHostGeoInfo failing ("+Exceptions.getFirstInteresting(e)+"): hostname="+hostname+"; ip="+ip); - throw e; - } else { - if (log.isTraceEnabled()) log.trace("GeoDns failed to infer GeoInfo from hostname {}; will try with IP {} ({})", new Object[] {hostname, ip, e}); - } - } - } - - // Try IP address (prior to Mar 2014 we did not do this if USE_HOSTNAME was set but don't think that is desirable due to #1216) - if (ip != null) { - if (geoH == null) { - InetAddress addr = Networking.getInetAddressWithFixedName(ip); - geoH = HostGeoInfo.fromIpAddress(addr); - if (log.isTraceEnabled()) log.trace("GeoDns inferred GeoInfo {} from ip {} (could not infer from hostname {})", new Object[] {geoH, ip, hostname}); - } else { - geoH = HostGeoInfo.create(ip, geoH.displayName, geoH.latitude, geoH.longitude); - if (log.isTraceEnabled()) log.trace("GeoDns inferred GeoInfo {} from hostname {}; switching it to ip {}", new Object[] {geoH, hostname, ip}); - } - } else { - if (log.isTraceEnabled()) log.trace("GeoDns inferred GeoInfo {} from hostname {}", geoH, hostname); - } - - return geoH; - } -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsService.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsService.java b/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsService.java deleted file mode 100644 index 896d757..0000000 --- a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsService.java +++ /dev/null @@ -1,70 +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.dns.geoscaling; - -import java.net.URI; - -import brooklyn.config.ConfigKey; -import brooklyn.entity.basic.Attributes; -import brooklyn.entity.basic.ConfigKeys; -import brooklyn.entity.dns.AbstractGeoDnsService; -import brooklyn.entity.proxying.ImplementedBy; -import brooklyn.entity.webapp.WebAppServiceConstants; -import brooklyn.event.AttributeSensor; -import brooklyn.event.basic.BasicAttributeSensor; -import brooklyn.event.basic.BasicConfigKey; -import brooklyn.util.flags.SetFromFlag; - -@ImplementedBy(GeoscalingDnsServiceImpl.class) -public interface GeoscalingDnsService extends AbstractGeoDnsService { - - @SetFromFlag("sslTrustAll") - public static final ConfigKey SSL_TRUST_ALL = ConfigKeys.newBooleanConfigKey( - "ssl.trustAll", - "Whether to trust all certificates, or to fail with 'peer not authenticated' if untrusted (default false)", - false); - @SetFromFlag("randomizeSubdomainName") - public static final ConfigKey RANDOMIZE_SUBDOMAIN_NAME = new BasicConfigKey( - Boolean.class, "randomize.subdomain.name"); - @SetFromFlag("username") - public static final ConfigKey GEOSCALING_USERNAME = new BasicConfigKey( - String.class, "geoscaling.username"); - @SetFromFlag("password") - public static final ConfigKey GEOSCALING_PASSWORD = new BasicConfigKey( - String.class, "geoscaling.password"); - @SetFromFlag("primaryDomainName") - public static final ConfigKey GEOSCALING_PRIMARY_DOMAIN_NAME = new BasicConfigKey( - String.class, "geoscaling.primary.domain.name"); - @SetFromFlag("smartSubdomainName") - public static final ConfigKey GEOSCALING_SMART_SUBDOMAIN_NAME = new BasicConfigKey( - String.class, "geoscaling.smart.subdomain.name"); - - public static final AttributeSensor GEOSCALING_ACCOUNT = new BasicAttributeSensor( - String.class, "geoscaling.account", "Active user account for the GeoScaling.com service"); - public static final AttributeSensor MAIN_URI = Attributes.MAIN_URI; - public static final AttributeSensor ROOT_URL = WebAppServiceConstants.ROOT_URL; - public static final AttributeSensor MANAGED_DOMAIN = new BasicAttributeSensor( - String.class, "geoscaling.managed.domain", "Fully qualified domain name that will be geo-redirected; " + - "this will be the same as "+ROOT_URL.getName()+" but the latter will only be set when the domain has active targets"); - - public void applyConfig(); - - /** minimum/default TTL here is 300s = 5m */ - public long getTimeToLiveSeconds(); -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsServiceImpl.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsServiceImpl.java b/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsServiceImpl.java deleted file mode 100644 index c172680..0000000 --- a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingDnsServiceImpl.java +++ /dev/null @@ -1,200 +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.dns.geoscaling; - -import static brooklyn.entity.dns.geoscaling.GeoscalingWebClient.PROVIDE_CITY_INFO; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.net.URI; -import java.util.Collection; -import java.util.Set; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import brooklyn.entity.basic.Lifecycle; -import brooklyn.entity.basic.ServiceStateLogic; -import brooklyn.entity.dns.AbstractGeoDnsServiceImpl; -import brooklyn.entity.dns.geoscaling.GeoscalingWebClient.Domain; -import brooklyn.entity.dns.geoscaling.GeoscalingWebClient.SmartSubdomain; -import brooklyn.location.geo.HostGeoInfo; -import brooklyn.util.collections.MutableSet; -import brooklyn.util.http.HttpTool; -import brooklyn.util.text.Identifiers; -import brooklyn.util.text.Strings; - -public class GeoscalingDnsServiceImpl extends AbstractGeoDnsServiceImpl implements GeoscalingDnsService { - - private static final Logger log = LoggerFactory.getLogger(GeoscalingDnsServiceImpl.class); - - // Must remember any desired redirection targets if they're specified before configure() has been called. - private Set rememberedTargetHosts; - private GeoscalingWebClient webClient; - - // These are available only after the configure() method has been invoked. - private boolean randomizeSmartSubdomainName; - private String username; - private String password; - private String primaryDomainName; - private String smartSubdomainName; - - public GeoscalingDnsServiceImpl() { - } - - @Override - public void init() { - super.init(); - - // defaulting to randomized subdomains makes deploying multiple applications easier - if (getConfig(RANDOMIZE_SUBDOMAIN_NAME)==null) setConfig(RANDOMIZE_SUBDOMAIN_NAME, true); - - Boolean trustAll = getConfig(SSL_TRUST_ALL); - if (Boolean.TRUE.equals(trustAll)) { - webClient = new GeoscalingWebClient(HttpTool.httpClientBuilder().trustAll().build()); - } else { - webClient = new GeoscalingWebClient(); - } - } - - // Ensure our configure() method gets called; may be able to remove this if/when the framework detects this - // and invokes the configure() method automatically? - @Override - public void onManagementBecomingMaster() { - try { - applyConfig(); - } catch (Exception e) { - // don't prevent management coming up, but do mark it as on fire - log.error("Geoscaling did not come up correctly: "+e, e); - ServiceStateLogic.setExpectedState(this, Lifecycle.ON_FIRE); - } - super.onManagementBecomingMaster(); - } - - boolean isConfigured = false; - - public synchronized void applyConfig() { - randomizeSmartSubdomainName = getConfig(RANDOMIZE_SUBDOMAIN_NAME); - username = getConfig(GEOSCALING_USERNAME); - password = getConfig(GEOSCALING_PASSWORD); - primaryDomainName = getConfig(GEOSCALING_PRIMARY_DOMAIN_NAME); - smartSubdomainName = getConfig(GEOSCALING_SMART_SUBDOMAIN_NAME); - - // Ensure all mandatory configuration is provided. - checkNotNull(username, "The GeoScaling username is not specified"); - checkNotNull(password, "The GeoScaling password is not specified"); - checkNotNull(primaryDomainName, "The GeoScaling primary domain name is not specified"); - - if (randomizeSmartSubdomainName) { - // if no smart subdomain specified, but random is, use something random - if (smartSubdomainName != null) smartSubdomainName += "-"; - else smartSubdomainName = ""; - smartSubdomainName += Identifiers.makeRandomId(8); - } - checkNotNull(smartSubdomainName, "The GeoScaling smart subdomain name is not specified or randomized"); - - String fullDomain = smartSubdomainName+"."+primaryDomainName; - log.info("GeoScaling service will configure redirection for '"+fullDomain+"' domain"); - setAttribute(GEOSCALING_ACCOUNT, username); - setAttribute(MANAGED_DOMAIN, fullDomain); - setAttribute(HOSTNAME, getHostname()); - - isConfigured = true; - - if (rememberedTargetHosts != null) { - reconfigureService(rememberedTargetHosts); - rememberedTargetHosts = null; - } - } - - @Override - public String getHostname() { - String result = getAttribute(MANAGED_DOMAIN); - return (Strings.isBlank(result)) ? null : result; - } - - /** minimum/default TTL here is 300s = 5m */ - public long getTimeToLiveSeconds() { return 5*60; } - - @Override - public void destroy() { - setServiceState(Lifecycle.STOPPING); - if (!isConfigured) return; - - // Don't leave randomized subdomains configured on our GeoScaling account. - if (randomizeSmartSubdomainName) { - webClient.login(username, password); - Domain primaryDomain = webClient.getPrimaryDomain(primaryDomainName); - SmartSubdomain smartSubdomain = (primaryDomain != null) ? primaryDomain.getSmartSubdomain(smartSubdomainName) : null; - if (smartSubdomain != null) { - log.info("Deleting randomized GeoScaling smart subdomain '"+smartSubdomainName+"."+primaryDomainName+"'"); - smartSubdomain.delete(); - } - webClient.logout(); - } - - super.destroy(); - - isConfigured = false; - } - - protected void reconfigureService(Collection targetHosts) { - if (!isConfigured) { - this.rememberedTargetHosts = MutableSet.copyOf(targetHosts); - return; - } - - webClient.login(username, password); - Domain primaryDomain = webClient.getPrimaryDomain(primaryDomainName); - if (primaryDomain==null) - throw new NullPointerException(this+" got null from web client for primary domain "+primaryDomainName); - SmartSubdomain smartSubdomain = primaryDomain.getSmartSubdomain(smartSubdomainName); - - if (smartSubdomain == null) { - log.info("GeoScaling {} smart subdomain '{}.{}' does not exist, creating it now", new Object[] {this, smartSubdomainName, primaryDomainName}); - // TODO use WithMutexes to ensure this is single-entrant - primaryDomain.createSmartSubdomain(smartSubdomainName); - smartSubdomain = primaryDomain.getSmartSubdomain(smartSubdomainName); - } - - if (smartSubdomain != null) { - log.debug("GeoScaling {} being reconfigured to use {}", this, targetHosts); - String script = GeoscalingScriptGenerator.generateScriptString(targetHosts); - smartSubdomain.configure(PROVIDE_CITY_INFO, script); - if (targetHosts.isEmpty()) { - setServiceState(Lifecycle.CREATED); - setAttribute(ROOT_URL, null); - setAttribute(MAIN_URI, null); - } else { - setServiceState(Lifecycle.RUNNING); - String domain = getAttribute(MANAGED_DOMAIN); - if (!Strings.isEmpty(domain)) { - setAttribute(ROOT_URL, "http://"+domain+"/"); - setAttribute(MAIN_URI, URI.create("http://"+domain+"/")); - } - } - } else { - log.warn("Failed to retrieve or create GeoScaling smart subdomain '"+smartSubdomainName+"."+primaryDomainName+ - "', aborting attempt to configure service"); - setServiceState(Lifecycle.ON_FIRE); - } - - webClient.logout(); - } - -} http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/77dff880/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java ---------------------------------------------------------------------- diff --git a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java b/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java deleted file mode 100644 index 579a711..0000000 --- a/software/webapp/src/main/java/brooklyn/entity/dns/geoscaling/GeoscalingScriptGenerator.java +++ /dev/null @@ -1,79 +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.dns.geoscaling; - -import java.text.SimpleDateFormat; -import java.util.Collection; -import java.util.Date; -import java.util.Iterator; -import java.util.TimeZone; - -import brooklyn.location.geo.HostGeoInfo; -import brooklyn.util.ResourceUtils; -import brooklyn.util.javalang.JavaClassNames; -import brooklyn.util.os.Os; -import brooklyn.util.text.Strings; - -public class GeoscalingScriptGenerator { - - private static final String PHP_SCRIPT_TEMPLATE_RESOURCE = JavaClassNames.resolveClasspathUrl(GeoscalingScriptGenerator.class, "template.php"); - private static final String HOSTS_DECLARATIONS_MARKER = "/* HOST DECLARATIONS TO BE SUBSTITUTED HERE */"; - private static final String DATESTAMP_MARKER = "DATESTAMP"; - - - public static String generateScriptString(Collection hosts) { - return generateScriptString(new Date(), hosts); - } - - public static String generateScriptString(Date generationTime, Collection hosts) { - String template = ResourceUtils.create(GeoscalingScriptGenerator.class).getResourceAsString(PHP_SCRIPT_TEMPLATE_RESOURCE); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss 'UTC'"); - sdf.setTimeZone(TimeZone.getTimeZone("UTC")); - String datestamp = sdf.format(generationTime); - String declarations = getHostsDeclaration(hosts); - return template - .replaceAll(DATESTAMP_MARKER, datestamp) - .replace(HOSTS_DECLARATIONS_MARKER, declarations); - } - - private static String getHostsDeclaration(Collection hosts) { - StringBuffer sb = new StringBuffer(); - sb.append("$hosts = array(").append(Os.LINE_SEPARATOR); - Iterator iServer = hosts.iterator(); - while (iServer.hasNext()) { - HostGeoInfo server = iServer.next(); - sb.append(" array('name' => '").append(escape(server.displayName)).append("',").append(Os.LINE_SEPARATOR); - sb.append(" 'latitude' => ").append(server.latitude).append(",").append(Os.LINE_SEPARATOR); - sb.append(" 'longitude' => ").append(server.longitude).append(",").append(Os.LINE_SEPARATOR); - sb.append(" 'ip' => '").append(escape(server.address)).append("')"); - if (iServer.hasNext()) sb.append(",").append(Os.LINE_SEPARATOR); - sb.append(Os.LINE_SEPARATOR); - } - sb.append(");").append(Os.LINE_SEPARATOR); - return sb.toString(); - } - - private static String escape(String txt) { - txt = Strings.replaceAllNonRegex(txt, "\\", "\\\\"); - txt = Strings.replaceAllNonRegex(txt, "'", "\\'"); - txt = Strings.replaceAllNonRegex(txt, "\"", "\\\"'"); - return txt; - } - -}