You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by sj...@apache.org on 2016/02/11 12:58:15 UTC
[1/4] brooklyn-server git commit: Fixes port inference for
dynamically added ConfigKeys
Repository: brooklyn-server
Updated Branches:
refs/heads/master 6693cd0cd -> f9a59e5d4
Fixes port inference for dynamically added ConfigKeys
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/e98b1581
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/e98b1581
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/e98b1581
Branch: refs/heads/master
Commit: e98b15811a6f5d9af70ebe34b738e27e13969c1b
Parents: 90eb128
Author: Robert Moss <ro...@cloudsoftcorp.com>
Authored: Wed Feb 10 15:54:02 2016 +0000
Committer: Robert Moss <ro...@cloudsoftcorp.com>
Committed: Wed Feb 10 15:54:02 2016 +0000
----------------------------------------------------------------------
.../apache/brooklyn/entity/software/base/InboundPortsUtils.java | 3 +++
1 file changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/e98b1581/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
----------------------------------------------------------------------
diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
index adc7b58..73e7a86 100644
--- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
+++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/InboundPortsUtils.java
@@ -24,6 +24,7 @@ import com.google.common.reflect.TypeToken;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.location.PortRange;
import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.entity.EntityInternal;
import org.apache.brooklyn.util.collections.MutableSet;
import org.apache.brooklyn.util.core.flags.TypeCoercions;
import org.apache.brooklyn.util.guava.Maybe;
@@ -75,6 +76,8 @@ public class InboundPortsUtils {
if (portsAutoInfer == null || portsAutoInfer.booleanValue()) { // auto-infer defaults to true if not specified
Set<ConfigKey<?>> configKeys = Sets.newHashSet(extraConfigKeys);
configKeys.addAll(entity.getEntityType().getConfigKeys());
+ // Also add dynamically added config keys
+ configKeys.addAll(((EntityInternal)entity).config().getBag().getAllConfigAsConfigKeyMap().keySet());
if (portRegex == null) portRegex = ".*\\.port"; // defaults to legacy regex if not specified
Pattern portsPattern = Pattern.compile(portRegex);
[4/4] brooklyn-server git commit: This closes #18
Posted by sj...@apache.org.
This closes #18
Fixes port inference for dynamically added ConfigKeys
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/f9a59e5d
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/f9a59e5d
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/f9a59e5d
Branch: refs/heads/master
Commit: f9a59e5d40a17962b643e09c8f000562c302061a
Parents: 6693cd0 56ddfe6
Author: Sam Corbett <sa...@cloudsoftcorp.com>
Authored: Thu Feb 11 11:57:58 2016 +0000
Committer: Sam Corbett <sa...@cloudsoftcorp.com>
Committed: Thu Feb 11 11:57:58 2016 +0000
----------------------------------------------------------------------
.../entity/software/base/InboundPortsUtils.java | 3 ++
.../software/base/InboundPortsUtilsTest.java | 53 ++++++++++++++++++++
2 files changed, 56 insertions(+)
----------------------------------------------------------------------
[3/4] brooklyn-server git commit: adds test for dynamically added keys
Posted by sj...@apache.org.
adds test for dynamically added keys
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/56ddfe6c
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/56ddfe6c
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/56ddfe6c
Branch: refs/heads/master
Commit: 56ddfe6c59dfed02c31b48e6bc82045b00cd237e
Parents: 0a416f3
Author: Robert Moss <ro...@cloudsoftcorp.com>
Authored: Thu Feb 11 10:13:10 2016 +0000
Committer: Robert Moss <ro...@cloudsoftcorp.com>
Committed: Thu Feb 11 11:18:05 2016 +0000
----------------------------------------------------------------------
.../software/base/InboundPortsUtilsTest.java | 53 ++++++++++++++++++++
1 file changed, 53 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/56ddfe6c/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java
----------------------------------------------------------------------
diff --git a/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java
new file mode 100644
index 0000000..fe18191
--- /dev/null
+++ b/software/base/src/test/java/org/apache/brooklyn/entity/software/base/InboundPortsUtilsTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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 org.apache.brooklyn.entity.software.base;
+
+import java.util.Collection;
+
+import org.apache.brooklyn.api.entity.EntitySpec;
+import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.config.ConfigKey;
+import org.apache.brooklyn.core.config.ConfigKeys;
+import org.apache.brooklyn.core.entity.Entities;
+import org.apache.brooklyn.core.test.BrooklynAppUnitTestSupport;
+import org.apache.brooklyn.core.test.entity.TestApplication;
+import org.apache.brooklyn.core.test.entity.TestEntity;
+import org.apache.brooklyn.location.localhost.LocalhostMachineProvisioningLocation;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+import org.testng.Assert;
+
+import com.google.common.collect.ImmutableSet;
+
+public class InboundPortsUtilsTest extends BrooklynAppUnitTestSupport {
+
+ @Test
+ public void testGetRequiredOpenPortsGetsDynamicallyAddedKeys() {
+ TestEntity entity = app.createAndManageChild(EntitySpec.create(TestEntity.class));
+ Collection<Integer> defaultRequiredOpenPorts = InboundPortsUtils.getRequiredOpenPorts(entity, ImmutableSet.<ConfigKey<?>>of(), true, null);
+ Assert.assertEquals(defaultRequiredOpenPorts, ImmutableSet.of(), "Expected no ports");
+ ConfigKey<Integer> newTestConfigKeyPort = ConfigKeys.newIntegerConfigKey("new.test.config.key.port");
+ ConfigKey<String> newTestConfigKeyString = ConfigKeys.newStringConfigKey("new.test.config.key.string");
+ entity.config().set(newTestConfigKeyPort, 9999);
+ entity.config().set(newTestConfigKeyString, "foo.bar");
+ Collection<Integer> dynamicRequiredOpenPorts = InboundPortsUtils.getRequiredOpenPorts(entity, ImmutableSet.<ConfigKey<?>>of(), true, null);
+ Assert.assertEquals(dynamicRequiredOpenPorts, ImmutableSet.of(9999), "Expected new port to be added");
+ }
+}
[2/4] brooklyn-server git commit: Merge commit
'6693cd0cd7a1f26dd97a52095674ed3a0ff97f74' into fix/port-inference
Posted by sj...@apache.org.
Merge commit '6693cd0cd7a1f26dd97a52095674ed3a0ff97f74' into fix/port-inference
Project: http://git-wip-us.apache.org/repos/asf/brooklyn-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-server/commit/0a416f32
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-server/tree/0a416f32
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-server/diff/0a416f32
Branch: refs/heads/master
Commit: 0a416f32d11dca97cd8b881ddb8c0dfd51adbf4e
Parents: e98b158 6693cd0
Author: Robert Moss <ro...@cloudsoftcorp.com>
Authored: Wed Feb 10 18:02:19 2016 +0000
Committer: Robert Moss <ro...@cloudsoftcorp.com>
Committed: Wed Feb 10 18:02:19 2016 +0000
----------------------------------------------------------------------
LICENSE | 9 +-
NOTICE | 2 +-
.../EmptySoftwareProcessWithPassword.yaml | 2 +-
.../test/resources/example-with-function.yaml | 2 +-
.../test/resources/test-app-with-enricher.yaml | 2 +-
.../test/resources/test-app-with-policy.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 | 2 +-
.../resources/test-propagating-enricher.yaml | 2 +-
.../resources/test-referencing-enrichers.yaml | 2 +-
.../resources/test-referencing-entities.yaml | 2 +-
.../resources/test-referencing-policies.yaml | 2 +-
.../src/test/resources/test-tomcat-https.yaml | 2 +-
camp/camp-server/pom.xml | 5 -
core/pom.xml | 8 -
.../apache/brooklyn/core/BrooklynVersion.java | 5 +-
.../catalog/internal/BasicBrooklynCatalog.java | 2 +-
...ocationPropertiesFromBrooklynProperties.java | 10 ++
.../apache/brooklyn/core/mgmt/BrooklynTags.java | 7 +-
.../brooklyn/core/mgmt/BrooklynTaskTags.java | 2 +-
.../core/mgmt/entitlement/Entitlements.java | 42 ++++-
.../ha/dto/BasicManagementNodeSyncRecord.java | 5 +-
.../rebind/dto/BasicCatalogItemMemento.java | 2 +-
.../mgmt/rebind/dto/BasicEntityMemento.java | 5 +-
.../mgmt/rebind/dto/MutableBrooklynMemento.java | 5 +-
.../entity/group/AbstractGroupImpl.java | 22 ++-
.../util/core/crypto/FluentKeySigner.java | 2 +-
.../apache/brooklyn/util/core/osgi/Osgis.java | 4 -
.../mgmt/entitlement/EntityEntitlementTest.java | 4 +
karaf/features/src/main/feature/feature.xml | 88 +++++++++--
karaf/pom.xml | 1 -
.../brooklyn/launcher/BrooklynLauncher.java | 17 +-
.../brooklyn/launcher/BrooklynWebServer.java | 90 +++++------
.../launcher/WebAppContextProvider.java | 115 ++++++++++++++
.../jsgui/BrooklynJavascriptGuiLauncher.java | 15 +-
launcher/src/test/resources/mongo-scripts.yaml | 2 +-
...JcloudsPropertiesFromBrooklynProperties.java | 34 +++-
.../jclouds/JcloudsLocationResolverTest.java | 42 ++++-
parent/pom.xml | 27 +---
pom.xml | 9 +-
rest/rest-api/pom.xml | 15 +-
.../apache/brooklyn/rest/api/ActivityApi.java | 1 -
.../brooklyn/rest/api/ApplicationApi.java | 14 +-
.../brooklyn/rest/domain/AccessSummary.java | 19 +--
.../apache/brooklyn/rest/domain/ApiError.java | 83 +++++-----
.../brooklyn/rest/domain/ApplicationSpec.java | 63 +++-----
.../rest/domain/ApplicationSummary.java | 29 ++--
.../rest/domain/BrooklynFeatureSummary.java | 37 ++++-
.../rest/domain/CatalogEntitySummary.java | 50 ++++--
.../rest/domain/CatalogItemSummary.java | 69 ++++++---
.../rest/domain/CatalogLocationSummary.java | 27 +++-
.../rest/domain/CatalogPolicySummary.java | 32 ++--
.../brooklyn/rest/domain/ConfigSummary.java | 50 +++---
.../brooklyn/rest/domain/EffectorSummary.java | 60 +++-----
.../rest/domain/EntityConfigSummary.java | 31 ++--
.../brooklyn/rest/domain/EntityDetail.java | 80 ++++++++++
.../apache/brooklyn/rest/domain/EntitySpec.java | 38 ++---
.../brooklyn/rest/domain/EntitySummary.java | 38 +++--
.../rest/domain/HighAvailabilitySummary.java | 51 ++++--
.../brooklyn/rest/domain/LinkWithMetadata.java | 55 +++----
.../rest/domain/LocationConfigSummary.java | 32 ++--
.../brooklyn/rest/domain/LocationSpec.java | 35 ++---
.../brooklyn/rest/domain/LocationSummary.java | 34 ++--
.../rest/domain/PolicyConfigSummary.java | 34 ++--
.../brooklyn/rest/domain/PolicySummary.java | 43 +++---
.../rest/domain/ScriptExecutionSummary.java | 48 ++++--
.../brooklyn/rest/domain/SensorSummary.java | 49 +++---
.../brooklyn/rest/domain/TaskSummary.java | 123 ++++++++++-----
.../brooklyn/rest/domain/UsageStatistic.java | 38 ++---
.../brooklyn/rest/domain/UsageStatistics.java | 26 ++--
.../brooklyn/rest/domain/VersionSummary.java | 30 +++-
rest/rest-api/src/main/webapp/WEB-INF/web.xml | 4 +-
.../rest/domain/AbstractDomainTest.java | 44 ++++++
.../brooklyn/rest/domain/ApiErrorTest.java | 18 ++-
.../rest/domain/ApplicationSpecTest.java | 37 ++---
.../rest/domain/EffectorSummaryTest.java | 37 ++---
.../brooklyn/rest/domain/EntitySpecTest.java | 20 ++-
.../brooklyn/rest/domain/EntitySummaryTest.java | 35 ++---
.../rest/domain/LocationSummaryTest.java | 41 +++++
.../rest/domain/VersionSummaryTest.java | 51 +++---
.../brooklyn/rest/util/RestApiTestUtils.java | 5 +-
rest/rest-client/pom.xml | 7 +-
.../brooklyn/rest/client/BrooklynApiUtil.java | 154 +++++++++++++++++++
.../rest/client/BrooklynApiUtilTest.java | 129 ++++++++++++++++
.../rest-client/src/test/webapp/WEB-INF/web.xml | 2 +-
rest/rest-server/pom.xml | 41 ++---
.../resources/AbstractBrooklynRestResource.java | 3 +-
.../rest/resources/ActivityResource.java | 42 ++++-
.../rest/resources/ApplicationResource.java | 139 ++++++-----------
.../rest/resources/CatalogResource.java | 32 ++--
.../rest/resources/EffectorResource.java | 2 +-
.../rest/resources/EntityConfigResource.java | 77 +++++++---
.../brooklyn/rest/resources/EntityResource.java | 4 +-
.../rest/resources/PolicyConfigResource.java | 2 +-
.../brooklyn/rest/resources/SensorResource.java | 59 +++++--
.../brooklyn/rest/resources/ServerResource.java | 16 +-
.../rest/util/BrooklynRestResourceUtils.java | 6 +-
.../brooklyn/rest/util/WebResourceUtils.java | 2 +-
.../rest/util/json/BidiSerialization.java | 41 +++--
.../util/json/BrooklynJacksonJsonProvider.java | 31 ++--
.../json/ConfigurableSerializerProvider.java | 52 +++----
.../ErrorAndToStringUnknownTypeSerializer.java | 41 +++--
.../rest/util/json/MultimapSerializer.java | 62 --------
...StrictPreferringFieldsVisibilityChecker.java | 19 +--
.../rest-server/src/main/webapp/WEB-INF/web.xml | 2 +-
.../brooklyn/rest/BrooklynRestApiLauncher.java | 11 +-
.../brooklyn/rest/domain/ApplicationTest.java | 17 +-
.../rest/domain/LocationSummaryTest.java | 55 -------
.../AbstractRestApiEntitlementsTest.java | 111 +++++++++++++
.../ActivityApiEntitlementsTest.java | 123 +++++++++++++++
.../AuthenticateAnyoneSecurityProvider.java | 41 +++++
.../EntityConfigApiEntitlementsTest.java | 103 +++++++++++++
.../entitlement/SensorApiEntitlementsTest.java | 108 +++++++++++++
.../entitlement/ServerApiEntitlementsTest.java | 34 ++++
.../StaticDelegatingEntitlementManager.java | 37 +++++
.../rest/resources/DescendantsTest.java | 4 +-
.../rest/resources/EntityResourceTest.java | 4 +-
.../rest/testing/BrooklynRestApiTest.java | 2 +-
.../rest/testing/BrooklynRestResourceTest.java | 2 +-
.../json/BrooklynJacksonSerializerTest.java | 6 +-
.../org/apache/brooklyn/cli/AbstractMain.java | 6 +-
server-cli/src/main/license/files/NOTICE | 2 +-
server-cli/src/test/license/files/NOTICE | 2 +-
.../AbstractSoftwareProcessStreamsTest.java | 10 +-
utils/common/pom.xml | 34 +++-
.../java/org/apache/brooklyn/util/os/Os.java | 10 +-
.../brooklyn/util/osgi/OsgiActivator.java | 33 ++++
.../org/apache/brooklyn/util/osgi/OsgiUtil.java | 44 ++++++
.../src/main/license/NOTICE.shaded | 2 +-
134 files changed, 2733 insertions(+), 1272 deletions(-)
----------------------------------------------------------------------