brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [14/39] brooklyn-server git commit: Address the following review comments.
Date Fri, 21 Apr 2017 22:55:33 GMT
Address the following review comments.

https://github.com/apache/brooklyn-server/pull/338#discussion_r94756103
Remove/deprecate this method and use getCatalogItemSuperIds instead in callers.
- done; also renames "SuperIds" to "Hierarchy" everywhere.


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

Branch: refs/heads/master
Commit: d3a64d985b0ba792bf6bcd079a4f40f8a787ec85
Parents: 68b94ce
Author: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Authored: Tue Feb 21 10:55:00 2017 +0000
Committer: Geoff Macartney <geoff.macartney@cloudsoftcorp.com>
Committed: Thu Apr 20 11:20:36 2017 +0100

----------------------------------------------------------------------
 .../brooklyn/catalog/CatalogYamlRebindTest.java |  4 +-
 .../core/catalog/internal/CatalogItemDo.java    |  4 +-
 .../core/catalog/internal/CatalogUtils.java     |  2 +-
 .../internal/AbstractManagementContext.java     |  6 +--
 .../BrooklynMementoPersisterToObjectStore.java  |  8 ++--
 .../core/mgmt/rebind/RebindIteration.java       |  4 +-
 .../core/mgmt/rebind/dto/AbstractMemento.java   | 39 +++++++++++---------
 .../rebind/dto/EntityMementoManifestImpl.java   |  4 ++
 .../mgmt/rebind/dto/MementosGenerators.java     |  2 +-
 .../rebind/transformer/CompoundTransformer.java | 10 ++---
 .../core/objs/AbstractBrooklynObject.java       |  2 +-
 .../core/objs/AbstractEntityAdjunct.java        |  2 +-
 .../core/objs/BrooklynObjectInternal.java       |  2 +-
 .../core/objs/proxy/InternalEntityFactory.java  |  2 +-
 .../objs/proxy/InternalLocationFactory.java     |  2 +-
 .../core/objs/proxy/InternalPolicyFactory.java  |  4 +-
 .../rebind/RebindConfigInheritanceTest.java     |  2 +-
 .../util/core/ClassLoaderUtilsTest.java         |  2 +-
 18 files changed, 55 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
----------------------------------------------------------------------
diff --git a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
index e391571..08616fc 100644
--- a/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
+++ b/camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/catalog/CatalogYamlRebindTest.java
@@ -171,12 +171,12 @@ public class CatalogYamlRebindTest extends AbstractYamlRebindTest {
     }
 
     // Re-run the same tests as testRebindWithCatalogAndApp but with the XML updated to mimic
state
-    // persisted before <catalogItemId> was replaced with <catalogItemSuperIds>.
+    // persisted before <catalogItemId> was replaced with <catalogItemHierarchy>.
     @Test(dataProvider = "dataProvider")
     public void testRebindWithCatalogAndAppRebindCatalogItemIds(RebindWithCatalogTestMode
mode, OsgiMode osgiMode) throws Exception {
         final RebindOptions rebindOptions = RebindOptions.create();
         applyCompoundStateTransformer(rebindOptions, CompoundTransformer.builder()
-            .xmlReplaceItem("//catalogItemSuperIds", "<catalogItemId><xsl:value-of
select=\"string\"/></catalogItemId>")
+            .xmlReplaceItem("//catalogItemHierarchy", "<catalogItemId><xsl:value-of
select=\"string\"/></catalogItemId>")
             .build());
         testRebindWithCatalogAndAppUsingOptions(mode, osgiMode, rebindOptions);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogItemDo.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogItemDo.java
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogItemDo.java
index 7cf6635..42cdb42 100644
--- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogItemDo.java
+++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogItemDo.java
@@ -132,8 +132,8 @@ public class CatalogItemDo<T,SpecT> implements CatalogItem<T,SpecT>,
BrooklynObj
     }
 
     @Override
