brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [32/35] brooklyn-server git commit: address PR comments, note deprecation now since 0.13.0, and remove/update other deprecated
Date Tue, 03 Oct 2017 14:24:09 GMT
address PR comments, note deprecation now since 0.13.0, and remove/update other deprecated


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

Branch: refs/heads/master
Commit: 28dbb83e0d52a978b4756b7a1c379da309ee820a
Parents: dd4f05e
Author: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Authored: Tue Oct 3 10:24:47 2017 +0100
Committer: Alex Heneveld <alex.heneveld@cloudsoftcorp.com>
Committed: Tue Oct 3 12:29:11 2017 +0100

----------------------------------------------------------------------
 .../brooklyn/core/entity/EntityAdjuncts.java    | 28 ++++++-
 .../apache/brooklyn/core/policy/Policies.java   | 86 ++------------------
 .../apache/brooklyn/rest/api/AdjunctApi.java    | 14 ++--
 .../org/apache/brooklyn/rest/api/PolicyApi.java |  2 +-
 .../brooklyn/rest/api/PolicyConfigApi.java      |  2 +-
 .../brooklyn/rest/domain/AdjunctSummary.java    |  2 -
 .../brooklyn/rest/domain/ApplicationSpec.java   | 12 +--
 .../rest/domain/CatalogEnricherSummary.java     |  4 +-
 .../rest/domain/CatalogEntitySummary.java       |  4 +-
 .../rest/domain/CatalogItemSummary.java         |  4 +-
 .../rest/domain/CatalogLocationSummary.java     |  4 +-
 .../rest/domain/CatalogPolicySummary.java       |  4 +-
 .../brooklyn/rest/domain/EffectorSummary.java   |  9 +-
 .../brooklyn/rest/domain/EntityDetail.java      | 14 ++--
 .../brooklyn/rest/domain/EntitySummary.java     | 11 +--
 .../rest/domain/PolicyConfigSummary.java        |  2 +-
 .../brooklyn/rest/domain/PolicySummary.java     |  2 +-
 .../rest/domain/ScriptExecutionSummary.java     | 11 +--
 .../brooklyn/rest/domain/SensorSummary.java     |  7 +-
 .../rest/resources/AdjunctResource.java         | 48 ++++++-----
 .../rest/transform/AdjunctTransformer.java      |  4 +-
 .../rest/transform/CatalogTransformer.java      |  2 +-
 .../rest/transform/ConfigTransformer.java       |  2 +
 .../rest/transform/PolicyTransformer.java       |  2 +-
 .../rest/util/BrooklynRestResourceUtils.java    | 13 +--
 .../rest/testing/BrooklynRestResourceTest.java  |  2 +-
 26 files changed, 139 insertions(+), 156 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
index fc1daf4..8c06384 100644
--- a/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
+++ b/core/src/main/java/org/apache/brooklyn/core/entity/EntityAdjuncts.java
@@ -23,13 +23,17 @@ import java.util.List;
 
 import org.apache.brooklyn.api.entity.Entity;
 import org.apache.brooklyn.api.objs.EntityAdjunct;
+import org.apache.brooklyn.api.policy.Policy;
 import org.apache.brooklyn.api.sensor.Enricher;
+import org.apache.brooklyn.api.sensor.Feed;
+import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ComputeServiceIndicatorsFromChildrenAndMembers;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ComputeServiceState;
 import org.apache.brooklyn.core.entity.lifecycle.ServiceStateLogic.ServiceNotUpLogic;
 import org.apache.brooklyn.util.collections.MutableList;
 import org.apache.brooklyn.util.guava.Maybe;
 
+import com.google.common.annotations.Beta;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableList;
 
@@ -66,5 +70,27 @@ public class EntityAdjuncts {
         if (SYSTEM_ENRICHER_UNIQUE_TAGS.contains(enr.getUniqueTag())) return true;
         return false;
     }
