cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sea...@apache.org
Subject svn commit: r634376 - in /incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs: basic/src/demo/jaxrs/server/ basic_https/src/demo/jaxrs/server/ content_negotiation/src/demo/jaxrs/server/
Date Thu, 06 Mar 2008 18:20:10 GMT
Author: seanoc
Date: Thu Mar  6 10:19:55 2008
New Revision: 634376

URL: http://svn.apache.org/viewvc?rev=634376&view=rev
Log:
Modified demos to be able to compile and run against jsr311 0.5 api's

Modified:
    incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/CustomerService.java
    incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/Order.java
    incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic_https/src/demo/jaxrs/server/CustomerService.java
    incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/content_negotiation/src/demo/jaxrs/server/CustomerService.java

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/CustomerService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/CustomerService.java?rev=634376&r1=634375&r2=634376&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/CustomerService.java
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/CustomerService.java
Thu Mar  6 10:19:55 2008
@@ -21,12 +21,14 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.ws.rs.HttpMethod;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;import javax.ws.rs.Path;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
 import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
 import javax.ws.rs.core.Response;
 
-@UriTemplate("/customerservice/")
+@Path("/customerservice/")
 public class CustomerService {
     long currentId = 123;
     Map<Long, Customer> customers = new HashMap<Long, Customer>();
@@ -36,8 +38,8 @@
         init();
     }
 
-    @HttpMethod("GET")
-    @UriTemplate("/customers/{id}/")
+    @GET
+    @Path("/customers/{id}/")
     public Customer getCustomer(@UriParam("id") String id) {
         System.out.println("----invoking getCustomer, Customer id is: " + id);
         long idNumber = Long.parseLong(id);
@@ -45,35 +47,35 @@
         return c;
     }
 
-    @HttpMethod("PUT")
-    @UriTemplate("/customers/")
+    @PUT
+    @Path("/customers/")
     public Response updateCustomer(Customer customer) {
         System.out.println("----invoking updateCustomer, Customer name is: " + customer.getName());
         Customer c = customers.get(customer.getId());
         Response r;
         if (c != null) {
             customers.put(customer.getId(), customer);
-            r = Response.Builder.ok().build();
+            r = Response.ok().build();
         } else {
-            r = Response.Builder.notModified().build();
+            r = Response.notModified().build();
         }
 
         return r;
     }
 
-    @HttpMethod("POST")
-    @UriTemplate("/customers/")
+    @POST
+    @Path("/customers/")
     public Response addCustomer(Customer customer) {
         System.out.println("----invoking addCustomer, Customer name is: " + customer.getName());
         customer.setId(++currentId);
 
         customers.put(customer.getId(), customer);
 
-        return Response.Builder.ok(customer).build();
+        return Response.ok(customer).build();
     }
 
-    @HttpMethod("DELETE")
-    @UriTemplate("/customers/{id}/")
+    @DELETE
+    @Path("/customers/{id}/")
     public Response deleteCustomer(@UriParam("id") String id) {
         System.out.println("----invoking deleteCustomer, Customer id is: " + id);
         long idNumber = Long.parseLong(id);
@@ -81,16 +83,16 @@
 
         Response r;
         if (c != null) {
-            r = Response.Builder.ok().build();
+            r = Response.ok().build();
             customers.remove(idNumber);
         } else {
-            r = Response.Builder.notModified().build();
+            r = Response.notModified().build();
         }
 
         return r;
     }
 
-    @UriTemplate("/orders/{orderId}/")
+    @Path("/orders/{orderId}/")
     public Order getOrder(@UriParam("orderId") String orderId) {
         System.out.println("----invoking getOrder, Order id is: " + orderId);
         long idNumber = Long.parseLong(orderId);

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/Order.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/Order.java?rev=634376&r1=634375&r2=634376&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/Order.java
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic/src/demo/jaxrs/server/Order.java
Thu Mar  6 10:19:55 2008
@@ -20,9 +20,10 @@
 
 import java.util.HashMap;
 import java.util.Map;
-import javax.ws.rs.HttpMethod;
+import javax.ws.rs.GET;
 import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
+import javax.ws.rs.Path;
+
 import javax.xml.bind.annotation.XmlRootElement;
 
 @XmlRootElement(name = "Order")
@@ -51,8 +52,8 @@
         this.description = d;
     }
 
