camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/8] camel git commit: CAMEL-10561: camel-catalog - Add REST JAX-RS application
Date Tue, 06 Dec 2016 11:57:48 GMT
CAMEL-10561: camel-catalog - Add REST JAX-RS application


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/41d10de3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/41d10de3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/41d10de3

Branch: refs/heads/master
Commit: 41d10de3aef6f1eef72eeffc8d215b5702095d90
Parents: 799f90f
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 6 11:13:45 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 6 11:14:30 2016 +0100

----------------------------------------------------------------------
 .../camel/catalog/rest/CamelCatalogRest.java    | 277 ++++++++++++++++++-
 1 file changed, 275 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/41d10de3/platforms/catalog-rest/src/main/java/org/apache/camel/catalog/rest/CamelCatalogRest.java
----------------------------------------------------------------------
diff --git a/platforms/catalog-rest/src/main/java/org/apache/camel/catalog/rest/CamelCatalogRest.java
b/platforms/catalog-rest/src/main/java/org/apache/camel/catalog/rest/CamelCatalogRest.java
index 8ed40a2..e2466d9 100644
--- a/platforms/catalog-rest/src/main/java/org/apache/camel/catalog/rest/CamelCatalogRest.java
+++ b/platforms/catalog-rest/src/main/java/org/apache/camel/catalog/rest/CamelCatalogRest.java
@@ -16,9 +16,11 @@
  */
 package org.apache.camel.catalog.rest;
 
+import java.util.List;
 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 org.apache.camel.catalog.CamelCatalog;
@@ -28,7 +30,6 @@ import org.apache.camel.catalog.DefaultCamelCatalog;
  * A REST based {@link CamelCatalog} service as a JAX-RS resource class.
  */
 @Path("/camel-catalog")
