You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/12/17 10:57:16 UTC

camel git commit: CAMEL-8313: rest-dsl expose optional description, routeId etc as uri options.

Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x 3fbaa01ea -> 99da27cab


CAMEL-8313: rest-dsl expose optional description,routeId etc as uri options.


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

Branch: refs/heads/camel-2.14.x
Commit: 99da27cab2911bf265399636bed3210d7f21a6d4
Parents: 3fbaa01
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Dec 17 10:15:38 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Dec 17 10:56:30 2014 +0100

----------------------------------------------------------------------
 .../camel/component/rest/RestEndpoint.java      | 52 +++++++++++++++-----
 1 file changed, 41 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/99da27ca/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
index 659971e..ce7d675 100644
--- a/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
+++ b/camel-core/src/main/java/org/apache/camel/component/rest/RestEndpoint.java
@@ -47,6 +47,14 @@ public class RestEndpoint extends DefaultEndpoint {
     private String produces;
     @UriParam
     private String componentName;
+    @UriParam
+    private String inType;
+    @UriParam
+    private String outType;
+    @UriParam
+    private String routeId;
+    @UriParam
+    private String description;
 
     private Map<String, Object> parameters;
 
@@ -107,6 +115,38 @@ public class RestEndpoint extends DefaultEndpoint {
         this.componentName = componentName;
     }
 
+    public String getInType() {
+        return inType;
+    }
+
+    public void setInType(String inType) {
+        this.inType = inType;
+    }
+
+    public String getOutType() {
+        return outType;
+    }
+
+    public void setOutType(String outType) {
+        this.outType = outType;
+    }
+
+    public String getRouteId() {
+        return routeId;
+    }
+
+    public void setRouteId(String routeId) {
+        this.routeId = routeId;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
     public Map<String, Object> getParameters() {
         return parameters;
     }
@@ -224,21 +264,11 @@ public class RestEndpoint extends DefaultEndpoint {
                 }
             }
 
-            // optional binding type information
-            String inType = (String) getParameters().get("inType");
-            String outType = (String) getParameters().get("outType");
-
-            // the route id when using rest-dsl
-            String routeId = (String) getParameters().get("routeId");
-
-            // optional description
-            String description = (String) getParameters().get("description");
-
             // add to rest registry so we can keep track of them, we will remove from the registry when the consumer is removed
             // the rest registry will automatic keep track when the consumer is removed,
             // and un-register the REST service from the registry
             getCamelContext().getRestRegistry().addRestService(consumer, url, baseUrl, getPath(), getUriTemplate(), getMethod(),
-                    getConsumes(), getProduces(), inType, outType, routeId, description);
+                    getConsumes(), getProduces(), getInType(), getOutType(), getRouteId(), getDescription());
             return consumer;
         } else {
             throw new IllegalStateException("Cannot find RestConsumerFactory in Registry or as a Component to use");