brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [13/18] brooklyn-server git commit: expand REST API to include catalog info, and update REST API for cleaned up LocationSpec access
Date Fri, 18 Mar 2016 11:06:34 GMT
expand REST API to include catalog info, and update REST API for cleaned up LocationSpec access


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

Branch: refs/heads/master
Commit: b05185eb59dcd6ba2c4f4110ca9a4557f6b8ee0e
Parents: a3d7470
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Thu Mar 17 15:09:19 2016 +0000
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Thu Mar 17 18:09:41 2016 +0000

----------------------------------------------------------------------
 .../core/location/BasicLocationRegistry.java    | 20 ++++-
 .../core/location/CatalogLocationResolver.java  | 19 ++++-
 .../brooklyn/rest/domain/LocationSummary.java   | 15 +++-
 .../rest/domain/LocationSummaryTest.java        |  2 +-
 .../rest/resources/ApplicationResource.java     |  3 +-
 .../rest/transform/LocationTransformer.java     | 83 ++++++--------------
 .../rest/util/BrooklynRestResourceUtils.java    |  7 +-
 .../rest/domain/LocationSummaryTest.java        |  2 +-
 8 files changed, 77 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
index e117f73..3ab23df 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/BasicLocationRegistry.java
@@ -118,8 +118,20 @@ import com.google.common.collect.Sets;
  *     </ol>
  * </ol>
  * 
