camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r745551 - in /camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources: CamelContextResource.java EndpointResource.java EndpointsResource.java
Date Wed, 18 Feb 2009 16:06:00 GMT
Author: jstrachan
Date: Wed Feb 18 16:06:00 2009
New Revision: 745551

URL: http://svn.apache.org/viewvc?rev=745551&view=rev
Log:
minor refactoring to tidy up method names (as they are exposed in WADL)

Modified:
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/CamelContextResource.java
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointResource.java
    camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointsResource.java

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/CamelContextResource.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/CamelContextResource.java?rev=745551&r1=745550&r2=745551&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/CamelContextResource.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/CamelContextResource.java
Wed Feb 18 16:06:00 2009
@@ -17,32 +17,21 @@
 package org.apache.camel.rest.resources;
 
 
-import com.sun.jersey.api.representation.Form;
 import com.sun.jersey.api.view.ImplicitProduces;
 import com.sun.jersey.spi.inject.Inject;
 import com.sun.jersey.spi.resource.Singleton;
 import org.apache.camel.CamelContext;
-import org.apache.camel.Endpoint;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.model.RouteType;
 import org.apache.camel.model.RoutesType;
 import org.apache.camel.rest.model.Camel;
 import org.apache.camel.rest.model.EndpointLink;
-import org.apache.camel.rest.model.Endpoints;
 
 import javax.annotation.PreDestroy;
-import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import javax.ws.rs.core.Context;
-import java.net.URI;
-import java.net.URISyntaxException;
 import java.util.List;
 
 
@@ -101,7 +90,7 @@
     }
 
     public List<EndpointLink> getEndpoints() {
-        return getEndpointsResource().getEndpointsDTO().getEndpoints();
+        return getEndpointsResource().getDTO().getEndpoints();
     }
 
     /**

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointResource.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointResource.java?rev=745551&r1=745550&r2=745551&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointResource.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointResource.java
Wed Feb 18 16:06:00 2009
@@ -109,7 +109,7 @@
 
     @POST
     @Consumes("application/x-www-form-urlencoded")
-    public Response processForm(@Context HttpHeaders headers, Form formData) throws URISyntaxException
{
+    public Response postMessageForm(@Context HttpHeaders headers, Form formData) throws URISyntaxException
{
         System.out.println("Received form! " + formData);
         String body = formData.getFirst("text", String.class);
         sendMessage(headers, body);

Modified: camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointsResource.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointsResource.java?rev=745551&r1=745550&r2=745551&view=diff
==============================================================================
--- camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointsResource.java
(original)
+++ camel/trunk/components/camel-web/src/main/java/org/apache/camel/rest/resources/EndpointsResource.java
Wed Feb 18 16:06:00 2009
@@ -62,7 +62,7 @@
      */
     @GET
     @Produces({MediaType.TEXT_XML, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Endpoints getEndpointsDTO() {
+    public Endpoints getDTO() {
         return new Endpoints(camelContext);
     }
 
@@ -94,7 +94,7 @@
 
     @POST
     @Consumes(MediaType.TEXT_PLAIN)
-    public Response postMessage(String uri) throws URISyntaxException {
+    public Response postUri(String uri) throws URISyntaxException {
         EndpointResource endpoint = getEndpoint(uri);
         if (endpoint != null) {
             return Response.ok().build();
@@ -104,7 +104,7 @@
 
     @POST
     @Consumes("application/x-www-form-urlencoded")
-    public Response processForm(@Context UriInfo uriInfo, Form formData) throws URISyntaxException
{
+    public Response postUriForm(@Context UriInfo uriInfo, Form formData) throws URISyntaxException
{
         System.out.println("Received form! " + formData);
         newUri = formData.getFirst("uri", String.class);
         EndpointResource endpoint = getEndpoint(newUri);
@@ -127,7 +127,7 @@
     //-------------------------------------------------------------------------
 
     public List<EndpointLink> getEndpoints() {
-        return getEndpointsDTO().getEndpoints();
+        return getDTO().getEndpoints();
     }
 
     public String getError() {



Mime
View raw message