brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [03/24] incubator-brooklyn git commit: [BROOKLYN-185] Move @Apidoc annotation out of utils-rest-swagger
Date Wed, 18 Nov 2015 23:42:47 GMT
[BROOKLYN-185] Move @Apidoc annotation out of utils-rest-swagger

The REST API and REST API documentation are different responsibilities
and should be split in two separate bundles. They can be aggregated
later on through the UI if needed.


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

Branch: refs/heads/master
Commit: f9ca422aeec6852b03bb1d61a0af3b64b2983b88
Parents: f0612bd
Author: Ciprian Ciubotariu <cheepeero@gmx.net>
Authored: Mon Nov 9 23:41:32 2015 +0200
Committer: Ciprian Ciubotariu <cheepeero@gmx.net>
Committed: Wed Nov 11 17:42:42 2015 +0200

----------------------------------------------------------------------
 .../rest/resource/ApidocRestResource.java       |  2 +-
 .../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 +-
 pom.xml                                         |  1 +
 usage/rest-api/pom.xml                          |  6 +--
 .../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 +-
 .../brooklyn/rest/resources/ApidocResource.java |  2 +-
 utils/rest-swagger/pom.xml                      |  7 ++++
 .../org/apache/brooklyn/rest/apidoc/Apidoc.java | 33 ---------------
 .../brooklyn/rest/apidoc/ApidocResource.java    |  3 +-
 utils/swagger-annotations/pom.xml               | 44 ++++++++++++++++++++
 .../brooklyn/swagger/annotations/Apidoc.java    | 33 +++++++++++++++
 31 files changed, 112 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApidocRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApidocRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApidocRestResource.java
index 398ad17..57ae02a 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApidocRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApidocRestResource.java
@@ -20,7 +20,7 @@ package org.apache.brooklyn.camp.server.rest.resource;
 
 import javax.ws.rs.Path;
 
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 @Path(ApidocRestResource.API_URI_PATH)
 @Apidoc("Web API Documentation")

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentRestResource.java
index 8d2f8d1..973cc02 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentRestResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
 import org.apache.brooklyn.camp.server.dto.ApplicationComponentDto;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentTemplateRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentTemplateRestResource.java
index 3ce76e7..44ac3b3 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/ApplicationComponentTemplateRestResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
 import org.apache.brooklyn.camp.server.dto.ApplicationComponentTemplateDto;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyRestResource.java
index 100bbf9..308bf48 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyRestResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
 import org.apache.brooklyn.camp.server.dto.AssemblyDto;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyTemplateRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyTemplateRestResource.java
index fc5c4fc..0636904 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/AssemblyTemplateRestResource.java
@@ -34,7 +34,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.camp.server.dto.AssemblyTemplateDto;
 import org.apache.brooklyn.camp.spi.Assembly;
 import org.apache.brooklyn.camp.spi.AssemblyTemplate;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 import org.apache.brooklyn.util.exceptions.Exceptions;
 
 import com.wordnik.swagger.core.ApiOperation;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentRestResource.java
index 9bc725b..5053c41 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentRestResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
 import org.apache.brooklyn.camp.server.dto.PlatformComponentDto;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentTemplateRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentTemplateRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentTemplateRestResource.java
index c3686be..e3a253d 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentTemplateRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformComponentTemplateRestResource.java
@@ -24,7 +24,7 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 
 import org.apache.brooklyn.camp.server.dto.PlatformComponentTemplateDto;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 import com.wordnik.swagger.core.ApiParam;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformRestResource.java
----------------------------------------------------------------------
diff --git a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformRestResource.java
b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformRestResource.java
index 16dfa25..6eff66b 100644
--- a/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformRestResource.java
+++ b/camp/camp-server/src/main/java/org/apache/brooklyn/camp/server/rest/resource/PlatformRestResource.java
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 import org.apache.brooklyn.camp.server.dto.PlatformDto;
 import org.apache.brooklyn.camp.server.rest.util.WebResourceUtils;
 import org.apache.brooklyn.camp.spi.AssemblyTemplate;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import com.wordnik.swagger.core.ApiOperation;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7619d1e..19be2bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -245,6 +245,7 @@
         <module>utils/jmx/jmxrmi-agent</module>
         <module>utils/test-support</module>
         <module>utils/rest-swagger</module>
+        <module>utils/swagger-annotations</module>
 
         <module>utils/rt-osgi</module>
         <module>utils/rt-felix</module>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/usage/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/usage/rest-api/pom.xml b/usage/rest-api/pom.xml
index 4d20ea0..0b3e130 100644
--- a/usage/rest-api/pom.xml
+++ b/usage/rest-api/pom.xml
@@ -63,10 +63,6 @@
             <artifactId>commons-lang</artifactId>
         </dependency>
         <dependency>