-    
+
+    @Beta
+    public static Lifecycle inferAdjunctStatus(EntityAdjunct a) {
+        if (a.isRunning()) return Lifecycle.RUNNING;
+        if (a.isDestroyed()) return Lifecycle.DESTROYED;
+        
+        // adjuncts don't currently support an "error" state; though that would be useful!
+        
+        if (a instanceof Policy) {
+            if (((Policy)a).isSuspended()) return Lifecycle.STOPPED;
+            return Lifecycle.CREATED;
+        }
+        if (a instanceof Feed) {
+            if (((Feed)a).isSuspended()) return Lifecycle.STOPPED;
+            if (((Feed)a).isActivated()) return Lifecycle.STARTING;
+            return Lifecycle.CREATED;
+        }
+
+        // Enricher doesn't support suspend so if not running or destroyed then
+        // it is just created
+        return Lifecycle.CREATED;
+    }
+
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java b/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
index 4b32dfc..0af5c6a 100644
--- a/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
+++ b/core/src/main/java/org/apache/brooklyn/core/policy/Policies.java
@@ -18,94 +18,18 @@
  */
 package org.apache.brooklyn.core.policy;
 
-import org.apache.brooklyn.api.entity.Entity;
-import org.apache.brooklyn.api.entity.EntityLocal;
-import org.apache.brooklyn.api.objs.EntityAdjunct;
 import org.apache.brooklyn.api.policy.Policy;
-import org.apache.brooklyn.api.sensor.Feed;
-import org.apache.brooklyn.api.sensor.Sensor;
-import org.apache.brooklyn.api.sensor.SensorEvent;
-import org.apache.brooklyn.api.sensor.SensorEventListener;
+import org.apache.brooklyn.core.entity.EntityAdjuncts;
 import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import com.google.common.annotations.Beta;