-    @HttpMethod("GET")
-    @UriTemplate("products/{productId}/")
+    @GET
+    @Path("products/{productId}/")
     public Product getProduct(@UriParam("productId")int productId) {
         System.out.println("----invoking getProduct with id: " + productId);
         Product p = products.get(new Long(productId));

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic_https/src/demo/jaxrs/server/CustomerService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic_https/src/demo/jaxrs/server/CustomerService.java?rev=634376&r1=634375&r2=634376&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic_https/src/demo/jaxrs/server/CustomerService.java
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/basic_https/src/demo/jaxrs/server/CustomerService.java
Thu Mar  6 10:19:55 2008
@@ -21,12 +21,15 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.ws.rs.HttpMethod;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
 import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
 import javax.ws.rs.core.Response;
 
-@UriTemplate("/customerservice/")
+@Path("/customerservice/")
 public class CustomerService {
     long currentId = 123;
     Map<Long, Customer> customers = new HashMap<Long, Customer>();
@@ -35,8 +38,8 @@
         init();
     }
 
-    @HttpMethod("GET")
-    @UriTemplate("/customers/{id}/")
+    @GET
+    @Path("/customers/{id}/")
     public Customer getCustomer(@UriParam("id") String id) {
         System.out.println("----invoking getCustomer, Customer id is: " + id);
         long idNumber = Long.parseLong(id);
@@ -44,35 +47,35 @@
         return c;
     }
 
-    @HttpMethod("PUT")
-    @UriTemplate("/customers/")
+    @PUT
+    @Path("/customers/")
     public Response updateCustomer(Customer customer) {
         System.out.println("----invoking updateCustomer, Customer name is: " + customer.getName());
         Customer c = customers.get(customer.getId());
         Response r;
         if (c != null) {
             customers.put(customer.getId(), customer);
-            r = Response.Builder.ok().build();
+            r = Response.ok().build();
         } else {
-            r = Response.Builder.notModified().build();
+            r = Response.notModified().build();
         }
 
         return r;
     }
 
-    @HttpMethod("POST")
-    @UriTemplate("/customers/")
+    @POST
+    @Path("/customers/")
     public Response addCustomer(Customer customer) {
         System.out.println("----invoking addCustomer, Customer name is: " + customer.getName());
         customer.setId(++currentId);
 
         customers.put(customer.getId(), customer);
 
-        return Response.Builder.ok(customer).build();
+        return Response.ok(customer).build();
     }
 
-    @HttpMethod("DELETE")
-    @UriTemplate("/customers/{id}/")
+    @DELETE
+    @Path("/customers/{id}/")
     public Response deleteCustomer(@UriParam("id") String id) {
         System.out.println("----invoking deleteCustomer, Customer id is: " + id);
         long idNumber = Long.parseLong(id);
@@ -80,10 +83,10 @@
 
         Response r;
         if (c != null) {
-            r = Response.Builder.ok().build();
+            r = Response.ok().build();
             customers.remove(idNumber);
         } else {
-            r = Response.Builder.notModified().build();
+            r = Response.notModified().build();
         }
 
         return r;

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/content_negotiation/src/demo/jaxrs/server/CustomerService.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/content_negotiation/src/demo/jaxrs/server/CustomerService.java?rev=634376&r1=634375&r2=634376&view=diff
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/content_negotiation/src/demo/jaxrs/server/CustomerService.java
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/jax_rs/content_negotiation/src/demo/jaxrs/server/CustomerService.java
Thu Mar  6 10:19:55 2008
@@ -21,11 +21,12 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import javax.ws.rs.HttpMethod;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
 import javax.ws.rs.UriParam;
-import javax.ws.rs.UriTemplate;
 
-@UriTemplate("/customerservice/")
+
+@Path("/customerservice/")
 public class CustomerService {
     long currentId = 123;
     Map<Long, Customer> customers = new HashMap<Long, Customer>();
@@ -34,8 +35,8 @@
         init();
     }
 
-    @HttpMethod("GET")
-    @UriTemplate("/customers/{id}/")
+    @GET
+    @Path("/customers/{id}/")
     public Customer getCustomer(@UriParam("id") String id) {
         System.out.println("----invoking getCustomer, Customer id is: " + id);
         long idNumber = Long.parseLong(id);



Mime
View raw message