You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2017/09/25 09:29:41 UTC

[10/11] brooklyn-server git commit: address PR comments, mainly simplify ConfigSummary

address PR comments, mainly simplify ConfigSummary


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

Branch: refs/heads/master
Commit: 54fb9c6a6f0ce07939df1ae417b4add17c9a786a
Parents: 8e69330
Author: Alex Heneveld <al...@cloudsoftcorp.com>
Authored: Mon Sep 25 10:00:01 2017 +0100
Committer: Alex Heneveld <al...@cloudsoftcorp.com>
Committed: Mon Sep 25 10:00:01 2017 +0100

----------------------------------------------------------------------
 .../core/typereg/RegisteredTypePredicates.java  | 78 ++++++++++++++----
 .../rest/domain/AdjunctConfigSummary.java       | 85 --------------------
 .../brooklyn/rest/domain/ConfigSummary.java     | 66 +++++++++++----
 .../rest/domain/EnricherConfigSummary.java      | 12 +--
 .../rest/domain/EntityConfigSummary.java        | 67 +--------------
 .../rest/domain/LocationConfigSummary.java      | 40 ++-------
 .../rest/domain/PolicyConfigSummary.java        | 30 +++++--
 .../rest/transform/EntityTransformer.java       | 11 +--
 .../rest/transform/PolicyTransformer.java       |  3 +-
 .../rest/transform/TypeTransformer.java         |  6 +-
 10 files changed, 159 insertions(+), 239 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/core/src/main/java/org/apache/brooklyn/core/typereg/RegisteredTypePredicates.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/typereg/RegisteredTypePredicates.java b/core/src/main/java/org/apache/brooklyn/core/typereg/RegisteredTypePredicates.java
index f0189e2..e6705ef 100644
--- a/core/src/main/java/org/apache/brooklyn/core/typereg/RegisteredTypePredicates.java
+++ b/core/src/main/java/org/apache/brooklyn/core/typereg/RegisteredTypePredicates.java
@@ -20,6 +20,8 @@ package org.apache.brooklyn.core.typereg;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import java.util.Set;
+
 import javax.annotation.Nullable;
 
 import org.apache.brooklyn.api.entity.Application;
@@ -220,40 +222,82 @@ public class RegisteredTypePredicates {
     }
 
     public static <T> Predicate<RegisteredType> anySuperType(final Predicate<Object> filter) {
-        return new AnySuperTypeMatches(filter);
+        return new AnySuperTypeSatisfies(filter);
+    }
+    /** True for any {@link RegisteredType} which has a type ancestor (or self)
+     * registered type which is equal to the given {@link RegisteredType} */
+    public static Predicate<RegisteredType> subtypeOf(final RegisteredType filter) {
+        return anySuperType(Predicates.equalTo(filter));
     }
+    /** True for any {@link RegisteredType} which has a type ancestor
+     * class which is equal to or a subtype of the given class */
     public static Predicate<RegisteredType> subtypeOf(final Class<?> filter) {
         // the assignableFrom predicate checks if this class is assignable from the subsequent *input*.
         // in other words, we're checking if any input is a subtype of this class
-        return anySuperType(new Predicate<Object>() {
-            @Override
-            public boolean apply(Object input) {
-                if (!(input instanceof Class)) return false;
-                return filter.isAssignableFrom((Class<?>)input);
-            }
-        });
+        return anySuperType(new IsSubtypeOfClass(filter));
     }
