1 package net.ramapuram.thomas.service;
2
3 import net.ramapuram.thomas.model.User;
4
5 import javax.jws.WebService;
6 import javax.ws.rs.DELETE;
7 import javax.ws.rs.GET;
8 import javax.ws.rs.POST;
9 import javax.ws.rs.Path;
10 import javax.ws.rs.PathParam;
11 import javax.ws.rs.Produces;
12 import java.util.List;
13
14
15
16
17 @WebService
18 @Path("/")
19 @Produces({"application/json", "application/xml"})
20 public interface UserService {
21
22
23
24
25
26
27 @GET
28 @Path("/user/{id}")
29 User getUser(@PathParam("id") String userId);
30
31
32
33
34
35
36
37 @GET
38 @Path("/{username}")
39 User getUserByUsername(@PathParam("username") String username);
40
41
42
43
44
45
46 @GET
47 @Path("/users")
48 List<User> getUsers();
49
50
51
52
53
54
55
56
57 @POST
58 @Path("/user")
59 User saveUser(User user) throws UserExistsException;
60
61
62
63
64
65
66 @DELETE
67 @Path("/user")
68 void removeUser(String userId);
69 }