-@Produces("application/json")
 public class CamelCatalogRest {
 
     private CamelCatalog catalog = new DefaultCamelCatalog(true);
@@ -45,11 +46,283 @@ public class CamelCatalogRest {
     }
 
     /**
-     * The GET order by id operation
+     * The version of this Camel Catalog
+     */
+    @GET
+    @Path("/catalogVersion")
+    public String getCatalogVersion() {
+        return catalog.getCatalogVersion();
+    }
+
+    /**
+     * Find all the component names from the Camel catalog
+     */
+    @GET
+    @Path("/findComponentNames")
+    @Produces("application/json")
+    public List<String> findComponentNames() {
+        return catalog.findComponentNames();
+    }
+
+    /**
+     * Find all the data format names from the Camel catalog
+     */
+    @GET
+    @Path("/findDataFormatNames")
+    @Produces("application/json")
+    public List<String> findDataFormatNames() {
+        return catalog.findDataFormatNames();
+    }
+
+    /**
+     * Find all the language names from the Camel catalog
+     */
+    @GET
+    @Path("/findLanguageNames")
+    @Produces("application/json")
+    public List<String> findLanguageNames() {
+        return catalog.findLanguageNames();
+
+    }
+
+    /**
+     * Find all the model names from the Camel catalog
+     */
+    @GET
+    @Path("/findModelNames")
+    @Produces("application/json")
+    public List<String> findModelNames() {
+        return catalog.findModelNames();
+    }
+
+    /**
+     * Find all the component names from the Camel catalog that matches the label
+     */
+    @GET
+    @Path("/findComponentNames/{filter}")
+    @Produces("application/json")
+    public List<String> findComponentNames(@PathParam("filter") String filter) {
+        return catalog.findComponentNames(filter);
+    }
+
+    /**
+     * Find all the data format names from the Camel catalog that matches the label
+     */
+    @GET
+    @Path("/findDataFormatNames/{filter}")
+    @Produces("application/json")
+    public List<String> findDataFormatNames(@PathParam("filter") String filter) {
+        return catalog.findDataFormatNames(filter);
+    }
+
+    /**
+     * Find all the language names from the Camel catalog that matches the label
+     */
+    @GET
+    @Path("/findLanguageNames/{filter}")
+    @Produces("application/json")
+    public List<String> findLanguageNames(@PathParam("filter") String filter) {
+        return catalog.findLanguageNames(filter);
+    }
+
+    /**
+     * Find all the model names from the Camel catalog that matches the label
+     */
+    @GET
+    @Path("/findModelNames/{filter}")
+    @Produces("application/json")
+    public List<String> findModelNames(@PathParam("filter") String filter) {
+        return catalog.findModelNames(filter);
+    }
+
+    /**
+     * Returns the component information as JSon format.
+     */
+    @GET
+    @Path("/componentJSonSchema/{name}")
+    @Produces("application/json")
+    public String componentJSonSchema(@PathParam("name") String name) {
+        return catalog.componentJSonSchema(name);
+    }
+
+    /**
+     * Returns the data format information as JSon format.
+     */
+    @GET
+    @Path("/dataFormatJSonSchema/{name}")
+    @Produces("application/json")
+    public String dataFormatJSonSchema(@PathParam("name") String name) {
+        return catalog.dataFormatJSonSchema(name);
+    }
+
+    /**
+     * Returns the language information as JSon format.
+     */
+    @GET
+    @Path("/languageJSonSchema/{name}")
+    @Produces("application/json")
+    public String languageJSonSchema(@PathParam("name") String name) {
+        return catalog.languageJSonSchema(name);
+    }
+
+    /**
+     * Returns the model information as JSon format.
+     */
+    @GET
+    @Path("/modelJSonSchema/{name}")
+    @Produces("application/json")
+    public String modelJSonSchema(@PathParam("name") String name) {
+        return catalog.modelJSonSchema(name);
+    }
+
+    /**
+     * Returns the component documentation as Ascii doc format.
+     */
+    @GET
+    @Path("/componentAsciiDoc/{name}")
+    @Produces("text/plain")
+    public String componentAsciiDoc(@PathParam("name") String name) {
+        return catalog.componentAsciiDoc(name);
+    }
+
+    /**
+     * Returns the data format documentation as Ascii doc format.
+     */
+    @GET
+    @Path("/dataFormatAsciiDoc/{name}")
+    @Produces("text/plain")
+    public String dataFormatAsciiDoc(@PathParam("name") String name) {
+        return catalog.dataFormatAsciiDoc(name);
+    }
+
+    /**
+     * Returns the language documentation as Ascii doc format.
+     */
+    @GET
+    @Path("/languageAsciiDoc/{name}")
+    @Produces("text/plain")
+    public String languageAsciiDoc(@PathParam("name") String name) {
+        return catalog.languageAsciiDoc(name);
+    }
+
+    /**
+     * Find all the unique label names all the components are using.
      */
     @GET
     @Path("/findComponentLabels")
+    @Produces("application/json")
     public Set<String> findComponentLabels() {
         return catalog.findComponentLabels();
     }
+
+    /**
+     * Find all the unique label names all the data formats are using.
+     */
+    @GET
+    @Path("/findDataFormatLabels")
+    @Produces("application/json")
+    public Set<String> findDataFormatLabels() {
+        return catalog.findDataFormatLabels();
+    }
+
+    /**
+     * Find all the unique label names all the data formats are using.
+     */
+    @GET
+    @Path("/findLanguageLabels")
+    @Produces("application/json")
+    public Set<String> findLanguageLabels() {
+        return catalog.findLanguageLabels();
+    }
+
+    /**
+     * Find all the unique label names all the models are using.
+     */
+    @GET
+    @Path("/findModelLabels")
+    @Produces("application/json")
+    public Set<String> findModelLabels() {
+        return catalog.findModelLabels();
+    }
+
+    /**
+     * Returns the Apache Camel Maven Archetype catalog in XML format.
+     */
+    @GET
+    @Path("/archetypeCatalogAsXml")
+    @Produces("application/xml")
+    public String archetypeCatalogAsXml() {
+        return catalog.archetypeCatalogAsXml();
+    }
+
+    /**
+     * Returns the Camel Spring XML schema
+     */
+    @GET
+    @Path("/springSchemaAsXml")
+    @Produces("application/xml")
+    public String springSchemaAsXml() {
+        return catalog.springSchemaAsXml();
+    }
+
+    /**
+     * Returns the Camel Blueprint XML schema
+     */
+    @GET
+    @Path("/blueprintSchemaAsXml")
+    @Produces("application/xml")
+    public String blueprintSchemaAsXml() {
+        return catalog.blueprintSchemaAsXml();
+    }
+
+    /**
+     * Lists all the components summary details in JSon
+     */
+    @GET
+    @Path("/listComponentsAsJson")
+    @Produces("application/json")
+    public String listComponentsAsJson() {
+        return catalog.listComponentsAsJson();
+    }
+
+    /**
+     * Lists all the data formats summary details in JSon
+     */
+    @GET
+    @Path("/listDataFormatsAsJson")
+    @Produces("application/json")
+    public String listDataFormatsAsJson() {
+        return catalog.listDataFormatsAsJson();
+    }
+
+    /**
+     * Lists all the languages summary details in JSon
+     */
+    @GET
+    @Path("/listLanguagesAsJson")
+    @Produces("application/json")
+    public String listLanguagesAsJson() {
+        return catalog.listLanguagesAsJson();
+    }
+
+    /**
+     * Lists all the models (EIPs) summary details in JSon
+     */
+    @GET
+    @Path("/listModelsAsJson")
+    @Produces("application/json")
+    public String listModelsAsJson() {
+        return catalog.listModelsAsJson();
+    }
+
+    /**
+     * Reports a summary what the catalog contains in JSon
+     */
+    @GET
+    @Path("/summaryAsJson")
+    @Produces("application/json")
+    public String summaryAsJson() {
+        return catalog.summaryAsJson();
+    }
+
 }


Mime
View raw message