001    /**
002     * Copyright 2005-2011 The Kuali Foundation
003     *
004     * Licensed under the Educational Community License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at
007     *
008     * http://www.opensource.org/licenses/ecl2.php
009     *
010     * Unless required by applicable law or agreed to in writing, software
011     * distributed under the License is distributed on an "AS IS" BASIS,
012     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013     * See the License for the specific language governing permissions and
014     * limitations under the License.
015     */
016    package org.kuali.rice.ksb.messaging.remotedservices;
017    
018    import java.util.List;
019    
020    import javax.ws.rs.Consumes;
021    import javax.ws.rs.DELETE;
022    import javax.ws.rs.GET;
023    import javax.ws.rs.POST;
024    import javax.ws.rs.PUT;
025    import javax.ws.rs.Path;
026    import javax.ws.rs.PathParam;
027    
028    /**
029     * JAX-RS annotated interface for a baseball card collection service which might track the 
030     * cards in a collection.
031     * 
032     * @author Kuali Rice Team (rice.collab@kuali.org)
033     *
034     */
035    @Path("/")
036    public interface BaseballCardCollectionService {
037        
038        @GET
039        public List<BaseballCard> getAll();
040    
041        /**
042         * gets a card by it's (arbitrary) identifier
043         */
044        @GET
045        @Path("/BaseballCard/id/{id}")
046        public BaseballCard get(@PathParam("id") Integer id);
047        
048        /**
049         * gets all the cards in the collection with the given player name
050         */
051        @GET
052        @Path("/BaseballCard/playerName/{playerName}")
053        public List<BaseballCard> get(@PathParam("playerName") String playerName);
054    
055        /**
056         * Add a card to the collection.  This is a non-idempotent method 
057         * (because you can more one of the same card), so we'll use @POST
058         * @return the (arbitrary) numerical identifier assigned to this card by the service
059         */
060        @POST
061        @Path("/BaseballCard")
062        public Integer add(BaseballCard card);
063    
064        
065        /**
066         * update the card for the given identifier.  This will replace the card that was previously
067         * associated with that identifier.
068         */
069        @PUT
070        @Path("/BaseballCard/id/{id}")
071        @Consumes("application/xml")
072        public void update(@PathParam("id") Integer id, BaseballCard card);
073    
074        /**
075         * delete the card with the given identifier.
076         */
077        @DELETE
078        @Path("/BaseballCard/id/{id}")
079        public void delete(@PathParam("id") Integer id);
080        
081        /**
082         * This method lacks JAX-RS annotations
083         */
084        public void unannotatedMethod();
085        
086    }