View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.ksb.messaging.remotedservices;
17  
18  import java.util.List;
19  
20  import javax.ws.rs.Consumes;
21  import javax.ws.rs.DELETE;
22  import javax.ws.rs.GET;
23  import javax.ws.rs.POST;
24  import javax.ws.rs.PUT;
25  import javax.ws.rs.Path;
26  import javax.ws.rs.PathParam;
27  
28  /**
29   * JAX-RS annotated interface for a baseball card collection service which might track the 
30   * cards in a collection.
31   * 
32   * @author Kuali Rice Team (rice.collab@kuali.org)
33   *
34   */
35  @Path("/")
36  public interface BaseballCardCollectionService {
37      
38      @GET
39      public List<BaseballCard> getAll();
40  
41      /**
42       * gets a card by it's (arbitrary) identifier
43       */
44      @GET
45      @Path("/BaseballCard/id/{id}")
46      public BaseballCard get(@PathParam("id") Integer id);
47      
48      /**
49       * gets all the cards in the collection with the given player name
50       */
51      @GET
52      @Path("/BaseballCard/playerName/{playerName}")
53      public List<BaseballCard> get(@PathParam("playerName") String playerName);
54  
55      /**
56       * Add a card to the collection.  This is a non-idempotent method 
57       * (because you can more one of the same card), so we'll use @POST
58       * @return the (arbitrary) numerical identifier assigned to this card by the service
59       */
60      @POST
61      @Path("/BaseballCard")
62      public Integer add(BaseballCard card);
63  
64      
65      /**
66       * update the card for the given identifier.  This will replace the card that was previously
67       * associated with that identifier.
68       */
69      @PUT
70      @Path("/BaseballCard/id/{id}")
71      @Consumes("application/xml")
72      public void update(@PathParam("id") Integer id, BaseballCard card);
73  
74      /**
75       * delete the card with the given identifier.
76       */
77      @DELETE
78      @Path("/BaseballCard/id/{id}")
79      public void delete(@PathParam("id") Integer id);
80      
81      /**
82       * This method lacks JAX-RS annotations
83       */
84      public void unannotatedMethod();
85      
86  }