+    private static class IsSubtypeOfClass implements Predicate<Object> {
+        private Class<?> filter;
+        public IsSubtypeOfClass(Class<?> filter) {
+            this.filter = filter;
+        }
+        @Override
+        public boolean apply(Object input) {
+            if (!(input instanceof Class)) return false;
+            return filter.isAssignableFrom((Class<?>)input);
+        }
+    }
+    /** True for any {@link RegisteredType} which has a type ancestor (or self)
+     * whose registered type name or ID equals the string, or class name equals the string */
     public static Predicate<RegisteredType> subtypeOf(final String filter) {
-        // the assignableFrom predicate checks if this class is assignable from the subsequent *input*.
-        // in other words, we're checking if any input is a subtype of this class
-        return anySuperType(new Predicate<Object>() {
-            @Override
-            public boolean apply(Object input) {
-                if (input instanceof Class) input = ((Class<?>)input).getName();
-                return filter.equals(input);
+        return anySuperType(new EqualsClassOrTypeName(filter));
+    }
+    private static class EqualsClassOrTypeName implements Predicate<Object> {
+        private String filter;
+        public EqualsClassOrTypeName(String typeOrClassOrName) {
+            this.filter = typeOrClassOrName;
+        }
+        @Override
+        public boolean apply(Object input) {
+            if (input instanceof RegisteredType) {
+                return ((RegisteredType)input).getSymbolicName().equals(filter) || ((RegisteredType)input).getSymbolicName().equals(filter);
             }
-        });
+            if (input instanceof Class) input = ((Class<?>)input).getName();
+            return filter.equals(input);
+        }
     }
     
+    /** @deprecated since 0.13.0 use {@link AnySuperTypeSatisfies}, kept for persistence compatibility */
+    @SuppressWarnings("unused")
+    @Deprecated
     private static class AnySuperTypeMatches implements Predicate<RegisteredType> {
+        private final Predicate<Class<?>> filter;
+        
+        private AnySuperTypeMatches(Predicate<Class<?>> filter) {
+            this.filter = filter;
+        }
+        @Override
+        public boolean apply(@Nullable RegisteredType item) {
+            if (item==null) return false;
+            
+            Set<Object> candidateTypes = item.getSuperTypes();
+            for (Object st: candidateTypes) {
+                if (st instanceof Class && filter.apply((Class<?>)st)) return true;
+            }
+            return false;
+        }
+    }
+    
+    private static class AnySuperTypeSatisfies implements Predicate<RegisteredType> {
         private final Predicate<Object> filter;
         
-        private AnySuperTypeMatches(Predicate<Object> filter) {
+        private AnySuperTypeSatisfies(Predicate<Object> filter) {
             this.filter = filter;
         }
         @Override
         public boolean apply(@Nullable RegisteredType item) {
             if (item==null) return false;
+            if (filter.apply(item)) return true;
             return RegisteredTypes.isAnyTypeOrSuper(item.getSuperTypes(), filter);
         }
     }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctConfigSummary.java
deleted file mode 100644
index 4bba4b2..0000000
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctConfigSummary.java
+++ /dev/null
@@ -1,85 +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 org.apache.brooklyn.rest.domain;
-
-import java.net.URI;
-import java.util.Map;
-import java.util.Objects;
-
-import org.apache.brooklyn.config.ConfigKey;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.google.common.collect.ImmutableMap;
-
-public class AdjunctConfigSummary extends ConfigSummary {
-
-    private static final long serialVersionUID = 4339330833863794513L;
-
-    @JsonInclude(Include.NON_NULL)
-    private final Map<String, URI> links;
-
-    // json deserialization
-    AdjunctConfigSummary() {
-        links = null;
-    }
-
-    public AdjunctConfigSummary(
-            @JsonProperty("name") String name,
-            @JsonProperty("type") String type,
-            @JsonProperty("description") String description,
-            @JsonProperty("defaultValue") Object defaultValue,
-            @JsonProperty("reconfigurable") boolean reconfigurable,
-            @JsonProperty("links") Map<String, URI> links) {
-        super(name, type, description, defaultValue, reconfigurable, null, null, null);
-        this.links = (links == null) ? ImmutableMap.<String, URI>of() : ImmutableMap.copyOf(links);
-    }
-
-    public AdjunctConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
-        super(config, label, priority);
-        this.links = links != null ? ImmutableMap.copyOf(links) : null;
-    }
-
-    @Override
-    public Map<String, URI> getLinks() {
-        return links;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (!(o instanceof AdjunctConfigSummary)) return false;
-        if (!super.equals(o)) return false;
-        AdjunctConfigSummary that = (AdjunctConfigSummary) o;
-        return Objects.equals(links, that.links);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(super.hashCode(), links);
-    }
-
-    @Override
-    public String toString() {
-        return "EnricherConfigSummary{" +
-                "links=" + links +
-                '}';
-    }
-}

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java
index 6d9ceb3..77bf5fd 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ConfigSummary.java
@@ -29,16 +29,19 @@ import javax.annotation.Nullable;
 
 import org.apache.brooklyn.config.ConfigKey;
 import org.apache.brooklyn.util.collections.Jsonya;
+import org.apache.brooklyn.util.text.StringPredicates;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonInclude.Include;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.base.Function;
+import com.google.common.base.Predicates;
 import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableMap;
 
-public abstract class ConfigSummary implements HasName, Serializable {
+public class ConfigSummary implements HasName, Serializable {
 
     private static final long serialVersionUID = -2831796487073496730L;
 
@@ -54,12 +57,19 @@ public abstract class ConfigSummary implements HasName, Serializable {
     private final String label;
     @JsonInclude(Include.NON_NULL)
     private final Double priority;
-    @JsonInclude(Include.NON_NULL)
+    @JsonInclude(Include.NON_EMPTY)
     private final List<Map<String, String>> possibleValues;
+    @JsonInclude(Include.NON_NULL)
+    private final Boolean pinned;
+    @JsonInclude(Include.NON_EMPTY)
+    private final List<String> constraints;
+
+    @JsonInclude(Include.NON_EMPTY)
+    private final Map<String, URI> links;
 
     // json deserialization
     ConfigSummary() {
-        this(null, null, null, null, false, null, null, null);
+        this(null, null, null, null, false, null, null, null, null, null, null);
     }
     
     protected ConfigSummary(
@@ -70,7 +80,10 @@ public abstract class ConfigSummary implements HasName, Serializable {
             @JsonProperty("reconfigurable") boolean reconfigurable,
             @JsonProperty("label") String label,
             @JsonProperty("priority") Double priority,
-            @JsonProperty("possibleValues") List<Map<String, String>> possibleValues) {
+            @JsonProperty("possibleValues") List<Map<String, String>> possibleValues,
+            @JsonProperty("pinned") Boolean pinned,
+            @JsonProperty("constraints") List<String> constraints,
+            @JsonProperty("links") Map<String, URI> links) {
         this.name = name;
         this.type = type;
         this.description = description;
@@ -79,14 +92,12 @@ public abstract class ConfigSummary implements HasName, Serializable {
         this.label = label;
         this.priority = priority;
         this.possibleValues = possibleValues;
+        this.pinned = pinned;
+        this.constraints = (constraints == null) ? ImmutableList.<String>of() : ImmutableList.copyOf(constraints);
+        this.links = (links == null) ? ImmutableMap.<String, URI>of() : ImmutableMap.copyOf(links);
     }
 
-    protected ConfigSummary(ConfigKey<?> config) {
-        this(config, null, null);
-    }
-
-    @SuppressWarnings("rawtypes")
-    protected ConfigSummary(ConfigKey<?> config, String label, Double priority) {
+    public ConfigSummary(ConfigKey<?> config, String label, Double priority, Boolean pinned, Map<String, URI> links) {
         this.name = config.getName();
         this.description = config.getDescription();
         this.reconfigurable = config.isReconfigurable();
@@ -97,15 +108,19 @@ public abstract class ConfigSummary implements HasName, Serializable {
          */
         this.label = label;
         this.priority = priority;
+        this.pinned = pinned;
+        this.constraints = !config.getConstraint().equals(Predicates.alwaysTrue())
+                ? ImmutableList.of((config.getConstraint().getClass().equals(StringPredicates.isNonBlank().getClass()) ? "required" : config.getConstraint().toString()))
+                : ImmutableList.<String>of();
         if (config.getType().isEnum()) {
             this.type = Enum.class.getName();
-            this.defaultValue = (config.getDefaultValue() == null) ? null : ((Enum) config.getDefaultValue()).name();
+            this.defaultValue = (config.getDefaultValue() == null) ? null : ((Enum<?>) config.getDefaultValue()).name();
             this.possibleValues = FluentIterable
-                    .from(Arrays.asList((Enum[])(config.getType().getEnumConstants())))
-                    .transform(new Function<Enum, Map<String, String>>() {
+                    .from(Arrays.asList((Enum<?>[])(config.getType().getEnumConstants())))
+                    .transform(new Function<Enum<?>, Map<String, String>>() {
                         @Nullable
                         @Override
-                        public Map<String, String> apply(@Nullable Enum input) {
+                        public Map<String, String> apply(@Nullable Enum<?> input) {
                             return ImmutableMap.of(
                                     "value", input != null ? input.name() : null,
                                    "description", input != null ? input.toString() : null);
@@ -116,6 +131,7 @@ public abstract class ConfigSummary implements HasName, Serializable {
             this.defaultValue = Jsonya.convertToJsonPrimitive(config.getDefaultValue());
             this.possibleValues = null;
         }
+        this.links = (links == null) ? ImmutableMap.<String, URI>of() : ImmutableMap.copyOf(links);
     }
 
     @Override
@@ -152,7 +168,17 @@ public abstract class ConfigSummary implements HasName, Serializable {
         return possibleValues;
     }
 
-    public abstract Map<String, URI> getLinks();
+    public Boolean isPinned() {
+        return pinned;
+    }
+
+    public List<String> getConstraints() {
+        return constraints;
+    }
+
+    public Map<String, URI> getLinks() {
+        return links;
+    }
 
     @Override
     public boolean equals(Object o) {
@@ -166,12 +192,16 @@ public abstract class ConfigSummary implements HasName, Serializable {
                 Objects.equals(description, that.description) &&
                 Objects.equals(label, that.label) &&
                 Objects.equals(priority, that.priority) &&
-                Objects.equals(possibleValues, that.possibleValues);
+                Objects.equals(possibleValues, that.possibleValues) &&
+                Objects.equals(pinned, that.pinned) &&
+                Objects.equals(constraints, that.constraints) &&
+                Objects.equals(links, that.links);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(name, type, defaultValue, description, reconfigurable, label, priority, possibleValues);
+        return Objects.hash(name, type, defaultValue, description, reconfigurable, label, priority, 
+            possibleValues, pinned, constraints);
     }
 
     @Override
@@ -185,6 +215,8 @@ public abstract class ConfigSummary implements HasName, Serializable {
                 ", label='" + label + '\'' +
                 ", priority=" + priority +
                 ", possibleValues=" + possibleValues +
+                ", pinned=" + pinned +
+                ", constraints=" + constraints +
                 '}';
     }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EnricherConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EnricherConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EnricherConfigSummary.java
index c868fb8..de8e4d3 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EnricherConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EnricherConfigSummary.java
@@ -23,8 +23,9 @@ import java.util.Map;
 
 import org.apache.brooklyn.config.ConfigKey;
 
-// TODO remove? this class has no value over its super
-public class EnricherConfigSummary extends AdjunctConfigSummary {
+/** @deprecated since 0.13.0 no different to ConfigSummary, use that */
+@Deprecated
+public class EnricherConfigSummary extends ConfigSummary {
 
     private static final long serialVersionUID = 4339330833863794513L;
 
@@ -32,12 +33,7 @@ public class EnricherConfigSummary extends AdjunctConfigSummary {
     private EnricherConfigSummary() {}
     
     public EnricherConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
-        super(config, label, priority, links);
-    }
-
-    public EnricherConfigSummary(String name, String type, String description, Object defaultValue, boolean reconfigurable,
-        Map<String, URI> links) {
-        super(name, type, description, defaultValue, reconfigurable, links);
+        super(config, label, priority, null, links);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
index aeba294..131ae65 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityConfigSummary.java
@@ -21,30 +21,17 @@ package org.apache.brooklyn.rest.domain;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 
 import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.util.text.StringPredicates;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.base.Predicates;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
 
+/** @deprecated since 0.13.0 no different to {@link ConfigSummary}, use that */
+@Deprecated
 public class EntityConfigSummary extends ConfigSummary {
 
     private static final long serialVersionUID = -1336134336883426030L;
 
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    private final Boolean pinned;
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    private final List<String> constraints;
-
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    private final Map<String, URI> links;
-
     public EntityConfigSummary(
             @JsonProperty("name") String name,
             @JsonProperty("type") String type,
@@ -57,57 +44,11 @@ public class EntityConfigSummary extends ConfigSummary {
             @JsonProperty("pinned") Boolean pinned,
             @JsonProperty("constraints") List<String> constraints,
             @JsonProperty("links") Map<String, URI> links) {
-        super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues);
-        this.pinned = pinned;
-        this.constraints = (constraints == null) ? ImmutableList.<String>of() : ImmutableList.copyOf(constraints);
-        this.links = (links == null) ? ImmutableMap.<String, URI>of() : ImmutableMap.copyOf(links);
+        super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues, pinned, constraints, links);
     }
 
     public EntityConfigSummary(ConfigKey<?> config, String label, Double priority, Boolean pinned, Map<String, URI> links) {
-        super(config, label, priority);
-        this.pinned = pinned;
-        this.constraints = !config.getConstraint().equals(Predicates.alwaysTrue())
-                ? ImmutableList.of((config.getConstraint().getClass().equals(StringPredicates.isNonBlank().getClass()) ? "required" : config.getConstraint().toString()))
-                : ImmutableList.<String>of();
-        this.links = links != null ? ImmutableMap.copyOf(links) : null;
-    }
-
-    public Boolean isPinned() {
-        return pinned;
-    }
-
-    public List<String> getConstraints() {
-        return constraints;
+        super(config, label, priority, pinned, links);
     }
 
-    @Override
-    public Map<String, URI> getLinks() {
-        return links;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        if (!super.equals(o)) return false;
-        EntityConfigSummary that = (EntityConfigSummary) o;
-        if (pinned != that.pinned) return false;
-        if (constraints != null ? !constraints.equals(that.constraints) : that.constraints != null) return false;
-        return links != null ? links.equals(that.links) : that.links == null;
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(super.hashCode(), links);
-    }
-
-    @Override
-    public String toString() {
-        return "EntityConfigSummary{" +
-                "name='" + getName() + '\'' +
-                ", type='" + getType() + '\'' +
-                ", description='" + getDescription() + '\'' +
-                "links=" + links +
-                '}';
-    }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationConfigSummary.java
index 21d5861..240921b 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/LocationConfigSummary.java
@@ -21,18 +21,17 @@ package org.apache.brooklyn.rest.domain;
 import java.net.URI;
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.collect.ImmutableMap;
 
+/** @deprecated since 0.13.0 no different to ConfigSummary, use that */
+@Deprecated
 public class LocationConfigSummary extends ConfigSummary {
 
     private static final long serialVersionUID = 2232321501735217002L;
 
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
-    private final Map<String, URI> links;
+    @SuppressWarnings("unused") // json deserialization
+    private LocationConfigSummary() {}
 
     public LocationConfigSummary(
             @JsonProperty("name") String name,
@@ -43,34 +42,11 @@ public class LocationConfigSummary extends ConfigSummary {
             @JsonProperty("label") String label,
             @JsonProperty("priority") Double priority,
             @JsonProperty("possibleValues") List<Map<String, String>> possibleValues,
+            @JsonProperty("pinned") Boolean pinned,
+            @JsonProperty("constraints") List<String> constraints,
             @JsonProperty("links") Map<String, URI> links) {
-        super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues);
-        this.links = (links == null) ? ImmutableMap.<String, URI>of() : ImmutableMap.copyOf(links);
+        super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues,
+            pinned, constraints, links);
     }
 
-    @Override
-    public Map<String, URI> getLinks() {
-        return links;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (!(o instanceof LocationConfigSummary)) return false;
-        if (!super.equals(o)) return false;
-        LocationConfigSummary that = (LocationConfigSummary) o;
-        return Objects.equals(links, that.links);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(super.hashCode(), links);
-    }
-
-    @Override
-    public String toString() {
-        return "LocationConfigSummary{" +
-                "links=" + links +
-                '}';
-    }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicyConfigSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicyConfigSummary.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicyConfigSummary.java
index 5dfb898..3386045 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicyConfigSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicyConfigSummary.java
@@ -19,25 +19,39 @@
 package org.apache.brooklyn.rest.domain;
 
 import java.net.URI;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.brooklyn.config.ConfigKey;
 
-//TODO remove? this class has no value over its super
-public class PolicyConfigSummary extends AdjunctConfigSummary {
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** @deprecated since 0.13.0 no different to ConfigSummary, use that */
+@Deprecated
+public class PolicyConfigSummary extends ConfigSummary {
 
     private static final long serialVersionUID = 4339330833863794513L;
 
     @SuppressWarnings("unused") // json deserialization
     private PolicyConfigSummary() {}
     
-    public PolicyConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
-        super(config, label, priority, links);
+    public PolicyConfigSummary(
+            @JsonProperty("name") String name,
+            @JsonProperty("type") String type,
+            @JsonProperty("description") String description,
+            @JsonProperty("defaultValue") Object defaultValue,
+            @JsonProperty("reconfigurable") boolean reconfigurable,
+            @JsonProperty("label") String label,
+            @JsonProperty("priority") Double priority,
+            @JsonProperty("possibleValues") List<Map<String, String>> possibleValues,
+            @JsonProperty("pinned") Boolean pinned,
+            @JsonProperty("constraints") List<String> constraints,
+            @JsonProperty("links") Map<String, URI> links) {
+        super(name, type, description, defaultValue, reconfigurable, label, priority, possibleValues, pinned, constraints, links);
     }
-
-    public PolicyConfigSummary(String name, String type, String description, Object defaultValue, boolean reconfigurable,
-        Map<String, URI> links) {
-        super(name, type, description, defaultValue, reconfigurable, links);
+    
+    public PolicyConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
+        super(config, label, priority, null, links);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/EntityTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/EntityTransformer.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/EntityTransformer.java
index 6bf3f19..73b2831 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/EntityTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/EntityTransformer.java
@@ -41,7 +41,7 @@ import org.apache.brooklyn.rest.api.ApplicationApi;
 import org.apache.brooklyn.rest.api.CatalogApi;
 import org.apache.brooklyn.rest.api.EntityApi;
 import org.apache.brooklyn.rest.api.EntityConfigApi;
-import org.apache.brooklyn.rest.domain.AdjunctConfigSummary;
+import org.apache.brooklyn.rest.domain.ConfigSummary;
 import org.apache.brooklyn.rest.domain.EnricherConfigSummary;
 import org.apache.brooklyn.rest.domain.EntityConfigSummary;
 import org.apache.brooklyn.rest.domain.EntitySummary;
@@ -125,8 +125,8 @@ public class EntityTransformer {
         return new EntityConfigSummary(config, label, priority, pinned, mapOfLinks);
     }
 
-    public static AdjunctConfigSummary adjunctConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
-        return new AdjunctConfigSummary(config, label, priority, links);
+    public static ConfigSummary configSummary(ConfigKey<?> config, String label, Double priority, Boolean pinned, Map<String, URI> links) {
+        return new ConfigSummary(config, label, priority, pinned, links);
     }
 
     public static PolicyConfigSummary policyConfigSummary(ConfigKey<?> config, String label, Double priority, Map<String, URI> links) {
@@ -198,9 +198,10 @@ public class EntityTransformer {
         return entityConfigSummary(input.getConfigKey(), input.getLabel(), priority, input.isPinned(), null);
     }
 
-    public static AdjunctConfigSummary adjunctConfigSummary(SpecParameter<?> input) {
+    public static ConfigSummary configSummary(SpecParameter<?> input) {
+        // could increment priority, or take from annotation, or introduce new field
         Double priority = input.isPinned() ? Double.valueOf(1d) : null;
-        return policyConfigSummary(input.getConfigKey(), input.getLabel(), priority, null);
+        return configSummary(input.getConfigKey(), input.getLabel(), priority, input.isPinned(), null);
     }
 
     public static PolicyConfigSummary policyConfigSummary(SpecParameter<?> input) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/PolicyTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/PolicyTransformer.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/PolicyTransformer.java
index 8dad949..d6ba1d3 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/PolicyTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/PolicyTransformer.java
@@ -96,7 +96,8 @@ public class PolicyTransformer {
 
         return new PolicyConfigSummary(config.getName(), config.getTypeName(), config.getDescription(), 
                 PolicyConfigResource.getStringValueForDisplay(utils, policy, config.getDefaultValue()), 
-                config.isReconfigurable(), 
+                config.isReconfigurable(),
+                null, null, null, null, null, 
                 links);
     }
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/54fb9c6a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
index 4c9ccb2..e37ee6a 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/TypeTransformer.java
@@ -50,9 +50,9 @@ import org.apache.brooklyn.core.objs.BrooklynTypes;
 import org.apache.brooklyn.core.typereg.RegisteredTypePredicates;
 import org.apache.brooklyn.core.typereg.RegisteredTypes;
 import org.apache.brooklyn.rest.api.TypeApi;
-import org.apache.brooklyn.rest.domain.AdjunctConfigSummary;
 import org.apache.brooklyn.rest.domain.BundleInstallationRestResult;
 import org.apache.brooklyn.rest.domain.BundleSummary;
+import org.apache.brooklyn.rest.domain.ConfigSummary;
 import org.apache.brooklyn.rest.domain.EffectorSummary;
 import org.apache.brooklyn.rest.domain.EntityConfigSummary;
 import org.apache.brooklyn.rest.domain.SensorSummary;
@@ -96,11 +96,11 @@ public class TypeTransformer {
                     RegisteredTypes.isSubtypeOf(item, Policy.class) || RegisteredTypes.isSubtypeOf(item, Enricher.class) || RegisteredTypes.isSubtypeOf(item, Feed.class)
                     ) {
                 try {
-                    Set<AdjunctConfigSummary> config = Sets.newLinkedHashSet();
+                    Set<ConfigSummary> config = Sets.newLinkedHashSet();
                     
                     AbstractBrooklynObjectSpec<?,?> spec = b.getTypeRegistry().createSpec(item, null, null);
                     for (final SpecParameter<?> input : spec.getParameters()){
-                        config.add(EntityTransformer.adjunctConfigSummary(input));
+                        config.add(EntityTransformer.configSummary(input));
                     }
                     
                     result.setExtraField("config", config);