brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [26/28] incubator-brooklyn git commit: brooklyn-utils-rest-swagger: add org.apache package prefix
Date Sun, 09 Aug 2015 02:55:33 GMT
brooklyn-utils-rest-swagger: add org.apache package prefix

Update dependent projects: brooklyn-rest-api, brooklyn-rest-server,
brooklyn-camp-server and brooklyn-util-rest-swagger.


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

Branch: refs/heads/master
Commit: f73a1af88beeb9b77407e1b83538905893934532
Parents: 4c98f11
Author: Ciprian Ciubotariu <cheepeero@gmx.net>
Authored: Mon Jul 20 19:16:51 2015 +0300
Committer: Ciprian Ciubotariu <cheepeero@gmx.net>
Committed: Fri Aug 7 16:32:46 2015 +0300

----------------------------------------------------------------------
 .../io/brooklyn/camp/CampRestResources.java     |   2 +-
 .../camp/rest/resource/ApidocRestResource.java  |   4 +-
 .../ApplicationComponentRestResource.java       |   2 +-
 ...pplicationComponentTemplateRestResource.java |   2 +-
 .../rest/resource/AssemblyRestResource.java     |   2 +-
 .../resource/AssemblyTemplateRestResource.java  |   2 +-
 .../resource/PlatformComponentRestResource.java |   2 +-
 .../PlatformComponentTemplateRestResource.java  |   2 +-
 .../rest/resource/PlatformRestResource.java     |   2 +-
 .../org/apache/brooklyn/rest/api/AccessApi.java |   2 +-
 .../apache/brooklyn/rest/api/ActivityApi.java   |   2 +-
 .../brooklyn/rest/api/ApplicationApi.java       |   2 +-
 .../apache/brooklyn/rest/api/CatalogApi.java    |   2 +-
 .../apache/brooklyn/rest/api/EffectorApi.java   |   2 +-
 .../org/apache/brooklyn/rest/api/EntityApi.java |   2 +-
 .../brooklyn/rest/api/EntityConfigApi.java      |   2 +-
 .../apache/brooklyn/rest/api/LocationApi.java   |   2 +-
 .../org/apache/brooklyn/rest/api/PolicyApi.java |   2 +-
 .../brooklyn/rest/api/PolicyConfigApi.java      |   2 +-
 .../org/apache/brooklyn/rest/api/ScriptApi.java |   2 +-
 .../org/apache/brooklyn/rest/api/SensorApi.java |   2 +-
 .../org/apache/brooklyn/rest/api/ServerApi.java |   2 +-
 .../org/apache/brooklyn/rest/api/UsageApi.java  |   2 +-
 .../apache/brooklyn/rest/api/VersionApi.java    |   2 +-
 usage/rest-api/src/main/webapp/WEB-INF/web.xml  |   2 +-
 .../apache/brooklyn/rest/BrooklynRestApi.java   |   2 +-
 .../brooklyn/rest/resources/ApidocResource.java |   4 +-
 .../rest-server/src/main/webapp/WEB-INF/web.xml |   2 +-
 .../rest/resources/ApiDocResourceTest.java      |   2 +-
 .../main/java/brooklyn/rest/apidoc/Apidoc.java  |  33 ---
 .../brooklyn/rest/apidoc/ApidocEndpoint.java    |  54 ----
 .../apidoc/ApidocHelpMessageBodyWriter.java     |  28 --
 .../brooklyn/rest/apidoc/ApidocResource.java    | 291 -------------------
 .../java/brooklyn/rest/apidoc/ApidocRoot.java   |  47 ---
 .../org/apache/brooklyn/rest/apidoc/Apidoc.java |  33 +++
 .../brooklyn/rest/apidoc/ApidocEndpoint.java    |  54 ++++
 .../apidoc/ApidocHelpMessageBodyWriter.java     |  28 ++
 .../brooklyn/rest/apidoc/ApidocResource.java    | 291 +++++++++++++++++++
 .../apache/brooklyn/rest/apidoc/ApidocRoot.java |  47 +++
 39 files changed, 484 insertions(+), 484 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/CampRestResources.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/CampRestResources.java b/camp/camp-server/src/main/java/io/brooklyn/camp/CampRestResources.java
index f292427..830f646 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/CampRestResources.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/CampRestResources.java
@@ -31,7 +31,7 @@ import io.brooklyn.camp.rest.resource.PlatformRestResource;
 import java.util.ArrayList;
 import java.util.List;
 
-import brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
+import org.apache.brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
 
 import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
 import com.google.common.collect.Iterables;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApidocRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApidocRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApidocRestResource.java
index 42d55ba..98d73c5 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApidocRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApidocRestResource.java
@@ -20,11 +20,11 @@ package io.brooklyn.camp.rest.resource;
 
 import javax.ws.rs.Path;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 @Path(ApidocRestResource.API_URI_PATH)
 @Apidoc("Web API Documentation")