-    public void setCatalogItemIds(List<String> ids) {
-        itemDto.setCatalogItemIds(ids);
+    public void setCatalogItemIdHierarchy(List<String> ids) {
+        itemDto.setCatalogItemIdHierarchy(ids);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java
b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java
index c56a77c..367d6ee 100644
--- a/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java
+++ b/core/src/main/java/org/apache/brooklyn/core/catalog/internal/CatalogUtils.java
@@ -192,7 +192,7 @@ public class CatalogUtils {
                 if (log.isDebugEnabled())
                     BrooklynLogging.log(log, BrooklynLogging.levelDebugOrTraceIfReadOnly(entity),
                         "Catalog item addition: "+entity+" from "+entity.getCatalogItemId()+"
applying its catalog item ID to "+itemBeingAdded);
-                ((BrooklynObjectInternal)itemBeingAdded).setCatalogItemIds(entity.getCatalogItemHierarchy());
+                ((BrooklynObjectInternal)itemBeingAdded).setCatalogItemIdHierarchy(entity.getCatalogItemHierarchy());
             } else {
                 if (!itemBeingAdded.getCatalogItemId().equals(entity.getCatalogItemId()))
{
                     // not a problem, but something to watch out for

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
index 9c45048..1771028 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
@@ -130,10 +130,10 @@ public abstract class AbstractManagementContext implements ManagementContextInte
             public BrooklynClassLoadingContext apply(@Nullable Object input) {
                 if (input instanceof EntityInternal) {
                     EntityInternal internal = (EntityInternal)input;
-                    final List<String> catalogItemSuperIds = internal.getCatalogItemHierarchy();
-                    if (catalogItemSuperIds.size() > 0) {
+                    final List<String> catalogItemHierarchy = internal.getCatalogItemHierarchy();
+                    if (catalogItemHierarchy.size() > 0) {
                         BrooklynClassLoadingContextSequential seqLoader =
-                            newClassLoadingContextForCatalogItems(internal.getManagementContext(),
catalogItemSuperIds);
+                            newClassLoadingContextForCatalogItems(internal.getManagementContext(),
catalogItemHierarchy);
                         JavaBrooklynClassLoadingContext entityLoader =
                             JavaBrooklynClassLoadingContext.create(input.getClass().getClassLoader());
                         seqLoader.add(entityLoader);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
index 019ac86..1be1c2c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/persist/BrooklynMementoPersisterToObjectStore.java
@@ -352,14 +352,14 @@ public class BrooklynMementoPersisterToObjectStore implements BrooklynMementoPer
     }
 
     // We must be able to cope with XML serialized with either a single "catalogItemId"
-    // or a list "catalogItemSuperIds" of catalog item ids. Only one should be encountered
+    // or a list "catalogItemHierarchy" of catalog item ids. Only one should be encountered
     // but in any case prefer the list of ids.
     private ImmutableList<String> getCatalogItemIds(XPathHelper x) {
         final MutableList<String> list = MutableList.of();
-        final List<String> catalogItemSuperIds = x.getStringList("catalogItemSuperIds");
+        final List<String> catalogItemHierarchy = x.getStringList("catalogItemHierarchy");
         final String catalogItemId = Strings.emptyToNull(x.get("catalogItemId"));
-        if (!catalogItemSuperIds.isEmpty()) {
-            list.addAll(catalogItemSuperIds);
+        if (!catalogItemHierarchy.isEmpty()) {
+            list.addAll(catalogItemHierarchy);
         } else if (catalogItemId != null) {
             list.add(catalogItemId);
         }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
index 3e75700..1f23330 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/RebindIteration.java
@@ -936,8 +936,8 @@ public abstract class RebindIteration {
             return entity;
         }
 
-        protected void setCatalogItemIds(BrooklynObject object, List<String> superIds)
{
-            ((BrooklynObjectInternal)object).setCatalogItemIds(superIds);
+        protected void setCatalogItemIds(BrooklynObject object, List<String> idHierarchy)
{
+            ((BrooklynObjectInternal)object).setCatalogItemIdHierarchy(idHierarchy);
         }
 
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
index 381c71b..5a68b6a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/AbstractMemento.java
@@ -47,9 +47,9 @@ public abstract class AbstractMemento implements Memento, Serializable {
         protected String type;
         protected Class<?> typeClass;
         protected String displayName;
-        // catalogItemId is retained to support rebind of previously persisted state (prior
to catalogItemSuperIds)
+        // catalogItemId is retained to support rebind of previously persisted state (prior
to catalogItemHierarchy)
         protected String catalogItemId;
-        protected List<String> catalogItemSuperIds = MutableList.of();
+        protected List<String> catalogItemHierarchy = MutableList.of();
         protected Map<String, Object> customFields = Maps.newLinkedHashMap();
         protected List<Object> tags = Lists.newArrayList();
         protected Map<String,Set<String>> relations = Maps.newLinkedHashMap();
@@ -68,7 +68,7 @@ public abstract class AbstractMemento implements Memento, Serializable {
             type = other.getType();
             typeClass = other.getTypeClass();
             displayName = other.getDisplayName();
-            setCatalogItemIds(other.getCatalogItemHierarchy(), other.getCatalogItemId());
+            setCatalogItemIdHierarchy(other.getCatalogItemHierarchy(), other.getCatalogItemId());
             customFields.putAll(other.getCustomFields());
             tags.addAll(other.getTags());
             relations.putAll(other.getRelations());
@@ -76,13 +76,13 @@ public abstract class AbstractMemento implements Memento, Serializable
{
             return self();
         }
 
-        private void setCatalogItemIds(List<String> otherItemSuperIds, String otherItemId)
{
-            if (isEmpty(otherItemSuperIds) && otherItemId == null) {
-                catalogItemSuperIds = MutableList.of();
-            } else if (isEmpty(otherItemSuperIds) && otherItemId != null) {
-                catalogItemSuperIds = MutableList.of(otherItemId);
+        private void setCatalogItemIdHierarchy(List<String> otherItemIdHierarchy, String
otherItemId) {
+            if (isEmpty(otherItemIdHierarchy) && otherItemId == null) {
+                catalogItemHierarchy = MutableList.of();
+            } else if (isEmpty(otherItemIdHierarchy) && otherItemId != null) {
+                catalogItemHierarchy = MutableList.of(otherItemId);
             } else {
-                catalogItemSuperIds = MutableList.copyOf(otherItemSuperIds);
+                catalogItemHierarchy = MutableList.copyOf(otherItemIdHierarchy);
             }
         }
 
@@ -103,9 +103,14 @@ public abstract class AbstractMemento implements Memento, Serializable
{
     private String type;
     private String id;
     private String displayName;
-    // catalogItemId is retained to support rebind of previously persisted state (prior to
catalogItemSuperIds)
+
+    @Deprecated
+    /**
+     @deprecated since 0.11.0; retained to support rebind of previously persisted state (prior
to catalogItemHierarchy)
+      */
     protected String catalogItemId;
-    private List<String> catalogItemSuperIds = MutableList.of();
+
+    private List<String> catalogItemHierarchy = MutableList.of();
     private List<Object> tags;
     private Map<String,Set<String>> relations;
     
@@ -125,7 +130,7 @@ public abstract class AbstractMemento implements Memento, Serializable
{
         type = builder.type;
         typeClass = builder.typeClass;
         displayName = builder.displayName;
-        catalogItemSuperIds = builder.catalogItemSuperIds;
+        catalogItemHierarchy = builder.catalogItemHierarchy;
         setCustomFields(builder.customFields);
         tags = toPersistedList(builder.tags);
         relations = toPersistedMap(builder.relations);
@@ -138,11 +143,11 @@ public abstract class AbstractMemento implements Memento, Serializable
{
 
     // deals with value created by deserialization of state persisted with <catalogItemId>
     private void normalizeCatalogItemIds() {
-        if (catalogItemSuperIds == null) {
-            catalogItemSuperIds = MutableList.of();
+        if (catalogItemHierarchy == null) {
+            catalogItemHierarchy = MutableList.of();
         }
-        if (catalogItemSuperIds.isEmpty() && catalogItemId != null) {
-            catalogItemSuperIds = MutableList.of(catalogItemId);
+        if (catalogItemHierarchy.isEmpty() && catalogItemId != null) {
+            catalogItemHierarchy = MutableList.of(catalogItemId);
             catalogItemId = null;
         }
     }
@@ -186,7 +191,7 @@ public abstract class AbstractMemento implements Memento, Serializable
{
     @Override
     public List<String> getCatalogItemHierarchy() {
         normalizeCatalogItemIds();
-        return catalogItemSuperIds;
+        return catalogItemHierarchy;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/EntityMementoManifestImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/EntityMementoManifestImpl.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/EntityMementoManifestImpl.java
index 5ed1076..28c2a7e 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/EntityMementoManifestImpl.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/EntityMementoManifestImpl.java
@@ -52,6 +52,10 @@ public class EntityMementoManifestImpl implements EntityMementoManifest
{
         return parentId;
     }
 
+    /**
+     * @deprecated since 0.11.0, use {@link #getCatalogItemHierarchy()} instead
+     */
+    @Deprecated
     @Override
     public String getCatalogItemId() {
         return Iterables.getFirst(catalogItemIds, null);

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
index 4a6ba9d..06f567c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/dto/MementosGenerators.java
@@ -451,7 +451,7 @@ public class MementosGenerators {
 
         builder.id = instance.getId();
         builder.displayName = instance.getDisplayName();
-        builder.catalogItemSuperIds = instance.getCatalogItemHierarchy();
+        builder.catalogItemHierarchy = instance.getCatalogItemHierarchy();
         builder.type = (typePrefix.isPresent() ? typePrefix.get() : "") + instance.getClass().getName();
         builder.typeClass = instance.getClass();
         if (instance instanceof EntityAdjunct) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/transformer/CompoundTransformer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/transformer/CompoundTransformer.java
b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/transformer/CompoundTransformer.java
index 9bc57f9..ece0cdf 100644
--- a/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/transformer/CompoundTransformer.java
+++ b/core/src/main/java/org/apache/brooklyn/core/mgmt/rebind/transformer/CompoundTransformer.java
@@ -182,12 +182,12 @@ public class CompoundTransformer {
          * old text matches oldSymbolicName and optionally oldVersion
          * to have newSymbolicName and newVersion.
          * <p>
-         * Also changes contents of elements within a list of 'catalogItemSuperIds' e.g.
+         * Also changes contents of elements within a list of 'catalogItemHierarchy' e.g.
          * <pre>
-         *     &lt;catalogItemSuperIds>
+         *     &lt;catalogItemHierarchy>
          *        &lt;string>one&lt;/string>
          *        &lt;string>two&lt;/string>
-         *     &lt;/catalogItemSuperIds>
+         *     &lt;/catalogItemHierarchy>
          * </pre>
          * </p>
          * This provides a programmatic way to change the catalogItemID. */
@@ -196,13 +196,13 @@ public class CompoundTransformer {
             if (oldVersion==null)
                 return changeCatalogItemId(oldSymbolicName, newSymbolicName, newVersion);
             // warnings use underscore notation because that's what CompoundTransformerLoader
uses
-            return xmlReplaceItem("*[self::catalogItemId|parent::catalogItemSuperIds]/text()[.='"+
+            return xmlReplaceItem("*[self::catalogItemId|parent::catalogItemHierarchy]/text()[.='"+
                 Preconditions.checkNotNull(oldSymbolicName, "old_symbolic_name")+":"+Preconditions.checkNotNull(oldVersion,
"old_version")+"']", 
                 Preconditions.checkNotNull(newSymbolicName, "new_symbolic_name")+":"+Preconditions.checkNotNull(newVersion,
"new_version"));
         }
         /** As {@link #changeCatalogItemId(String, String, String, String)} matching any
old version. */
         public Builder changeCatalogItemId(String oldSymbolicName, String newSymbolicName,
String newVersion) {
-            return xmlReplaceItem("*[self::catalogItemId|parent::catalogItemSuperIds]/text()[starts-with(.,'"+Preconditions.checkNotNull(oldSymbolicName,
"old_symbolic_name")+":')]",
+            return xmlReplaceItem("*[self::catalogItemId|parent::catalogItemHierarchy]/text()[starts-with(.,'"+Preconditions.checkNotNull(oldSymbolicName,
"old_symbolic_name")+":')]",
                 Preconditions.checkNotNull(newSymbolicName, "new_symbolic_name")+":"+Preconditions.checkNotNull(newVersion,
"new_version"));
         }
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/AbstractBrooklynObject.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractBrooklynObject.java
b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractBrooklynObject.java
index b067fe4..9ba131c 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractBrooklynObject.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractBrooklynObject.java
@@ -207,7 +207,7 @@ public abstract class AbstractBrooklynObject implements BrooklynObjectInternal
{
     }
 
     @Override
-    public void setCatalogItemIds(List<String> ids) {
+    public void setCatalogItemIdHierarchy(List<String> ids) {
         catalogItemIdStack.clear();
         catalogItemIdStack.addAll(ids);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
index 4b21963..260c210 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/AbstractEntityAdjunct.java
@@ -379,7 +379,7 @@ public abstract class AbstractEntityAdjunct extends AbstractBrooklynObject
imple
         this.entity = entity;
         this.execution = ((EntityInternal) entity).getExecutionContext();
         if (entity!=null && getCatalogItemId() == null) {
-            setCatalogItemIds(entity.getCatalogItemHierarchy());
+            setCatalogItemIdHierarchy(entity.getCatalogItemHierarchy());
         }
     }
     

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
b/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
index 4dcbf1a..4c05ed6 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/BrooklynObjectInternal.java
@@ -38,7 +38,7 @@ import com.google.common.annotations.Beta;
 public interface BrooklynObjectInternal extends BrooklynObject, Rebindable {
     
     void setCatalogItemId(String id);
-    void setCatalogItemIds(List<String> id);
+    void setCatalogItemIdHierarchy(List<String> id);
 
     void nestCatalogItemId(String id);
     

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
index cc1dd8c..a80d12a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalEntityFactory.java
@@ -247,7 +247,7 @@ public class InternalEntityFactory extends InternalFactory {
                 ((AbstractEntity)entity).setDisplayName(spec.getDisplayName());
             
             if (spec.getOuterCatalogItemId()!=null) {
-                ((AbstractEntity)entity).setCatalogItemIds(spec.getCatalogItemIdHierarchy());
+                ((AbstractEntity)entity).setCatalogItemIdHierarchy(spec.getCatalogItemIdHierarchy());
             }
             
             entity.tags().addTags(spec.getTags());

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
index 5a70257..de6a0bd 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalLocationFactory.java
@@ -118,7 +118,7 @@ public class InternalLocationFactory extends InternalFactory {
                 ((AbstractLocation)loc).setDisplayName(spec.getDisplayName());
             
             if (spec.getOuterCatalogItemId()!=null) {
-                ((AbstractLocation)loc).setCatalogItemIds(spec.getCatalogItemIdHierarchy());
+                ((AbstractLocation)loc).setCatalogItemIdHierarchy(spec.getCatalogItemIdHierarchy());
             }
             
             loc.tags().addTags(spec.getTags());

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalPolicyFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalPolicyFactory.java
b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalPolicyFactory.java
index 11c27ac..776cfef 100644
--- a/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalPolicyFactory.java
+++ b/core/src/main/java/org/apache/brooklyn/core/objs/proxy/InternalPolicyFactory.java
@@ -107,7 +107,7 @@ public class InternalPolicyFactory extends InternalFactory {
                 ((AbstractPolicy)pol).setDisplayName(spec.getDisplayName());
             }
             if (spec.getOuterCatalogItemId()!=null) {
-                ((AbstractPolicy)pol).setCatalogItemIds(spec.getCatalogItemIdHierarchy());
+                ((AbstractPolicy)pol).setCatalogItemIdHierarchy(spec.getCatalogItemIdHierarchy());
             }
             
             pol.tags().addTags(spec.getTags());
@@ -148,7 +148,7 @@ public class InternalPolicyFactory extends InternalFactory {
                 ((AbstractEnricher)enricher).setDisplayName(spec.getDisplayName());
             
             if (spec.getOuterCatalogItemId()!=null) {
-                ((AbstractEnricher)enricher).setCatalogItemIds(spec.getCatalogItemIdHierarchy());
+                ((AbstractEnricher)enricher).setCatalogItemIdHierarchy(spec.getCatalogItemIdHierarchy());
             }
             
             enricher.tags().addTags(spec.getTags());

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindConfigInheritanceTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindConfigInheritanceTest.java
b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindConfigInheritanceTest.java
index f48a53a..b340d2a 100644
--- a/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindConfigInheritanceTest.java
+++ b/core/src/test/java/org/apache/brooklyn/core/mgmt/rebind/RebindConfigInheritanceTest.java
@@ -117,7 +117,7 @@ public class RebindConfigInheritanceTest extends RebindTestFixtureWithApp
{
         checkNewAppNonInheritingKey1(rebindedApp);
         
         String origMementoTidied = origMemento.substring(origMemento.indexOf("<entity>"));
-        origMementoTidied = origMementoTidied.replaceFirst("</displayName>", "</displayName>\n
 <catalogItemSuperIds class=\"ImmutableList\"/>");
+        origMementoTidied = origMementoTidied.replaceFirst("</displayName>", "</displayName>\n
 <catalogItemHierarchy class=\"ImmutableList\"/>");
         origMementoTidied = Strings.replaceAllNonRegex(origMementoTidied, "VERSION", BrooklynVersion.get());
         Asserts.assertEquals(origMementoTidied, newMemento);
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/d3a64d98/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
index 21231aa..a9686d5 100644
--- a/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
+++ b/core/src/test/java/org/apache/brooklyn/util/core/ClassLoaderUtilsTest.java
@@ -325,7 +325,7 @@ public class ClassLoaderUtilsTest {
                 .plan("{\"services\":[{\"type\": \"" + clazz.getName() + "\"}]}")
                 .build();
         mgmt.getCatalog().addItem(item);
-        ((EntityInternal)entity).setCatalogItemIds(item.getCatalogItemHierarchy());
+        ((EntityInternal)entity).setCatalogItemIdHierarchy(item.getCatalogItemHierarchy());
         return entity;
     }
 


Mime
View raw message