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/ba900f72 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ba900f72 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ba900f72 Branch: refs/heads/master Commit: ba900f721100efd93ff067165802f4c5051c5cb1 Parents: 7716435 Author: Claus Ibsen <davscl...@apache.org> Authored: Wed Dec 17 10:15:38 2014 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Wed Dec 17 10:15:38 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/ba900f72/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 8966dea..18811dc 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 @@ -48,6 +48,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; @@ -108,6 +116,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; } @@ -225,21 +265,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");