-
-import groovy.lang.Closure;
-
-@SuppressWarnings({"rawtypes","unchecked"})
+/** @deprecated since 0.13.0 use {@link EntityAdjuncts} */
+@Deprecated
 public class Policies {
 
-    private static final Logger LOG = LoggerFactory.getLogger(Policies.class);
-
-    /**
-     * @deprecated since 0.11.0; explicit groovy utilities/support will be deleted.
-     */
+    /** @deprecated since 0.13.0, use {@link EntityAdjuncts#inferAdjunctStatus(org.apache.brooklyn.api.objs.EntityAdjunct)}
*/
     @Deprecated
-    public static SensorEventListener listenerFromValueClosure(final Closure code) {
-        LOG.warn("Use of groovy.lang.Closure is deprecated in Policies.listenerFromValueClosure()");
-        return new SensorEventListener() {
-            @Override
-            public void onEvent(SensorEvent event) {
-                code.call(event.getValue());
-            }
-        };
-    }
-    
-    /**
-     * @deprecated since 0.11.0; explicit groovy utilities/support will be deleted.
-     */
-    @Deprecated
-    public static <T> Policy newSingleSensorValuePolicy(final Sensor<T> sensor,
final Closure code) {
-        LOG.warn("Use of groovy.lang.Closure is deprecated in Policies.newSingleSensorValuePolicy()");
-        return new AbstractPolicy() {
-            @Override
-            public void setEntity(EntityLocal entity) {
-                super.setEntity(entity);
-                entity.subscriptions().subscribe(entity, sensor, listenerFromValueClosure(code));
-            }
-        };
-    }
-    
-    /**
-     * @deprecated since 0.11.0; explicit groovy utilities/support will be deleted.
-     */
-    @Deprecated
-    public static <S,T> Policy newSingleSensorValuePolicy(final Entity remoteEntity,
final Sensor<T> remoteSensor, 
-            final Closure code) {
-        LOG.warn("Use of groovy.lang.Closure is deprecated in Policies.newSingleSensorValuePolicy()");
-        return new AbstractPolicy() {
-            @Override
-            public void setEntity(EntityLocal entity) {
-                super.setEntity(entity);
-                entity.subscriptions().subscribe(remoteEntity, remoteSensor, listenerFromValueClosure(code));
-            }
-        };
-    }
-
     public static Lifecycle getPolicyStatus(Policy p) {
-        return inferAdjunctStatus(p);
-    }
-    
-    @Beta
-    public static Lifecycle inferAdjunctStatus(EntityAdjunct a) {
-        if (a.isRunning()) return Lifecycle.RUNNING;
-        if (a.isDestroyed()) return Lifecycle.DESTROYED;
-        
-        // adjuncts don't currently support an "error" state; though that would be useful!
-        
-        if (a instanceof Policy) {
-            if (((Policy)a).isSuspended()) return Lifecycle.STOPPED;
-            return Lifecycle.CREATED;
-        }
-        if (a instanceof Feed) {
-            if (((Feed)a).isSuspended()) return Lifecycle.STOPPED;
-            if (((Feed)a).isActivated()) return Lifecycle.STARTING;
-            return Lifecycle.CREATED;
-        }
-        
-        return Lifecycle.STOPPED;
+        return EntityAdjuncts.inferAdjunctStatus(p);
     }
     
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java
index 1886f63..da5c1bf 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/AdjunctApi.java
@@ -54,18 +54,20 @@ public interface AdjunctApi {
             response = org.apache.brooklyn.rest.domain.AdjunctSummary.class,
             responseContainer = "List")
     @ApiResponses(value = {
-            @ApiResponse(code = 404, message = "Could not find application or entity")
+            @ApiResponse(code = 404, message = "Could not find application or entity"),
+            @ApiResponse(code = 400, message = "Type is not known adjunct kind")
     })
     public List<AdjunctSummary> list(
             @ApiParam(value = "Application ID or name", required = true)
             @PathParam("application") final String application,
             @ApiParam(value = "Entity ID or name", required = true)
             @PathParam("entity") final String entityToken,
-            @ApiParam(value = "Filter by adjunct type", required = false)
+            @ApiParam(value = "Filter by adjunct type (policy, enricher, feed)", required
= false)
             @QueryParam("adjunctType") final String adjunctType);
 
+    // TODO support YAML ?
     @POST
-    @ApiOperation(value = "Add an adjunct (policy, enricher, or feed)", notes = "Returns
a summary of the added adjunct")
+    @ApiOperation(value = "Create and add an adjunct (e.g. a policy, enricher, or feed) to
this entity", notes = "Returns a summary of the added adjunct")
     @ApiResponses(value = {
             @ApiResponse(code = 404, message = "Could not find application or entity"),
             @ApiResponse(code = 400, message = "Type is not a suitable adjunct")
@@ -121,7 +123,8 @@ public interface AdjunctApi {
     @Path("/{adjunct}/start")
     @ApiOperation(value = "Start or resume an adjunct")
     @ApiResponses(value = {
-            @ApiResponse(code = 404, message = "Could not find application, entity or adjunct")
+            @ApiResponse(code = 404, message = "Could not find application, entity or adjunct"),
+            @ApiResponse(code = 400, message = "Adjunct does not support start/stop")
     })
     public Response start(
             @ApiParam(name = "application", value = "Application ID or name", required =
true)
@@ -137,7 +140,8 @@ public interface AdjunctApi {
     @Path("/{adjunct}/stop")
     @ApiOperation(value = "Suspends an adjunct")
     @ApiResponses(value = {
-            @ApiResponse(code = 404, message = "Could not find application, entity or adjunct")
+            @ApiResponse(code = 404, message = "Could not find application, entity or adjunct"),
+            @ApiResponse(code = 400, message = "Adjunct does not support start/stop")
     })
     public Response stop(
             @ApiParam(name = "application", value = "Application ID or name", required =
true)

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
index 95f41db..1bee2f8 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
@@ -36,7 +36,7 @@ import java.util.Map;
 @Api("Entity Policies")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
-/** @deprecated since 0.12.0 use AdjunctApi */
+/** @deprecated since 0.13.0 use AdjunctApi */
 @Deprecated
 public interface PolicyApi {
     

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
index 8d061dd..f38d9d4 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
@@ -42,7 +42,7 @@ import io.swagger.annotations.ApiResponses;
 @Api("Entity Policy Config")
 @Produces(MediaType.APPLICATION_JSON)
 @Consumes(MediaType.APPLICATION_JSON)
-/** @deprecated since 0.12.0 use AdjunctApi */
+/** @deprecated since 0.13.0 use AdjunctApi */
 @Deprecated
 public interface PolicyConfigApi {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctSummary.java
index ca80644..97ce1b2 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/AdjunctSummary.java
@@ -58,8 +58,6 @@ public class AdjunctSummary implements HasName, Serializable, Identifiable
{
         highlights = a.getHighlights();
     }
         
-    /** @deprecated since 0.12.0 only for legacy type-specific summary classes */
-    @Deprecated   
     protected AdjunctSummary(
             String id,
             String name,

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ApplicationSpec.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ApplicationSpec.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ApplicationSpec.java
index 52f7efd..172f66f 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ApplicationSpec.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ApplicationSpec.java
@@ -27,8 +27,9 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+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.collect.ImmutableMap;
 import com.google.common.collect.ImmutableSet;
 
@@ -85,12 +86,13 @@ public class ApplicationSpec implements HasName, Serializable {
     }
 
     private final String name;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final String type;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final Set<EntitySpec> entities;
+    @JsonInclude(Include.NON_NULL)
     private final Set<String> locations;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
+    @JsonInclude(Include.NON_EMPTY)
     private final Map<String, String> config;
 
   public ApplicationSpec(
@@ -106,7 +108,7 @@ public class ApplicationSpec implements HasName, Serializable {
       } else {
           this.entities = (entities.isEmpty() && type!=null) ? null : ImmutableSet.copyOf(entities);
       }
-      this.locations = ImmutableSet.copyOf(checkNotNull(locations, "locations must be provided
for an application spec"));
+      this.locations = locations == null ? Collections.emptySet() : ImmutableSet.copyOf(locations);
       this.config = config == null ? Collections.<String, String>emptyMap() : ImmutableMap.<String,
String>copyOf(config);
       if (this.entities!=null && this.type!=null) throw new IllegalStateException("cannot
supply both type and entities for an application spec");
       // valid for both to be null, e.g. for an anonymous type

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEnricherSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEnricherSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEnricherSummary.java
index c655515..56ff0ff 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEnricherSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEnricherSummary.java
@@ -23,11 +23,13 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.brooklyn.rest.api.TypeApi;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.collect.ImmutableSet;
 
-/** @deprecated since 0.12.0 new TypeApi returns TypeSummary */
+/** @deprecated since 0.13.0 new {@link TypeApi} returns {@link TypeSummary} */
 @Deprecated
 public class CatalogEnricherSummary extends CatalogItemSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEntitySummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEntitySummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEntitySummary.java
index 7dbc1be..6df6b38 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEntitySummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogEntitySummary.java
@@ -23,11 +23,13 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.brooklyn.rest.api.TypeApi;
+
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 
-/** @deprecated since 0.12.0 new TypeApi returns TypeSummary */
+/** @deprecated since 0.13.0 new {@link TypeApi} returns {@link TypeSummary} */
 @Deprecated
 public class CatalogEntitySummary extends CatalogItemSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogItemSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogItemSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogItemSummary.java
index cd85c13..19a1749 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogItemSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogItemSummary.java
@@ -26,6 +26,8 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.brooklyn.rest.api.TypeApi;
+
 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
@@ -36,7 +38,7 @@ import com.google.common.collect.ImmutableMap;
  * see also, subclasses */
 @JsonIgnoreProperties(ignoreUnknown = true)
 // ignore unknown, ie properties from subclasses (entity)
-/** @deprecated since 0.12.0 new TypeApi returns TypeSummary */
+/** @deprecated since 0.13.0 new {@link TypeApi} returns {@link TypeSummary} */
 @Deprecated
 public class CatalogItemSummary implements HasId, HasName, Serializable {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogLocationSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogLocationSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogLocationSummary.java
index 5fb1a4b..1b76948 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogLocationSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogLocationSummary.java
@@ -23,10 +23,12 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.brooklyn.rest.api.TypeApi;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.collect.ImmutableSet;
 
-/** @deprecated since 0.12.0 new TypeApi returns TypeSummary */
+/** @deprecated since 0.13.0 new {@link TypeApi} returns {@link TypeSummary} */
 @Deprecated
 public class CatalogLocationSummary extends CatalogItemSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogPolicySummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogPolicySummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogPolicySummary.java
index ad67786..dafa6bb 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogPolicySummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/CatalogPolicySummary.java
@@ -23,11 +23,13 @@ import java.util.Map;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.brooklyn.rest.api.TypeApi;
+
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.google.common.collect.ImmutableSet;
 
-/** @deprecated since 0.12.0 new TypeApi returns TypeSummary */
+/** @deprecated since 0.13.0 new {@link TypeApi} returns {@link TypeSummary} */
 @Deprecated
 public class CatalogPolicySummary extends CatalogItemSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EffectorSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EffectorSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EffectorSummary.java
index 3e09c73..7f38438 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EffectorSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EffectorSummary.java
@@ -23,8 +23,9 @@ import java.net.URI;
 import java.util.Map;
 import java.util.Set;
 
+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.MoreObjects;
 import com.google.common.base.Objects;
 import com.google.common.collect.ImmutableMap;
@@ -38,7 +39,7 @@ public class EffectorSummary implements HasName, Serializable {
 
         private final String name;
         private final String type;
-        @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+        @JsonInclude(Include.NON_NULL)
         private final String description;
         private final T defaultValue;
         private final boolean shouldSanitize;
@@ -110,9 +111,9 @@ public class EffectorSummary implements HasName, Serializable {
     private final String name;
     private final String returnType;
     private final Set<ParameterSummary<?>> parameters;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_EMPTY)
     private final String description;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_EMPTY)
     private final Map<String, URI> links;
 
     public EffectorSummary(

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityDetail.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityDetail.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityDetail.java
index 567c40b..f49bb81 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityDetail.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntityDetail.java
@@ -18,23 +18,25 @@
  */
 package org.apache.brooklyn.rest.domain;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.collect.ImmutableList;
-import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
-
 import java.net.URI;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.brooklyn.core.entity.lifecycle.Lifecycle;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonInclude.Include;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.collect.ImmutableList;
+
 public class EntityDetail extends EntitySummary {
 
     private static final long serialVersionUID = 100490507982229165L;
 
     private final String applicationId;
     private final String parentId;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
+    @JsonInclude(Include.NON_EMPTY)
     private final List<EntitySummary> children;
     private final List<String> groupIds;
     private final List<Map<String, String>> members;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntitySummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntitySummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntitySummary.java
index e0a585a..ae123ef 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntitySummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/EntitySummary.java
@@ -18,15 +18,16 @@
  */
 package org.apache.brooklyn.rest.domain;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.google.common.collect.ImmutableMap;
-
 import java.io.Serializable;
 import java.net.URI;
 import java.util.Map;
 import java.util.Objects;
 
+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 EntitySummary implements HasId, HasName, Serializable {
 
     private static final long serialVersionUID = 100490507982229165L;
@@ -34,7 +35,7 @@ public class EntitySummary implements HasId, HasName, Serializable {
     private final String id;
     private final String name;
     private final String type;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final String catalogItemId;
     private final Map<String, URI> links;
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/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 3386045..4098ee1 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
@@ -26,7 +26,7 @@ import org.apache.brooklyn.config.ConfigKey;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 
-/** @deprecated since 0.13.0 no different to ConfigSummary, use that */
+/** @deprecated since 0.13.0 no different to {@link ConfigSummary}, use that */
 @Deprecated
 public class PolicyConfigSummary extends ConfigSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicySummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicySummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicySummary.java
index da4a86a..1d0e930 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicySummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/PolicySummary.java
@@ -26,7 +26,7 @@ import org.apache.brooklyn.api.objs.HighlightTuple;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
 
-/** @deprecated since 0.12.0 use {@link AdjunctSummary}; this class is identical */
+/** @deprecated since 0.13.0 use {@link AdjunctSummary}; this class is identical */
 @Deprecated
 public class PolicySummary extends AdjunctSummary {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ScriptExecutionSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ScriptExecutionSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ScriptExecutionSummary.java
index c84573c..3266018 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ScriptExecutionSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/ScriptExecutionSummary.java
@@ -21,20 +21,21 @@ package org.apache.brooklyn.rest.domain;
 import java.io.Serializable;
 import java.util.Objects;
 
+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;
 
 public class ScriptExecutionSummary implements Serializable {
 
     private static final long serialVersionUID = -7707936602991185960L;
 
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final Object result;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
+    @JsonInclude(Include.NON_EMPTY)
     private final String problem;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
+    @JsonInclude(Include.NON_EMPTY)
     private final String stdout;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_EMPTY)
+    @JsonInclude(Include.NON_EMPTY)
     private final String stderr;
 
     public ScriptExecutionSummary(

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/SensorSummary.java
----------------------------------------------------------------------
diff --git a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/SensorSummary.java
b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/SensorSummary.java
index 11a4d2f..9442f33 100644
--- a/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/SensorSummary.java
+++ b/rest/rest-api/src/main/java/org/apache/brooklyn/rest/domain/SensorSummary.java
@@ -23,8 +23,9 @@ import java.net.URI;
 import java.util.Map;
 import java.util.Objects;
 
+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.collect.ImmutableMap;
 
 public class SensorSummary implements HasName, Serializable {
@@ -33,9 +34,9 @@ public class SensorSummary implements HasName, Serializable {
 
     private final String name;
     private final String type;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final String description;
-    @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
+    @JsonInclude(Include.NON_NULL)
     private final Map<String, URI> links;
 
     public SensorSummary(

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AdjunctResource.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AdjunctResource.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AdjunctResource.java
index 08f3698..6090e6d 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AdjunctResource.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/resources/AdjunctResource.java
@@ -51,7 +51,6 @@ import org.apache.brooklyn.rest.filter.HaHotStateRequired;
 import org.apache.brooklyn.rest.transform.AdjunctTransformer;
 import org.apache.brooklyn.rest.transform.ConfigTransformer;
 import org.apache.brooklyn.rest.transform.EntityTransformer;
-import org.apache.brooklyn.rest.util.BrooklynRestResourceUtils;
 import org.apache.brooklyn.rest.util.WebResourceUtils;
 import org.apache.brooklyn.util.core.ClassLoaderUtils;
 import org.apache.brooklyn.util.core.flags.TypeCoercions;
@@ -121,9 +120,11 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
         } else {
             try {
                 Class<?> type = new ClassLoaderUtils(this, mgmt()).loadClass(adjunctTypeName);
-                if (Policy.class.isAssignableFrom(type)) spec = PolicySpec.create((Class)
type);
-                else if (Enricher.class.isAssignableFrom(type)) spec = EnricherSpec.create((Class)
type);
-                else if (Feed.class.isAssignableFrom(type)) {
+                if (Policy.class.isAssignableFrom(type)) {
+                    spec = PolicySpec.create((Class) type);
+                } else if (Enricher.class.isAssignableFrom(type)) {
+                    spec = EnricherSpec.create((Class) type);
+                } else if (Feed.class.isAssignableFrom(type)) {
                     // TODO add FeedSpec ?  would be needed even if using the type registry
                     throw WebResourceUtils.badRequest("Creation of feeds from java type (%s)
not supported", adjunctTypeName);
                 } else {
@@ -141,9 +142,11 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
         spec.configure(config);
 
         EntityAdjunct instance;
-        if (spec instanceof PolicySpec) instance = entity.policies().add((PolicySpec)spec);
-        else if (spec instanceof EnricherSpec) instance = entity.enrichers().add((EnricherSpec)spec);
-        else {
+        if (spec instanceof PolicySpec) {
+            instance = entity.policies().add((PolicySpec)spec);
+        } else if (spec instanceof EnricherSpec) {
+            instance = entity.enrichers().add((EnricherSpec)spec);
+        } else {
             // TODO add FeedSpec
             throw WebResourceUtils.badRequest("Unexpected spec type %s", spec);
         }
@@ -169,9 +172,13 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
     @Override
     public Response start(String application, String entityToken, String adjunctId) {
         EntityAdjunct adjunct = brooklyn().getAdjunct(application, entityToken, adjunctId);
-        if (adjunct instanceof Policy) ((Policy)adjunct).resume();
-        else if (adjunct instanceof Feed) ((Feed)adjunct).resume();
-        else throw WebResourceUtils.badRequest("%s does not support start/resume", adjunct);
+        if (adjunct instanceof Policy) {
+            ((Policy)adjunct).resume();
+        } else if (adjunct instanceof Feed) {
+            ((Feed)adjunct).resume();
+        } else {
+            throw WebResourceUtils.badRequest("%s does not support start/resume", adjunct);
+        }
         
         return Response.status(Response.Status.NO_CONTENT).build();
     }
@@ -179,9 +186,13 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
     @Override
     public Response stop(String application, String entityToken, String adjunctId) {
         EntityAdjunct adjunct = brooklyn().getAdjunct(application, entityToken, adjunctId);
-        if (adjunct instanceof Policy) ((Policy)adjunct).suspend();
-        else if (adjunct instanceof Feed) ((Feed)adjunct).suspend();
-        else throw WebResourceUtils.badRequest("%s does not support suspend", adjunct);
+        if (adjunct instanceof Policy) {
+            ((Policy)adjunct).suspend();
+        } else if (adjunct instanceof Feed) {
+            ((Feed)adjunct).suspend();
+        } else {
+            throw WebResourceUtils.badRequest("%s does not support suspend", adjunct);
+        }
         
         return Response.status(Response.Status.NO_CONTENT).build();
     }
@@ -200,6 +211,7 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
             ((Feed)adjunct).suspend();
             ((EntityInternal)entity).feeds().remove((Feed) adjunct);
         } else {
+            // shouldn't come here
             throw WebResourceUtils.badRequest("Unexpected adjunct type %s", adjunct);
         }
         
@@ -233,7 +245,8 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
     public String getConfig(String application, String entityToken, String adjunctToken,
String configKeyName) {
         EntityAdjunct adjunct = brooklyn().getAdjunct(application, entityToken, adjunctToken);
         Set<ConfigKey<?>> cki = adjunct.config().findKeysDeclared(ConfigPredicates.nameSatisfies(Predicates.equalTo(configKeyName)));
-        if (cki.isEmpty()) throw WebResourceUtils.notFound("Cannot find config key '%s' in
policy '%s' of entity '%s'", configKeyName, adjunctToken, entityToken);
+        // TODO try deprecated names?
+        if (cki.isEmpty()) throw WebResourceUtils.notFound("Cannot find config key '%s' in
adjunct '%s' of entity '%s'", configKeyName, adjunctToken, entityToken);
 
         return brooklyn().getStringValueForDisplay(adjunct.config().get(cki.iterator().next()));
     }
@@ -249,7 +262,8 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
 
         EntityAdjunct adjunct = brooklyn().getAdjunct(entity, adjunctToken);
         Set<ConfigKey<?>> cki = adjunct.config().findKeysDeclared(ConfigPredicates.nameSatisfies(Predicates.equalTo(configKeyName)));
-        if (cki.isEmpty()) throw WebResourceUtils.notFound("Cannot find config key '%s' in
policy '%s' of entity '%s'", configKeyName, adjunctToken, entityToken);
+        // TODO try deprecated names?
+        if (cki.isEmpty()) throw WebResourceUtils.notFound("Cannot find config key '%s' in
adjunct '%s' of entity '%s'", configKeyName, adjunctToken, entityToken);
         ConfigKey<?> ck = cki.iterator().next();
         
         adjunct.config().set((ConfigKey) cki, TypeCoercions.coerce(value, ck.getTypeToken()));
@@ -257,8 +271,4 @@ public class AdjunctResource extends AbstractBrooklynRestResource implements
Adj
         return Response.status(Response.Status.OK).build();
     }
 
-    public static String getStringValueForDisplay(BrooklynRestResourceUtils utils, EntityAdjunct
policy, Object value) {
-        return utils.getStringValueForDisplay(value);
-    }
-    
 }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/AdjunctTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/AdjunctTransformer.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/AdjunctTransformer.java
index a00cb6e..f6598ec 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/AdjunctTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/AdjunctTransformer.java
@@ -30,7 +30,7 @@ import org.apache.brooklyn.api.objs.EntityAdjunct;
 import org.apache.brooklyn.api.policy.Policy;
 import org.apache.brooklyn.api.sensor.Feed;
 import org.apache.brooklyn.config.ConfigKey;
-import org.apache.brooklyn.core.policy.Policies;
+import org.apache.brooklyn.core.entity.EntityAdjuncts;
 import org.apache.brooklyn.rest.api.AdjunctApi;
 import org.apache.brooklyn.rest.domain.AdjunctDetail;
 import org.apache.brooklyn.rest.domain.AdjunctSummary;
@@ -86,7 +86,7 @@ public class AdjunctTransformer {
     }
 
     public static Status inferStatus(EntityAdjunct adjunct) {
-        return ApplicationTransformer.statusFromLifecycle( Policies.inferAdjunctStatus(adjunct)
);
+        return ApplicationTransformer.statusFromLifecycle( EntityAdjuncts.inferAdjunctStatus(adjunct)
);
     }
 
     public static URI adjunctUri(Entity entity, EntityAdjunct adjunct, UriBuilder ub) {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/CatalogTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/CatalogTransformer.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/CatalogTransformer.java
index 6eeaeb8..8bff9f1 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/CatalogTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/CatalogTransformer.java
@@ -71,7 +71,7 @@ import org.slf4j.LoggerFactory;
 import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Sets;
 
-/** @deprecated since 0.13.0 use RegisteredType methods */
+/** @deprecated since 0.13.0 use {@link RegisteredType} methods in {@link TypeTransformer}
*/
 @Deprecated
 public class CatalogTransformer {
 

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/ConfigTransformer.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/ConfigTransformer.java
b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/ConfigTransformer.java
index 22d4299..314ce3c 100644
--- a/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/ConfigTransformer.java
+++ b/rest/rest-resources/src/main/java/org/apache/brooklyn/rest/transform/ConfigTransformer.java
@@ -79,6 +79,8 @@ public class ConfigTransformer {
         return this;
     }
     
+    /** configures this transformer to be able to include links, and which types of links
to include;
+     * note {@link #on(Entity)} or {@link #on(Entity, EntityAdjunct)} is needed to construct
most links. */
     public ConfigTransformer includeLinks(UriBuilder ub, boolean includeContextLinks, boolean
includeActionLinks) {
         this.ub = ub;
         this.includeContextLinks = includeContextLinks;

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/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 2cb5dc7..577e4f1 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
@@ -43,7 +43,7 @@ import static org.apache.brooklyn.rest.util.WebResourceUtils.serviceUriBuilder;
 
 /**
  * Converts from Brooklyn entities to restful API summary objects
- * @deprecated since 0.12.0 use {@link AdjunctTransformer} and {@link AdjunctSummary} 
+ * @deprecated since 0.13.0 use {@link AdjunctTransformer} and {@link AdjunctSummary} 
  */
 @Deprecated
 public class PolicyTransformer {

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/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 9b0a3d4..d382205 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
@@ -155,18 +155,19 @@ public class BrooklynRestResourceUtils {
         for (Policy p: entity.policies()) {
             if (adjunct.equals(p.getId())) return p;
         }
-        for (Policy p: entity.policies()) {
-            if (adjunct.equals(p.getDisplayName())) return p;
-        }
         for (Enricher p: entity.enrichers()) {
             if (adjunct.equals(p.getId())) return p;
         }
-        for (Enricher p: entity.enrichers()) {
-            if (adjunct.equals(p.getDisplayName())) return p;
-        }
         for (Feed p: ((EntityInternal)entity).feeds()) {
             if (adjunct.equals(p.getId())) return p;
         }
+        
+        for (Policy p: entity.policies()) {
+            if (adjunct.equals(p.getDisplayName())) return p;
+        }
+        for (Enricher p: entity.enrichers()) {
+            if (adjunct.equals(p.getDisplayName())) return p;
+        }
         for (Feed p: ((EntityInternal)entity).feeds()) {
             if (adjunct.equals(p.getDisplayName())) return p;
         }

http://git-wip-us.apache.org/repos/asf/brooklyn-server/blob/28dbb83e/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
----------------------------------------------------------------------
diff --git a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
index 30d6697..183f3de 100644
--- a/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
+++ b/rest/rest-resources/src/test/java/org/apache/brooklyn/rest/testing/BrooklynRestResourceTest.java
@@ -152,7 +152,7 @@ public abstract class BrooklynRestResourceTest extends BrooklynRestApiTest
{
                 .run();
         
         if (!started) {
-            log.warn("Did not start application "+applicationRef+":");
+            log.warn("Did not start application "+applicationRef+" ("+getApplicationStatus(applicationRef)+"):");
             Collection<Application> apps = getManagementContext().getApplications();
             for (Application app: apps)
                 Entities.dumpInfo(app);


Mime
View raw message