-            <groupId>com.wordnik</groupId>
-            <artifactId>swagger-core_2.9.1</artifactId>
-        </dependency>
-        <dependency>
             <groupId>javax.servlet</groupId>
             <artifactId>javax.servlet-api</artifactId>
         </dependency>
@@ -87,7 +83,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.brooklyn</groupId>
-            <artifactId>brooklyn-utils-rest-swagger</artifactId>
+            <artifactId>brooklyn-swagger-annotations</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/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 fa8f9cd..5c3493b 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 84dcfe8..e41b12d 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 a68bc75..6a0d345 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 fcbf337..004cc1b 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 ef5cdbe..07c0ed1 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 4546471..b614499 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 43b36c2..2826023 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 f902214..adddebf 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 e70738a..3b3f8c9 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 9ebe07b..da5ca86 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 6fe2bc9..bd0491b 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 ca29516..69517dc 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 84e7102..b36f557 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 org.apache.brooklyn.api.mgmt.ha.HighAvailabilityMode;
 import org.apache.brooklyn.api.mgmt.ha.ManagementNodeState;
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 8684dd6..f8773cd 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.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/f9ca422a/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 8e6d966..4c9f05f 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 org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 import com.wordnik.swagger.core.ApiOperation;
 
 import javax.ws.rs.Consumes;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/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 0ed4ec5..500c93c 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,7 +18,7 @@
  */
 package org.apache.brooklyn.rest.resources;
 
-import org.apache.brooklyn.rest.apidoc.Apidoc;
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 
 import javax.ws.rs.Path;
 

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/utils/rest-swagger/pom.xml
----------------------------------------------------------------------
diff --git a/utils/rest-swagger/pom.xml b/utils/rest-swagger/pom.xml
index 4584edc..eea644a 100644
--- a/utils/rest-swagger/pom.xml
+++ b/utils/rest-swagger/pom.xml
@@ -66,6 +66,13 @@
             <artifactId>brooklyn-utils-common</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <dependency>
+            <groupId>org.apache.brooklyn</groupId>
+            <artifactId>brooklyn-swagger-annotations</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         
         <dependency>
             <groupId>org.apache.brooklyn</groupId>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/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
deleted file mode 100644
index 9f6b90c..0000000
--- a/utils/rest-swagger/src/main/java/org/apache/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 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/f9ca422a/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
index 8c0c1de..3461f79 100644
--- 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
@@ -18,6 +18,7 @@
  */
 package org.apache.brooklyn.rest.apidoc;
 
+import org.apache.brooklyn.swagger.annotations.Apidoc;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 import java.util.ArrayList;
@@ -138,7 +139,7 @@ abstract public class ApidocResource {
 
         ApidocRoot allApiDoc = new ApidocRoot();
 
-        List<ApidocEndpoint> endpoints = new ArrayList<ApidocEndpoint>();
+        List<ApidocEndpoint> endpoints = new ArrayList<>();
         for (Class<?> resource : resources) {
             if (!isIncludedForDocumentation(resource))
                 continue;

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/utils/swagger-annotations/pom.xml
----------------------------------------------------------------------
diff --git a/utils/swagger-annotations/pom.xml b/utils/swagger-annotations/pom.xml
new file mode 100644
index 0000000..36e5959
--- /dev/null
+++ b/utils/swagger-annotations/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>brooklyn-swagger-annotations</artifactId>
+    <name>Brooklyn Swagger Annotations</name>
+
+    <description>
+        Swagger-like annotations developed for Brooklyn but not dependendent on Brooklyn
+    </description>
+
+    <parent>
+        <groupId>org.apache.brooklyn</groupId>
+        <artifactId>brooklyn-parent</artifactId>
+        <version>0.9.0-SNAPSHOT</version>  <!-- BROOKLYN_VERSION -->
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.wordnik</groupId>
+            <artifactId>swagger-core_2.9.1</artifactId>
+        </dependency>
+    </dependencies>
+
+</project>

http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/f9ca422a/utils/swagger-annotations/src/main/java/org/apache/brooklyn/swagger/annotations/Apidoc.java
----------------------------------------------------------------------
diff --git a/utils/swagger-annotations/src/main/java/org/apache/brooklyn/swagger/annotations/Apidoc.java
b/utils/swagger-annotations/src/main/java/org/apache/brooklyn/swagger/annotations/Apidoc.java
new file mode 100644
index 0000000..a9263c2
--- /dev/null
+++ b/utils/swagger-annotations/src/main/java/org/apache/brooklyn/swagger/annotations/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.swagger.annotations;
+
+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
+}


Mime
View raw message