- * TODO There is no concept of a location version in this registry. The version
- * in the catalog is generally ignored.
+ * TODO we should change the registry to be a pass-through facade on top of the catalog,
+ * and shift to preferring catalog access mechanisms.
+ * this brings it in line with how we do other things;
+ * also this does not understand versions.
+ * to do this we will need to:
+ * <li> update the catalog on addition, setting a plan (ensuring serialization);
+ *      in case of a definition CHANGED in brooklyn.properties give an error if it means
the plan has changed
+ *      (user could then remove from brooklyn.properties, if persistence on, or apply the
update in the catalog;
+ *      ie similar semantics to defining an initial catalog via the CLI)
+ * <li> find and return the RegisteredType from the type-registry/catalog here
+ * <p>
+ * Once done, update the UI use /v1/catalog/locations instead of /v1/locations
+ * (currently the latter is the only way to list locations known in the LocationRegistry

+ * ie those from brookln.properties.)
  */
 @SuppressWarnings({"rawtypes","unchecked"})
 public class BasicLocationRegistry implements LocationRegistry {
@@ -218,7 +230,7 @@ public class BasicLocationRegistry implements LocationRegistry {
     public void updateDefinedLocation(CatalogItem<Location, LocationSpec<?>>
item) {
         String id = item.getCatalogItemId();
         String symbolicName = item.getSymbolicName();
-        String spec = CatalogLocationResolver.NAME + ":" + id;
+        String spec = CatalogLocationResolver.createLegacyWrappedReference(id);
         Map<String, Object> config = ImmutableMap.<String, Object>of();
         BasicLocationDefinition locDefinition = new BasicLocationDefinition(symbolicName,
symbolicName, spec, config);
         
@@ -233,7 +245,7 @@ public class BasicLocationRegistry implements LocationRegistry {
     public void updateDefinedLocation(RegisteredType item) {
         String id = item.getId();
         String symbolicName = item.getSymbolicName();
-        String spec = CatalogLocationResolver.NAME + ":" + id;
+        String spec = CatalogLocationResolver.createLegacyWrappedReference(id);
         Map<String, Object> config = ImmutableMap.<String, Object>of();
         BasicLocationDefinition locDefinition = new BasicLocationDefinition(symbolicName,
symbolicName, spec, config);
         

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/core/src/main/java/org/apache/brooklyn/core/location/CatalogLocationResolver.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/location/CatalogLocationResolver.java
b/core/src/main/java/org/apache/brooklyn/core/location/CatalogLocationResolver.java
index a218a66..5a06c53 100644
--- a/core/src/main/java/org/apache/brooklyn/core/location/CatalogLocationResolver.java
+++ b/core/src/main/java/org/apache/brooklyn/core/location/CatalogLocationResolver.java
@@ -28,9 +28,12 @@ import org.apache.brooklyn.api.location.LocationResolver;
 import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
 import org.apache.brooklyn.api.typereg.RegisteredType;
+import org.apache.brooklyn.util.text.Strings;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.annotations.Beta;
+
 /**
  * Given a location spec in the form {@code brooklyn.catalog:<symbolicName>:<version>},

  * looks up the catalog to get its definition and creates such a location.
@@ -74,7 +77,7 @@ public class CatalogLocationResolver implements LocationResolver {
     }
     
     /**
-     * accepts anything that looks like it will be a YAML catalog item (e.g. starting "brooklyn.locations")
+     * accepts anything that looks like it will be a YAML catalog item (e.g. starting "brooklyn.catalog:")
      */
     @Override
     public boolean accepts(String spec, LocationRegistry registry) {
@@ -83,4 +86,18 @@ public class CatalogLocationResolver implements LocationResolver {
         return false;
     }
 
+    @Beta /** for transitioning away from LocationDefinition */
+    public static boolean isLegacyWrappedReference(String spec) {
+        if (spec==null) return false;
+        if (spec.startsWith(NAME+":")) return true;
+        return false;
+    }
+    @Beta /** for transitioning away from LocationDefinition */
+    public static String createLegacyWrappedReference(String id) {
+        return NAME + ":" + id;
+    }
+    @Beta /** for transitioning away from LocationDefinition */
+    public static String unwrapLegacyWrappedReference(String id) {
+        return Strings.removeFromStart(id, NAME+":");
+    }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationSummary.java
index 4cad32b..4bda019 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationSummary.java
@@ -30,6 +30,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.collect.ImmutableMap;
 
+@SuppressWarnings("deprecation") 
+// parent will be removed but this will be kept, just for reporting Location instances
+// CatalogLocationSummary should be used for items in the catalog
 public class LocationSummary extends LocationSpec implements HasName, HasId {
 
     private static final long serialVersionUID = -4559153719273573670L;
@@ -39,6 +42,8 @@ public class LocationSummary extends LocationSpec implements HasName, HasId
{
     /** only intended for instantiated Locations, not definitions */
     @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
     private final String type;
+    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    private final CatalogLocationSummary catalog;
     private final Map<String, URI> links;
 
     public LocationSummary(
@@ -47,10 +52,12 @@ public class LocationSummary extends LocationSpec implements HasName,
HasId {
             @JsonProperty("spec") String spec,
             @JsonProperty("type") String type,
             @JsonProperty("config") @Nullable Map<String, ?> config,
+            @JsonProperty("catalog") @Nullable CatalogLocationSummary catalog,
             @JsonProperty("links") Map<String, URI> links) {
         super(name, spec, config);
         this.id = checkNotNull(id);
         this.type = type;
+        this.catalog = catalog;
         this.links = (links == null) ? ImmutableMap.<String, URI> of() : ImmutableMap.copyOf(links);
     }
 
@@ -63,6 +70,10 @@ public class LocationSummary extends LocationSpec implements HasName, HasId
{
         return type;
     }
 
+    public CatalogLocationSummary getCatalog() {
+        return catalog;
+    }
+    
     public Map<String, URI> getLinks() {
         return links;
     }
@@ -75,12 +86,13 @@ public class LocationSummary extends LocationSpec implements HasName,
HasId {
         LocationSummary that = (LocationSummary) o;
         return Objects.equals(id, that.id) &&
                 Objects.equals(type, that.type) &&
+                Objects.equals(catalog, that.catalog) &&
                 Objects.equals(links, that.links);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(super.hashCode(), id, type, links);
+        return Objects.hash(super.hashCode(), id, type, catalog, links);
     }
 
     @Override
@@ -88,6 +100,7 @@ public class LocationSummary extends LocationSpec implements HasName, HasId
{
         return "LocationSummary{" +
                 "id='" + id + '\'' +
                 ", type='" + type + '\'' +
+                ", catalog='" + catalog + '\'' +
                 ", links=" + links +
                 '}';
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-api/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
b/rest/rest-api/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
index 8d40e75..1055310 100644
--- a/rest/rest-api/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
+++ b/rest/rest-api/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
@@ -35,7 +35,7 @@ public class LocationSummaryTest extends AbstractDomainTest {
         Map<String, URI> links = Maps.newLinkedHashMap();
         links.put("self", URI.create("/locations/123"));
 
-        return new LocationSummary("123", "localhost", "localhost", null, null, links);
+        return new LocationSummary("123", "localhost", "localhost", null, null, null, links);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
index 5fdbc95..48ffa9a 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/ApplicationResource.java
@@ -228,8 +228,7 @@ public class ApplicationResource extends AbstractBrooklynRestResource
implements
 
         checkApplicationTypesAreValid(applicationSpec);
         checkLocationsAreValid(applicationSpec);
-        // TODO duplicate prevention
-        List<Location> locations = brooklyn().getLocations(applicationSpec);
+        List<Location> locations = brooklyn().getLocationsManaged(applicationSpec);
         Application app = brooklyn().create(applicationSpec);
         Task<?> t = brooklyn().start(app, locations);
         waitForStart(app, Duration.millis(100));

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java
index ad85ce2..b80ee60 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/LocationTransformer.java
@@ -25,16 +25,21 @@ import java.util.Map;
 
 import javax.ws.rs.core.UriBuilder;
 
+import org.apache.brooklyn.api.catalog.CatalogItem;
 import org.apache.brooklyn.api.location.Location;
 import org.apache.brooklyn.api.location.LocationDefinition;
 import org.apache.brooklyn.api.location.LocationSpec;
 import org.apache.brooklyn.api.mgmt.ManagementContext;
+import org.apache.brooklyn.core.catalog.internal.CatalogUtils;
 import org.apache.brooklyn.core.config.Sanitizer;
 import org.apache.brooklyn.core.location.BasicLocationDefinition;
+import org.apache.brooklyn.core.location.CatalogLocationResolver;
 import org.apache.brooklyn.core.location.LocationConfigKeys;
 import org.apache.brooklyn.core.location.internal.LocationInternal;
 import org.apache.brooklyn.rest.api.LocationApi;
+import org.apache.brooklyn.rest.domain.CatalogLocationSummary;
 import org.apache.brooklyn.rest.domain.LocationSummary;
+import org.apache.brooklyn.rest.util.BrooklynRestResourceUtils;
 import org.apache.brooklyn.rest.util.WebResourceUtils;
 import org.apache.brooklyn.util.collections.MutableMap;
 import org.apache.brooklyn.util.core.config.ConfigBag;
@@ -57,6 +62,7 @@ public class LocationTransformer {
         return newInstance(null, id, locationSpec, LocationDetailLevel.LOCAL_EXCLUDING_SECRET,
ub);
     }
     
+    @SuppressWarnings("unchecked")
     private static LocationSummary newInstance(ManagementContext mgmt, 
             LocationSpec<? extends Location> spec, ConfigBag explicitConfig, 
             String optionalExplicitId, String name, String specString, 
@@ -75,51 +81,32 @@ public class LocationTransformer {
 
         String id = Strings.isNonBlank(optionalExplicitId) ? optionalExplicitId : spec!=null
&& Strings.isNonBlank(spec.getCatalogItemId()) ? spec.getCatalogItemId() : null;
         URI selfUri = serviceUriBuilder(ub, LocationApi.class, "get").build(id);
+        
+        CatalogLocationSummary catalogSummary = null;
+        if (CatalogLocationResolver.isLegacyWrappedReference(specString)) {
+//            RegisteredType type = mgmt.getTypeRegistry().get(CatalogLocationResolver.unwrapLegacyWrappedReference(specString));
+            // TODO REST items should switch to using the RegisteredType
+            @SuppressWarnings({ "rawtypes", "deprecation" })
+            CatalogItem ci = CatalogUtils.getCatalogItemOptionalVersion(mgmt, CatalogLocationResolver.unwrapLegacyWrappedReference(specString));
+            if (ci!=null) {
+                BrooklynRestResourceUtils br = new BrooklynRestResourceUtils(mgmt);
+                catalogSummary = CatalogTransformer.catalogLocationSummary(br, ci, ub);
+            }
+        }
         return new LocationSummary(
                 id,
                 Strings.isNonBlank(name) ? name : spec!=null ? spec.getDisplayName() : null,
                 Strings.isNonBlank(specString) ? specString : spec!=null ? spec.getCatalogItemId()
: null,
                 null,
                 copyConfig(config, level),
+                catalogSummary,
                 ImmutableMap.of("self", selfUri));
     }
     
-    // XXX big commented out swathes should be removed when this is confirmed working
-    
     @SuppressWarnings("deprecation") 
     public static LocationSummary newInstance(ManagementContext mgmt, String id, org.apache.brooklyn.rest.domain.LocationSpec
locationSpec, LocationDetailLevel level, UriBuilder ub) {
         LocationDefinition ld = new BasicLocationDefinition(id, locationSpec.getName(), locationSpec.getSpec(),
locationSpec.getConfig());
         return newInstance(mgmt, ld, level, ub);
-//        
-//        Map<String, ?> config = locationSpec.getConfig();
-//        if (mgmt != null && (level==LocationDetailLevel.FULL_EXCLUDING_SECRET ||
level==LocationDetailLevel.FULL_INCLUDING_SECRET)) {
-//            
-//            Location ll = mgmt.getLocationRegistry().resolve(ld, false, null).orNull();
-//            if (ll!=null) config = ((LocationInternal)ll).config().getBag().getAllConfig();
-//        } else if (level==LocationDetailLevel.LOCAL_EXCLUDING_SECRET) {
-//            // get displayName
-//            if (!config.containsKey(LocationConfigKeys.DISPLAY_NAME.getName()) &&
mgmt!=null) {
-//                LocationDefinition ld = new BasicLocationDefinition(id, locationSpec.getName(),
locationSpec.getSpec(), locationSpec.getConfig());
-//                Location ll = mgmt.getLocationRegistry().resolve(ld, false, null).orNull();
-//                if (ll!=null) {
-//                    Map<String, Object> configExtra = ((LocationInternal)ll).config().getBag().getAllConfig();
-//                    if (configExtra.containsKey(LocationConfigKeys.DISPLAY_NAME.getName()))
{
-//                        ConfigBag configNew = ConfigBag.newInstance(config);
-//                        configNew.configure(LocationConfigKeys.DISPLAY_NAME, (String)configExtra.get(LocationConfigKeys.DISPLAY_NAME.getName()));
-//                        config = configNew.getAllConfig();
-//                    }
-//                }
-//            }
-//        }
-//
-//        URI selfUri = serviceUriBuilder(ub, LocationApi.class, "get").build(id);
-//        return new LocationSummary(
-//                id,
-//                locationSpec.getName(),
-//                locationSpec.getSpec(),
-//                null,
-//                copyConfig(config, level),
-//                ImmutableMap.of("self", selfUri));
     }
 
     /** @deprecated since 0.7.0 use method taking management context and detail specifier
*/
@@ -131,33 +118,6 @@ public class LocationTransformer {
     public static LocationSummary newInstance(ManagementContext mgmt, LocationDefinition
ld, LocationDetailLevel level, UriBuilder ub) {
         return newInstance(mgmt, mgmt.getLocationRegistry().getLocationSpec(ld).orNull(),
ConfigBag.newInstance(ld.getConfig()),
             ld.getId(), ld.getName(), ld.getSpec(), level, ub);
-//        Map<String, Object> config = ld.getConfig();
-//        
-//        if (mgmt != null && (level==LocationDetailLevel.FULL_EXCLUDING_SECRET ||
level==LocationDetailLevel.FULL_INCLUDING_SECRET)) {
-//            if (ll.isPresent()) config = ConfigBag.newInstance(ll.get().getConfig()).getAllConfig();
-//        } else if (level==LocationDetailLevel.LOCAL_EXCLUDING_SECRET) {
-//            // get any displayName
-//            if (mgmt != null && !config.containsKey(LocationConfigKeys.DISPLAY_NAME.getName()))
{
-//                Maybe<LocationSpec<?>> ll = mgmt.getLocationRegistry().getLocationSpec(ld);
-//                if (ll.isPresent()) {
-//                    ConfigBag configNew = ConfigBag.newInstance(ll.get().getConfig());
-//                    // XXX useless? 
-//                    if (configNew.containsKey(LocationConfigKeys.DISPLAY_NAME.getName()))
{
-//                        configNew.configure(LocationConfigKeys.DISPLAY_NAME, (String)configNew.get(LocationConfigKeys.DISPLAY_NAME));
-//                        config = configNew.getAllConfig();
-//                    }
-//                }
-//            }
-//        }
-//
-//        URI selfUri = serviceUriBuilder(ub, LocationApi.class, "get").build(ld.getId());
-//        return new LocationSummary(
-//                ld.getId(),
-//                ld.getName(),
-//                ld.getSpec(),
-//                null,
-//                copyConfig(config, level),
-//                ImmutableMap.of("self", selfUri));
     }
 
     private static Map<String, ?> copyConfig(Map<String,?> entries, LocationDetailLevel
level) {
@@ -173,6 +133,7 @@ public class LocationTransformer {
     }
 
     private static boolean LEGACY_SPEC_WARNING = false;
+    // used when user is looking up a location instance by ID, or listing an entity's locations
     public static LocationSummary newInstance(ManagementContext mgmt, Location l, LocationDetailLevel
level, UriBuilder ub) {
         String spec = null;
         String specId = null;
@@ -201,11 +162,12 @@ public class LocationTransformer {
         }
         if (specId==null && spec!=null) {
             // fall back to attempting to lookup it
-            // TODO remove this block unless we get this warning
+            // TODO remove this section unless we get this warning
             if (LEGACY_SPEC_WARNING==false) {
                 log.warn("Legacy spec lookup required for rest summary of "+l);
                 LEGACY_SPEC_WARNING = true;
             }
+            @SuppressWarnings("deprecation")
             Location ll = mgmt.getLocationRegistry().resolve(spec, false, null).orNull();
             if (ll!=null) specId = ll.getId();
         }
@@ -235,6 +197,7 @@ public class LocationTransformer {
             spec,
             l.getClass().getName(),
             config,
+            null,
             MutableMap.of("self", selfUri)
                 .addIfNotNull("parent", parentUri)
                 .addIfNotNull("spec", specUri)

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/BrooklynRestResourceUtils.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/BrooklynRestResourceUtils.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/BrooklynRestResourceUtils.java
index f552ded..6645c5c 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/BrooklynRestResourceUtils.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/util/BrooklynRestResourceUtils.java
@@ -259,7 +259,7 @@ public class BrooklynRestResourceUtils {
         private RegisteredType getCatalogItemForType(String typeName) {
             final RegisteredType resultI;
             if (CatalogUtils.looksLikeVersionedId(typeName)) {
-                //All catalog identifiers of the form xxxx:yyyy are composed of symbolicName+version.
+                //All catalog identifiers of the form aaaa:bbbb are composed of symbolicName+version.
                 //No javaType is allowed as part of the identifier.
                 resultI = mgmt.getTypeRegistry().get(typeName);
             } else {
@@ -389,7 +389,7 @@ public class BrooklynRestResourceUtils {
     }
     
     public Task<?> start(Application app, ApplicationSpec spec) {
-        return start(app, getLocations(spec));
+        return start(app, getLocationsManaged(spec));
     }
 
     public Task<?> start(Application app, List<? extends Location> locations)
{
@@ -397,13 +397,12 @@ public class BrooklynRestResourceUtils {
                 MutableMap.of("locations", locations));
     }
 
-    public List<Location> getLocations(ApplicationSpec spec) {
+    public List<Location> getLocationsManaged(ApplicationSpec spec) {
         // Start all the managed entities by asking the app instance to start in background
         Function<String, Location> buildLocationFromId = new Function<String, Location>()
{
             @Override
             public Location apply(String id) {
                 id = fixLocation(id);
-                // XXX
                 return getLocationRegistry().getLocationManaged(id);
             }
         };

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/b05185eb/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
index 6279546..0f81b48 100644
--- a/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
+++ b/rest/rest-server-jersey/src/test/java/org/apache/brooklyn/rest/domain/LocationSummaryTest.java
@@ -35,7 +35,7 @@ public class LocationSummaryTest extends AbstractDomainTest {
         Map<String, URI> links = Maps.newLinkedHashMap();
         links.put("self", URI.create("/v1/locations/123"));
 
-        return new LocationSummary("123", "localhost", "localhost", null, null, links);
+        return new LocationSummary("123", "localhost", "localhost", null, null, null, links);
     }
 
 }


Mime
View raw message