-public class ApidocRestResource extends brooklyn.rest.apidoc.ApidocResource {
+public class ApidocRestResource extends org.apache.brooklyn.rest.apidoc.ApidocResource {
 
     public static final String API_URI_PATH = PlatformRestResource.CAMP_URI_PATH + "/apidoc";
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentRestResource.java
index 5744541..e2f26e5 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentRestResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentTemplateRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentTemplateRestResource.java
index 8c3fa42..992a579 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/ApplicationComponentTemplateRestResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyRestResource.java
index 9aeadf1..721abea 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyRestResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyTemplateRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyTemplateRestResource.java
index 23753fd..104295c 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/AssemblyTemplateRestResource.java
@@ -36,7 +36,7 @@ import javax.ws.rs.core.UriInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import brooklyn.util.exceptions.Exceptions;
 
 import com.wordnik.swagger.core.ApiOperation;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentRestResource.java
index a0f1f54..a2718f6 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentRestResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentTemplateRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentTemplateRestResource.java
index 967f624..9d2112d 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformComponentTemplateRestResource.java
@@ -25,7 +25,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformRestResource.java b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformRestResource.java
index 81ed80e..edf4bc5 100644
--- a/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformRestResource.java
+++ b/camp/camp-server/src/main/java/io/brooklyn/camp/rest/resource/PlatformRestResource.java
@@ -38,7 +38,7 @@ import javax.ws.rs.core.UriInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/AccessApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/AccessApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/AccessApi.java
index f5cd9ae..fa8f9cd 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/AccessApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/AccessApi.java
@@ -27,7 +27,7 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.AccessSummary;
 
 import com.google.common.annotations.Beta;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java
index 4ba7e0f..84dcfe8 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ActivityApi.java
@@ -20,7 +20,7 @@ package org.apache.brooklyn.rest.api;
 
 import java.util.List;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.TaskSummary;
 
 import com.wordnik.swagger.core.ApiError;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ApplicationApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ApplicationApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ApplicationApi.java
index a05f5f1..a68bc75 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ApplicationApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ApplicationApi.java
@@ -36,7 +36,7 @@ import javax.ws.rs.core.Response;
 
 import org.codehaus.jackson.JsonNode;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.ApplicationSpec;
 import org.apache.brooklyn.rest.domain.ApplicationSummary;
 import org.apache.brooklyn.rest.domain.EntitySummary;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
index d2e86b0..818038f 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/CatalogApi.java
@@ -34,7 +34,7 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.CatalogEntitySummary;
 import org.apache.brooklyn.rest.domain.CatalogItemSummary;
 import org.apache.brooklyn.rest.domain.CatalogLocationSummary;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EffectorApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EffectorApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EffectorApi.java
index 79a5e66..ef5cdbe 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EffectorApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EffectorApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.EffectorSummary;
 import com.wordnik.swagger.core.ApiError;
 import com.wordnik.swagger.core.ApiErrors;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityApi.java
index 431ffec..3be4f17 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.EntitySummary;
 import org.apache.brooklyn.rest.domain.LocationSummary;
 import org.apache.brooklyn.rest.domain.TaskSummary;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityConfigApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityConfigApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityConfigApi.java
index b74ea28..43b36c2 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityConfigApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/EntityConfigApi.java
@@ -31,7 +31,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.EntityConfigSummary;
 
 import com.wordnik.swagger.core.ApiError;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/LocationApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/LocationApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/LocationApi.java
index d41d0a2..f902214 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/LocationApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/LocationApi.java
@@ -34,7 +34,7 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.LocationSpec;
 import org.apache.brooklyn.rest.domain.LocationSummary;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
index 8c9713b..e70738a 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.PolicySummary;
 import org.apache.brooklyn.rest.domain.Status;
 import com.wordnik.swagger.core.ApiError;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
index e7fcabf..9ebe07b 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/PolicyConfigApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.PolicyConfigSummary;
 import com.wordnik.swagger.core.ApiError;
 import com.wordnik.swagger.core.ApiErrors;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ScriptApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ScriptApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ScriptApi.java
index 1fd6d56..6fe2bc9 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ScriptApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ScriptApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.ScriptExecutionSummary;
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/SensorApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/SensorApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/SensorApi.java
index 13db60f..ca29516 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/SensorApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/SensorApi.java
@@ -32,7 +32,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.SensorSummary;
 
 import com.wordnik.swagger.core.ApiError;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
index faaca97..2cbbc04 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/ServerApi.java
@@ -34,7 +34,7 @@ import javax.ws.rs.core.Response;
 
 import brooklyn.management.ha.HighAvailabilityMode;
 import brooklyn.management.ha.ManagementNodeState;
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.HighAvailabilitySummary;
 import org.apache.brooklyn.rest.domain.VersionSummary;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/UsageApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/UsageApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/UsageApi.java
index e44475c..8684dd6 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/UsageApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/UsageApi.java
@@ -28,7 +28,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.MediaType;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import org.apache.brooklyn.rest.domain.UsageStatistics;
 
 import com.wordnik.swagger.core.ApiError;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/VersionApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/VersionApi.java b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/VersionApi.java
index ca928f0..8e6d966 100644
--- a/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/VersionApi.java
+++ b/usage/rest-api/src/main/java/org/apache/brooklyn/rest/api/VersionApi.java
@@ -18,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.api;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 import com.wordnik.swagger.core.ApiOperation;
 
 import javax.ws.rs.Consumes;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-api/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/usage/rest-api/src/main/webapp/WEB-INF/web.xml b/usage/rest-api/src/main/webapp/WEB-INF/web.xml
index 27b89f8..672785e 100644
--- a/usage/rest-api/src/main/webapp/WEB-INF/web.xml
+++ b/usage/rest-api/src/main/webapp/WEB-INF/web.xml
@@ -75,7 +75,7 @@
         <!-- load our REST API jersey resources -->
         <init-param>
             <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>org.apache.brooklyn.rest.resources;brooklyn.rest.apidoc</param-value>
+            <param-value>org.apache.brooklyn.rest.resources;org.apache.brooklyn.rest.apidoc</param-value>
         </init-param>
 
         <!-- install Jackson and turn on pojo/json serialization (could add org.codehaus.jackson.jaxrs 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-server/src/main/java/org/apache/brooklyn/rest/BrooklynRestApi.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/org/apache/brooklyn/rest/BrooklynRestApi.java b/usage/rest-server/src/main/java/org/apache/brooklyn/rest/BrooklynRestApi.java
index 2e38666..3973e52 100644
--- a/usage/rest-server/src/main/java/org/apache/brooklyn/rest/BrooklynRestApi.java
+++ b/usage/rest-server/src/main/java/org/apache/brooklyn/rest/BrooklynRestApi.java
@@ -21,7 +21,7 @@ package org.apache.brooklyn.rest;
 import java.util.ArrayList;
 import java.util.List;
 
-import brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
+import org.apache.brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
 import org.apache.brooklyn.rest.resources.AbstractBrooklynRestResource;
 import org.apache.brooklyn.rest.resources.AccessResource;
 import org.apache.brooklyn.rest.resources.ActivityResource;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-server/src/main/java/org/apache/brooklyn/rest/resources/ApidocResource.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/java/org/apache/brooklyn/rest/resources/ApidocResource.java b/usage/rest-server/src/main/java/org/apache/brooklyn/rest/resources/ApidocResource.java
index 16292bd..0ed4ec5 100644
--- a/usage/rest-server/src/main/java/org/apache/brooklyn/rest/resources/ApidocResource.java
+++ b/usage/rest-server/src/main/java/org/apache/brooklyn/rest/resources/ApidocResource.java
@@ -18,12 +18,12 @@
  */
 package org.apache.brooklyn.rest.resources;
 
-import brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.rest.apidoc.Apidoc;
 
 import javax.ws.rs.Path;
 
 @Apidoc("API Documentation")
 @Path("/v1/apidoc")
-public class ApidocResource extends brooklyn.rest.apidoc.ApidocResource {
+public class ApidocResource extends org.apache.brooklyn.rest.apidoc.ApidocResource {
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-server/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/main/webapp/WEB-INF/web.xml b/usage/rest-server/src/main/webapp/WEB-INF/web.xml
index 2e0aeda..045eaab 100644
--- a/usage/rest-server/src/main/webapp/WEB-INF/web.xml
+++ b/usage/rest-server/src/main/webapp/WEB-INF/web.xml
@@ -80,7 +80,7 @@
         <init-param>
             <param-name>com.sun.jersey.config.property.classnames</param-name>
             <param-value>
-                brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
+                org.apache.brooklyn.rest.apidoc.ApidocHelpMessageBodyWriter;
                 org.apache.brooklyn.rest.util.FormMapProvider;
                 org.codehaus.jackson.jaxrs.JacksonJsonProvider;
                 org.apache.brooklyn.rest.resources.ActivityResource;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/usage/rest-server/src/test/java/org/apache/brooklyn/rest/resources/ApiDocResourceTest.java
----------------------------------------------------------------------
diff --git a/usage/rest-server/src/test/java/org/apache/brooklyn/rest/resources/ApiDocResourceTest.java b/usage/rest-server/src/test/java/org/apache/brooklyn/rest/resources/ApiDocResourceTest.java
index 29e4d22..e5c1f23 100644
--- a/usage/rest-server/src/test/java/org/apache/brooklyn/rest/resources/ApiDocResourceTest.java
+++ b/usage/rest-server/src/test/java/org/apache/brooklyn/rest/resources/ApiDocResourceTest.java
@@ -29,7 +29,7 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 
 import org.apache.brooklyn.rest.BrooklynRestApi;
-import brooklyn.rest.apidoc.ApidocRoot;
+import org.apache.brooklyn.rest.apidoc.ApidocRoot;
 import org.apache.brooklyn.rest.testing.BrooklynRestResourceTest;
 
 import com.google.common.collect.Iterables;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/Apidoc.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/Apidoc.java b/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/Apidoc.java
deleted file mode 100644
index f18418b..0000000
--- a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/Apidoc.java
+++ /dev/null
@@ -1,33 +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 brooklyn.rest.apidoc;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/** like Swagger Api annotation (and treated similarly) but doesn't require path to be repeated, and supports a name */
-@Target(ElementType.TYPE)
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Apidoc {
-    String value();
-    String description() default "";
-    // ? what is 'open' in @Api
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocEndpoint.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocEndpoint.java b/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocEndpoint.java
deleted file mode 100644
index d150698..0000000
--- a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocEndpoint.java
+++ /dev/null
@@ -1,54 +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 brooklyn.rest.apidoc;
-
-import java.util.Comparator;
-
-import org.codehaus.jackson.annotate.JsonCreator;
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-
-import com.wordnik.swagger.core.DocumentationEndPoint;
-
-@JsonIgnoreProperties({
-    "com$wordnik$swagger$core$DocumentationEndPoint$$ops"
-})
-public class ApidocEndpoint extends DocumentationEndPoint {
-
-    public static final Comparator<ApidocEndpoint> COMPARATOR = new Comparator<ApidocEndpoint>() {
-        @Override
-        public int compare(ApidocEndpoint o1, ApidocEndpoint o2) {
-            if (o1.name==o2.name) return 0;
-            if (o1.name==null) return -1;
-            if (o2.name==null) return 1;
-            return o1.name.compareTo(o2.name);
-        }
-    };
-    
-    public final String name;
-    public final String link;
-    
-    @JsonCreator
-    public ApidocEndpoint(@JsonProperty("name") String name, @JsonProperty("path") String path, @JsonProperty("description") String description, @JsonProperty("link") String link) {
-        super(path, description);
-        this.name = name;
-        this.link = link;
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java b/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
deleted file mode 100644
index 2a034ff..0000000
--- a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
+++ /dev/null
@@ -1,28 +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 brooklyn.rest.apidoc;
-
-import javax.ws.rs.ext.Provider;
-
-import com.wordnik.swagger.jaxrs.ApiHelpMessageBodyWriter;
-
-/** subclassed for convenience */
-@Provider
-public class ApidocHelpMessageBodyWriter extends ApiHelpMessageBodyWriter {
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocResource.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocResource.java b/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocResource.java
deleted file mode 100644
index ee82b45..0000000
--- a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocResource.java
+++ /dev/null
@@ -1,291 +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 brooklyn.rest.apidoc;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-
-import com.google.common.collect.ImmutableList;
-import com.sun.jersey.api.core.ResourceConfig;
-import com.wordnik.swagger.core.Api;
-import com.wordnik.swagger.core.ApiOperation;
-import com.wordnik.swagger.core.Documentation;
-import com.wordnik.swagger.core.DocumentationEndPoint;
-import com.wordnik.swagger.jaxrs.ConfigReader;
-import com.wordnik.swagger.jaxrs.HelpApi;
-import com.wordnik.swagger.jaxrs.JaxrsApiReader;
-import com.wordnik.swagger.jaxrs.JaxrsApiSpecParser;
-
-@Produces({"application/json"})
-/** create a concrete subclass for this annotated with the Path where
- * this resource should live 
- * <p>
- * like Swagger ApiListing (and based on that) but:
- * supports singletons as well as classes;
- * supports simpler Apidoc annotation (doesn't repeat path, in common case);
- * doesn't support listingPath/Class that swagger does (but describes in under /apidoc/name.of.Class
- * does not support auth filters
- */
-abstract public class ApidocResource {
-
-    static ConfigReader configReader;
-    static {
-        JaxrsApiReader.setFormatString("");
-    }
-    
-    protected boolean isSupportedMediaType(String type) {
-        return "application/json".equals(type) || "application/xml".equals(type);
-    }
-    
-    protected boolean isIncludedForDocumentation(Class<?> resource) {
-        // TODO currently only support @Produces, not Contenty-type header, or Accept header (which original ApiListing does support)
-        Produces produces = getAnnotation(resource, Produces.class);
-        if (produces == null) return false;
-        for (String type: produces.value()) 
-            if (isSupportedMediaType(type))
-                return true;
-        return false;
-    }
-
-    protected <A extends Annotation> A getAnnotation(Class<?> r, Class<A> annotationClass) {
-        A result = r.getAnnotation(annotationClass);
-        if (result == null) {
-            // first look at things directly on superclass (not inherited)
-            if (r.getSuperclass()!=null)
-                result = r.getSuperclass().getAnnotation(annotationClass);
-        }
-        if (result == null) {
-            // then look at interfaces here (not inherited)
-            // we look at superclasses next so don't have to here
-            for(Class<?> parentInterface :  r.getInterfaces()) {
-                result = parentInterface.getAnnotation(annotationClass);
-                if (result != null) break;
-            }
-        }
-        if (result == null) {
-            // lastly take annotations on superclass and interfaces on superclass, recursively
-            // (so in short we prefer things lower down)
-            if (r.getSuperclass()!=null)
-                result = getAnnotation(r.getSuperclass(), annotationClass);
-        }
-        return result;
-    }
-    
-    protected String getLinkFor(String path, Class<?> resource) {
-        return getClass().getAnnotation(Path.class).value()+"/"+getLinkWordFor(resource);
-    }
-    
-    protected String getLinkWordFor(Class<?> resource) {
-        if (resource.getCanonicalName()!=null) 
-            return resource.getCanonicalName();        
-        else 
-            return Integer.toHexString(resource.hashCode());
-    }
-
-    protected Class<?> getResourceOfLink(ResourceConfig rc, String link) {
-        for (Class<?> r: getResourceClasses(rc)) {
-            if (getLinkWordFor(r).equals(link))
-                return r;
-        }
-        return null;
-    }
-    
-    @GET
-    @ApiOperation(value = "Returns list of all available API resource endpoints", 
-        responseClass = "ApidocRoot", multiValueResponse = true)
-    public Response getAllApis(
-            @Context ResourceConfig rc,
-            @Context HttpHeaders headers,
-            @Context UriInfo uriInfo) {
-
-        String apiVersion = getConfigReader().getApiVersion();
-        String swaggerVersion = getConfigReader().getSwaggerVersion();
-        String basePath = getConfigReader().getBasePath();
-
-        Set<Class<?>> resources = getResourceClasses(rc);
-
-        ApidocRoot allApiDoc = new ApidocRoot();
-
-        List<ApidocEndpoint> endpoints = new ArrayList<ApidocEndpoint>();
-        for (Class<?> resource : resources) {
-            if (!isIncludedForDocumentation(resource))
-                continue;
-            
-            Apidoc apidoc = getAnnotation(resource, Apidoc.class);
-            Api apidocX = getAnnotation(resource, Api.class);
-            Path rsPath = getAnnotation(resource, Path.class);
-
-            if (apidoc==null && apidocX == null) continue;
-            String path = rsPath.value();
-            String name = null;
-            String description;
-
-            if (apidoc!=null) {
-                name = apidoc.value();
-                description = apidoc.description();
-            } else {
-                path = apidocX.value();
-                description = apidocX.description();
-            }
-
-            endpoints.add(new ApidocEndpoint(name, path, description, getLinkFor(path, resource)));
-        }
-        
-        Collections.sort(endpoints, ApidocEndpoint.COMPARATOR);
-        
-        for (ApidocEndpoint api: endpoints) {
-            if (!isApiAdded(allApiDoc, api)) {
-                allApiDoc.addApi(api);
-            }
-        }
-        allApiDoc.setSwaggerVersion(swaggerVersion);
-        allApiDoc.setBasePath(basePath);
-        allApiDoc.setApiVersion(apiVersion);
-
-        return Response.ok().entity(allApiDoc).build();
-    }
-
-    protected Set<Class<?>> getResourceClasses(ResourceConfig rc) {
-        Set<Class<?>> resourceClasses = rc.getRootResourceClasses();
-        Set<Object> resourceObjects = rc.getRootResourceSingletons();
-        
-        Set<Class<?>> resources = new LinkedHashSet<Class<?>>();
-        // @Path should always be set, right? unless something is oddd
-        for (Class<?> r: resourceClasses)
-            if (r.getAnnotation(Path.class)!=null) resources.add(r);
-        for (Object r: resourceObjects) {
-            if (getAnnotation(r.getClass(), Path.class)!=null) {
-                resources.add(r.getClass());
-            }            
-        }
-        return resources;
-    }
-
-    private boolean isApiAdded(Documentation allApiDoc, DocumentationEndPoint endpoint) {
-        boolean isAdded = false;
-        if (allApiDoc.getApis() != null) {
-            for (DocumentationEndPoint addedApi : allApiDoc.getApis()) {
-                if (endpoint.getPath().equals(addedApi.getPath())) isAdded = true;
-            }
-        }
-        return isAdded;
-    }
-
-    @GET
-    @Path("/{resource}")
-    @ApiOperation(value = "Returns detail on the given API resource endpoint", 
-        responseClass = "DocumentationEndPoint", multiValueResponse = true)
-    public Response details(
-            @Context ResourceConfig rc, 
-            @Context HttpHeaders headers, 
-            @Context UriInfo uriInfo,
-            @PathParam("resource") String resource) {
-        Class<?> target = getResourceOfLink(rc, resource);
-        if (target==null) return Response.status(Response.Status.NOT_FOUND).build();
-        
-        // roughly duplicates JavaHelp
-        String apiVersion = getConfigReader().getApiVersion();
-        String swaggerVersion = getConfigReader().getSwaggerVersion();
-        String basePath = getConfigReader().getBasePath();
-
-        String apiFilterClassName = getConfigReader().getApiFilterClassName();
-
-        Apidoc apidoc = getAnnotation(target, Apidoc.class);
-        Api apidocX = getAnnotation(target, Api.class);
-        Path rsPath = getAnnotation(target, Path.class);
-
-        if ((apidoc==null && apidocX==null) || rsPath==null)
-            return Response.status(Response.Status.NOT_FOUND).build();
-
-        String apiPath = apidoc!=null ? rsPath.value() : apidocX.value();
-
-        HelpApi helpApi = new HelpApi(apiFilterClassName);
-        Documentation doc = read(target, apiVersion, swaggerVersion, basePath, apiPath);
-        Documentation docs = helpApi.filterDocs(doc, headers, uriInfo, apiPath, apiPath);
-        return Response.ok().entity(docs).build();
-    }
-
-
-    
-    
-    // items below here simply override the swagger Jaxrs* classes/behaviour so we can use @Path/@Apidoc instead of @Api
-    
-    protected ConfigReader getConfigReader() {
-        if (configReader==null) configReader = new ConfigReader(null);
-        return configReader;
-    }
-
-    static protected Map<Class<?>,Documentation> endpointsCache = new LinkedHashMap<Class<?>, Documentation>();
-            
-    protected Documentation read(Class<?> target, String apiVersion, String swaggerVersion, String basePath, String apiPath) {
-        Documentation result = endpointsCache.get(target);
-        if (result!=null) return result;
-        JaxrsApiSpecParser parser = new ApidocJaxrsSpecParser(target, apiVersion, swaggerVersion, basePath, apiPath);
-        result = parser.parse();
-        endpointsCache.put(target, result);
-        return result;
-    }
-
-    @Api("ignored")
-    static class ApidocJaxrsSpecParser extends JaxrsApiSpecParser {
-        public ApidocJaxrsSpecParser(Class<?> target, String apiVersion, String swaggerVersion, String basePath, String apiPath) {
-            super(target, apiVersion, swaggerVersion, basePath, apiPath);
-        }
-        @Override
-        public Api apiEndpoint() {
-            // return an ignored item; all clients do is check it isn't null
-            return ApidocJaxrsSpecParser.class.getAnnotation(Api.class);
-        }
-        @Override
-        public Class<?> hostClass() {
-            // Overriding to make sure we have a look at the interfaces (Jersey jaxrs implementation doesn't bother)
-            // Note this means we require the @Path class annotation on the same class as all the method annotations
-            for (Class<?> tryMe : ImmutableList.<Class<?>>builder().add(super.hostClass()).add(super.hostClass().getInterfaces()).build()) {
-                if (tryMe.getAnnotation(Path.class) != null) {
-                    return tryMe;                
-                }
-            }
-            return super.hostClass();
-        }
-        
-        public String getPath(Method method) {
-            Path cwsPath = hostClass().getAnnotation(Path.class);
-            Path mwsPath = method.getAnnotation(Path.class);
-            if (cwsPath==null) return null;
-            return cwsPath.value() + (mwsPath!=null ? mwsPath.value() : "");
-        }
-    }
-    
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocRoot.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocRoot.java b/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocRoot.java
deleted file mode 100644
index 5f4ff86..0000000
--- a/utils/rest-swagger/src/main/java/brooklyn/rest/apidoc/ApidocRoot.java
+++ /dev/null
@@ -1,47 +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 brooklyn.rest.apidoc;
-
-import java.util.List;
-
-import org.codehaus.jackson.annotate.JsonIgnoreProperties;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.annotate.JsonSetter;
-
-import com.wordnik.swagger.core.Documentation;
-
-@JsonIgnoreProperties({
-    "com$wordnik$swagger$core$Documentation$$apis",
-    "com$wordnik$swagger$core$Documentation$$models"
-})
-public class ApidocRoot extends Documentation {
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    @JsonProperty("apis")
-    public List<ApidocEndpoint> getApidocApis() {
-        return (List) getApis();
-    }
-    
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    @JsonSetter("apis")
-    public void setApidocApis(List<ApidocEndpoint> ep) {
-        super.setApis((List)ep);
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/Apidoc.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/Apidoc.java b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/Apidoc.java
new file mode 100644
index 0000000..9f6b90c
--- /dev/null
+++ b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/Apidoc.java
@@ -0,0 +1,33 @@
+/*
+ * 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.apidoc;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/** like Swagger Api annotation (and treated similarly) but doesn't require path to be repeated, and supports a name */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Apidoc {
+    String value();
+    String description() default "";
+    // ? what is 'open' in @Api
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocEndpoint.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocEndpoint.java b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocEndpoint.java
new file mode 100644
index 0000000..790eb1f
--- /dev/null
+++ b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocEndpoint.java
@@ -0,0 +1,54 @@
+/*
+ * 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.apidoc;
+
+import java.util.Comparator;
+
+import org.codehaus.jackson.annotate.JsonCreator;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import com.wordnik.swagger.core.DocumentationEndPoint;
+
+@JsonIgnoreProperties({
+    "com$wordnik$swagger$core$DocumentationEndPoint$$ops"
+})
+public class ApidocEndpoint extends DocumentationEndPoint {
+
+    public static final Comparator<ApidocEndpoint> COMPARATOR = new Comparator<ApidocEndpoint>() {
+        @Override
+        public int compare(ApidocEndpoint o1, ApidocEndpoint o2) {
+            if (o1.name==o2.name) return 0;
+            if (o1.name==null) return -1;
+            if (o2.name==null) return 1;
+            return o1.name.compareTo(o2.name);
+        }
+    };
+    
+    public final String name;
+    public final String link;
+    
+    @JsonCreator
+    public ApidocEndpoint(@JsonProperty("name") String name, @JsonProperty("path") String path, @JsonProperty("description") String description, @JsonProperty("link") String link) {
+        super(path, description);
+        this.name = name;
+        this.link = link;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
new file mode 100644
index 0000000..12114e6
--- /dev/null
+++ b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocHelpMessageBodyWriter.java
@@ -0,0 +1,28 @@
+/*
+ * 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.apidoc;
+
+import javax.ws.rs.ext.Provider;
+
+import com.wordnik.swagger.jaxrs.ApiHelpMessageBodyWriter;
+
+/** subclassed for convenience */
+@Provider
+public class ApidocHelpMessageBodyWriter extends ApiHelpMessageBodyWriter {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocResource.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocResource.java b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocResource.java
new file mode 100644
index 0000000..8c0c1de
--- /dev/null
+++ b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocResource.java
@@ -0,0 +1,291 @@
+/*
+ * 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.apidoc;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.Context;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.UriInfo;
+
+import com.google.common.collect.ImmutableList;
+import com.sun.jersey.api.core.ResourceConfig;
+import com.wordnik.swagger.core.Api;
+import com.wordnik.swagger.core.ApiOperation;
+import com.wordnik.swagger.core.Documentation;
+import com.wordnik.swagger.core.DocumentationEndPoint;
+import com.wordnik.swagger.jaxrs.ConfigReader;
+import com.wordnik.swagger.jaxrs.HelpApi;
+import com.wordnik.swagger.jaxrs.JaxrsApiReader;
+import com.wordnik.swagger.jaxrs.JaxrsApiSpecParser;
+
+@Produces({"application/json"})
+/** create a concrete subclass for this annotated with the Path where
+ * this resource should live 
+ * <p>
+ * like Swagger ApiListing (and based on that) but:
+ * supports singletons as well as classes;
+ * supports simpler Apidoc annotation (doesn't repeat path, in common case);
+ * doesn't support listingPath/Class that swagger does (but describes in under /apidoc/name.of.Class
+ * does not support auth filters
+ */
+abstract public class ApidocResource {
+
+    static ConfigReader configReader;
+    static {
+        JaxrsApiReader.setFormatString("");
+    }
+    
+    protected boolean isSupportedMediaType(String type) {
+        return "application/json".equals(type) || "application/xml".equals(type);
+    }
+    
+    protected boolean isIncludedForDocumentation(Class<?> resource) {
+        // TODO currently only support @Produces, not Contenty-type header, or Accept header (which original ApiListing does support)
+        Produces produces = getAnnotation(resource, Produces.class);
+        if (produces == null) return false;
+        for (String type: produces.value()) 
+            if (isSupportedMediaType(type))
+                return true;
+        return false;
+    }
+
+    protected <A extends Annotation> A getAnnotation(Class<?> r, Class<A> annotationClass) {
+        A result = r.getAnnotation(annotationClass);
+        if (result == null) {
+            // first look at things directly on superclass (not inherited)
+            if (r.getSuperclass()!=null)
+                result = r.getSuperclass().getAnnotation(annotationClass);
+        }
+        if (result == null) {
+            // then look at interfaces here (not inherited)
+            // we look at superclasses next so don't have to here
+            for(Class<?> parentInterface :  r.getInterfaces()) {
+                result = parentInterface.getAnnotation(annotationClass);
+                if (result != null) break;
+            }
+        }
+        if (result == null) {
+            // lastly take annotations on superclass and interfaces on superclass, recursively
+            // (so in short we prefer things lower down)
+            if (r.getSuperclass()!=null)
+                result = getAnnotation(r.getSuperclass(), annotationClass);
+        }
+        return result;
+    }
+    
+    protected String getLinkFor(String path, Class<?> resource) {
+        return getClass().getAnnotation(Path.class).value()+"/"+getLinkWordFor(resource);
+    }
+    
+    protected String getLinkWordFor(Class<?> resource) {
+        if (resource.getCanonicalName()!=null) 
+            return resource.getCanonicalName();        
+        else 
+            return Integer.toHexString(resource.hashCode());
+    }
+
+    protected Class<?> getResourceOfLink(ResourceConfig rc, String link) {
+        for (Class<?> r: getResourceClasses(rc)) {
+            if (getLinkWordFor(r).equals(link))
+                return r;
+        }
+        return null;
+    }
+    
+    @GET
+    @ApiOperation(value = "Returns list of all available API resource endpoints", 
+        responseClass = "ApidocRoot", multiValueResponse = true)
+    public Response getAllApis(
+            @Context ResourceConfig rc,
+            @Context HttpHeaders headers,
+            @Context UriInfo uriInfo) {
+
+        String apiVersion = getConfigReader().getApiVersion();
+        String swaggerVersion = getConfigReader().getSwaggerVersion();
+        String basePath = getConfigReader().getBasePath();
+
+        Set<Class<?>> resources = getResourceClasses(rc);
+
+        ApidocRoot allApiDoc = new ApidocRoot();
+
+        List<ApidocEndpoint> endpoints = new ArrayList<ApidocEndpoint>();
+        for (Class<?> resource : resources) {
+            if (!isIncludedForDocumentation(resource))
+                continue;
+            
+            Apidoc apidoc = getAnnotation(resource, Apidoc.class);
+            Api apidocX = getAnnotation(resource, Api.class);
+            Path rsPath = getAnnotation(resource, Path.class);
+
+            if (apidoc==null && apidocX == null) continue;
+            String path = rsPath.value();
+            String name = null;
+            String description;
+
+            if (apidoc!=null) {
+                name = apidoc.value();
+                description = apidoc.description();
+            } else {
+                path = apidocX.value();
+                description = apidocX.description();
+            }
+
+            endpoints.add(new ApidocEndpoint(name, path, description, getLinkFor(path, resource)));
+        }
+        
+        Collections.sort(endpoints, ApidocEndpoint.COMPARATOR);
+        
+        for (ApidocEndpoint api: endpoints) {
+            if (!isApiAdded(allApiDoc, api)) {
+                allApiDoc.addApi(api);
+            }
+        }
+        allApiDoc.setSwaggerVersion(swaggerVersion);
+        allApiDoc.setBasePath(basePath);
+        allApiDoc.setApiVersion(apiVersion);
+
+        return Response.ok().entity(allApiDoc).build();
+    }
+
+    protected Set<Class<?>> getResourceClasses(ResourceConfig rc) {
+        Set<Class<?>> resourceClasses = rc.getRootResourceClasses();
+        Set<Object> resourceObjects = rc.getRootResourceSingletons();
+        
+        Set<Class<?>> resources = new LinkedHashSet<Class<?>>();
+        // @Path should always be set, right? unless something is oddd
+        for (Class<?> r: resourceClasses)
+            if (r.getAnnotation(Path.class)!=null) resources.add(r);
+        for (Object r: resourceObjects) {
+            if (getAnnotation(r.getClass(), Path.class)!=null) {
+                resources.add(r.getClass());
+            }            
+        }
+        return resources;
+    }
+
+    private boolean isApiAdded(Documentation allApiDoc, DocumentationEndPoint endpoint) {
+        boolean isAdded = false;
+        if (allApiDoc.getApis() != null) {
+            for (DocumentationEndPoint addedApi : allApiDoc.getApis()) {
+                if (endpoint.getPath().equals(addedApi.getPath())) isAdded = true;
+            }
+        }
+        return isAdded;
+    }
+
+    @GET
+    @Path("/{resource}")
+    @ApiOperation(value = "Returns detail on the given API resource endpoint", 
+        responseClass = "DocumentationEndPoint", multiValueResponse = true)
+    public Response details(
+            @Context ResourceConfig rc, 
+            @Context HttpHeaders headers, 
+            @Context UriInfo uriInfo,
+            @PathParam("resource") String resource) {
+        Class<?> target = getResourceOfLink(rc, resource);
+        if (target==null) return Response.status(Response.Status.NOT_FOUND).build();
+        
+        // roughly duplicates JavaHelp
+        String apiVersion = getConfigReader().getApiVersion();
+        String swaggerVersion = getConfigReader().getSwaggerVersion();
+        String basePath = getConfigReader().getBasePath();
+
+        String apiFilterClassName = getConfigReader().getApiFilterClassName();
+
+        Apidoc apidoc = getAnnotation(target, Apidoc.class);
+        Api apidocX = getAnnotation(target, Api.class);
+        Path rsPath = getAnnotation(target, Path.class);
+
+        if ((apidoc==null && apidocX==null) || rsPath==null)
+            return Response.status(Response.Status.NOT_FOUND).build();
+
+        String apiPath = apidoc!=null ? rsPath.value() : apidocX.value();
+
+        HelpApi helpApi = new HelpApi(apiFilterClassName);
+        Documentation doc = read(target, apiVersion, swaggerVersion, basePath, apiPath);
+        Documentation docs = helpApi.filterDocs(doc, headers, uriInfo, apiPath, apiPath);
+        return Response.ok().entity(docs).build();
+    }
+
+
+    
+    
+    // items below here simply override the swagger Jaxrs* classes/behaviour so we can use @Path/@Apidoc instead of @Api
+    
+    protected ConfigReader getConfigReader() {
+        if (configReader==null) configReader = new ConfigReader(null);
+        return configReader;
+    }
+
+    static protected Map<Class<?>,Documentation> endpointsCache = new LinkedHashMap<Class<?>, Documentation>();
+            
+    protected Documentation read(Class<?> target, String apiVersion, String swaggerVersion, String basePath, String apiPath) {
+        Documentation result = endpointsCache.get(target);
+        if (result!=null) return result;
+        JaxrsApiSpecParser parser = new ApidocJaxrsSpecParser(target, apiVersion, swaggerVersion, basePath, apiPath);
+        result = parser.parse();
+        endpointsCache.put(target, result);
+        return result;
+    }
+
+    @Api("ignored")
+    static class ApidocJaxrsSpecParser extends JaxrsApiSpecParser {
+        public ApidocJaxrsSpecParser(Class<?> target, String apiVersion, String swaggerVersion, String basePath, String apiPath) {
+            super(target, apiVersion, swaggerVersion, basePath, apiPath);
+        }
+        @Override
+        public Api apiEndpoint() {
+            // return an ignored item; all clients do is check it isn't null
+            return ApidocJaxrsSpecParser.class.getAnnotation(Api.class);
+        }
+        @Override
+        public Class<?> hostClass() {
+            // Overriding to make sure we have a look at the interfaces (Jersey jaxrs implementation doesn't bother)
+            // Note this means we require the @Path class annotation on the same class as all the method annotations
+            for (Class<?> tryMe : ImmutableList.<Class<?>>builder().add(super.hostClass()).add(super.hostClass().getInterfaces()).build()) {
+                if (tryMe.getAnnotation(Path.class) != null) {
+                    return tryMe;                
+                }
+            }
+            return super.hostClass();
+        }
+        
+        public String getPath(Method method) {
+            Path cwsPath = hostClass().getAnnotation(Path.class);
+            Path mwsPath = method.getAnnotation(Path.class);
+            if (cwsPath==null) return null;
+            return cwsPath.value() + (mwsPath!=null ? mwsPath.value() : "");
+        }
+    }
+    
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f73a1af8/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocRoot.java
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocRoot.java b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocRoot.java
new file mode 100644
index 0000000..9229be4
--- /dev/null
+++ b/utils/rest-swagger/src/main/java/org/apache/brooklyn/rest/apidoc/ApidocRoot.java
@@ -0,0 +1,47 @@
+/*
+ * 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.apidoc;
+
+import java.util.List;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonSetter;
+
+import com.wordnik.swagger.core.Documentation;
+
+@JsonIgnoreProperties({
+    "com$wordnik$swagger$core$Documentation$$apis",
+    "com$wordnik$swagger$core$Documentation$$models"
+})
+public class ApidocRoot extends Documentation {
+
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @JsonProperty("apis")
+    public List<ApidocEndpoint> getApidocApis() {
+        return (List) getApis();
+    }
+    
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @JsonSetter("apis")
+    public void setApidocApis(List<ApidocEndpoint> ep) {
+        super.setApis((List)ep);
+    }
+    
+}


Mime
View raw message