brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [26/27] brooklyn-server git commit: This closes #743
Date Fri, 30 Jun 2017 14:03:14 GMT
This closes #743


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

Branch: refs/heads/master
Commit: db858266372ccb45a2969599d3a38349e025aecd
Parents: edfc80e 7a6e06f
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Fri Jun 30 15:02:16 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Fri Jun 30 15:02:16 2017 +0100

----------------------------------------------------------------------
 .../brooklyn/api/objs/BrooklynObject.java       |   3 +
 .../brooklyn/api/typereg/OsgiBundleWithUrl.java |   6 +-
 .../BrooklynComponentTemplateResolver.java      |  11 +-
 .../service/BrooklynServiceTypeResolver.java    |  78 -------
 .../creation/service/ServiceTypeResolver.java   |  77 -------
 .../service/ServiceTypeResolverAdaptor.java     |  70 ------
 .../camp/brooklyn/ExternalConfigYamlTest.java   |   2 +-
 .../service/ServiceTypeResolverTest.java        |  39 ----
 .../service/TestServiceTypeResolver.java        |  54 -----
 .../brooklyn/test/lite/CampYamlLiteTest.java    |   2 +-
 ...lyn.spi.creation.service.ServiceTypeResolver |  19 --
 .../apache/brooklyn/core/BrooklynVersion.java   |   5 +
 .../catalog/internal/BasicBrooklynCatalog.java  | 108 ++++++++--
 .../core/catalog/internal/CatalogBundleDto.java |  10 +-
 .../internal/CatalogItemDtoAbstract.java        |  25 ++-
 .../core/catalog/internal/CatalogUtils.java     |  22 +-
 .../core/mgmt/ha/OsgiArchiveInstaller.java      |  21 +-
 .../brooklyn/core/mgmt/ha/OsgiManager.java      |  39 ++--
 .../core/mgmt/rebind/RebindIteration.java       |   5 +-
 .../mgmt/rebind/dto/MementosGenerators.java     |   2 +-
 .../core/typereg/BasicBrooklynTypeRegistry.java |   4 +-
 .../core/typereg/BasicManagedBundle.java        |  14 +-
 .../core/typereg/BasicOsgiBundleWithUrl.java    |  12 +-
 .../core/typereg/RegisteredTypeNaming.java      | 112 ++++++++++
 .../brooklyn/util/core/ClassLoaderUtils.java    |  17 +-
 .../apache/brooklyn/util/core/osgi/Osgis.java   |  80 ++++---
 .../internal/CatalogItemComparatorTest.java     |   9 +-
 .../catalog/internal/CatalogVersioningTest.java |  24 ++-
 .../core/mgmt/rebind/MiscClassesRebindTest.java | 127 +++++++++++
 .../core/typereg/RegisteredTypeNamingTest.java  |  92 ++++++++
 .../util/core/ClassLoaderUtilsTest.java         |   2 +-
 .../core/xstream/OsgiClassPrefixerTest.java     |   2 +-
 ...7-06-versionedname-entity-n7p20t5h4o.memento |  42 ++++
 .../rest/resources/CatalogResource.java         |   3 +
 .../rest/transform/EntityTransformer.java       |  13 +-
 .../rest/util/BrooklynRestResourceUtils.java    |  66 ------
 .../brooklyn/rest/util/WebResourceUtils.java    |   3 +-
 .../rest/resources/CatalogResourceTest.java     |   4 +-
 .../util/BrooklynRestResourceUtilsTest.java     |  39 ++--
 .../apache/brooklyn/util/osgi/OsgiUtils.java    |  14 +-
 .../brooklyn/util/osgi/VersionedName.java       | 123 +++++++++--
 .../util/text/BrooklynVersionSyntax.java        | 195 +++++++++++++++++
 .../util/text/NaturalOrderComparator.java       |  41 +++-
 .../brooklyn/util/text/VersionComparator.java   | 211 ++++++-------------
 .../brooklyn/util/osgi/OsgiUtilsTest.java       |   3 +
 .../apache/brooklyn/util/osgi/OsgisTest.java    |   8 +-
 .../brooklyn/util/osgi/VersionedNameTest.java   |  36 +++-
 .../util/text/BrooklynVersionSyntaxTest.java    |  98 +++++++++
 .../util/text/ComparableVersionTest.java        |   5 +-
 .../util/text/NaturalOrderComparatorTest.java   |  63 ++++--
 .../util/text/VersionComparatorTest.java        |  65 +++---
 51 files changed, 1317 insertions(+), 808 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/db858266/camp/camp-brooklyn/src/main/java/org/apache/brooklyn/camp/brooklyn/spi/creation/BrooklynComponentTemplateResolver.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/db858266/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
----------------------------------------------------------------------
diff --cc rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
index a469083,9c6272b..8208738
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/CatalogResource.java
@@@ -197,17 -197,12 +197,20 @@@ public class CatalogResource extends Ab
          }
  
          ReferenceWithError<OsgiBundleInstallationResult> result = ((ManagementContextInternal)mgmt()).getOsgiManager().get()
 -            .install(new ByteArrayInputStream(zipInput));
 +            .install(null, new ByteArrayInputStream(zipInput), true, true, forceUpdate);
 +
 +        if (OsgiBundleInstallationResult.ResultCode.IGNORING_BUNDLE_AREADY_INSTALLED.equals(result.getWithoutError().getCode()))
{
 +            result = ReferenceWithError.newInstanceThrowingError(result.getWithoutError(),
new IllegalStateException(
 +                    "Updating existing catalog entries is forbidden: " +
 +                    result.getWithoutError().getMetadata().getSymbolicName() + ":" +
 +                    result.getWithoutError().getMetadata().getVersion() +
 +                    ". Use forceUpdate argument to override."));
 +        }
          
          if (result.hasError()) {
+             if (log.isTraceEnabled()) {
+                 log.trace("Unable to create from archive, returning 400: "+result.getError().getMessage(),
result.getError());
+             }
              return ApiError.builder().errorCode(Status.BAD_REQUEST).message(result.getWithoutError().getMessage())
                  .data(BundleInstallationRestResult.of(result.getWithoutError(), mgmt(),
brooklyn(), ui)).build().asJsonResponse();
          }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/db858266/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/resources/CatalogResourceTest.java
----------------------------------------------------------------------


Mime
View raw message