Mercurial > lada > lada-server
comparison src/main/java/de/intevation/lada/rest/InfoService.java @ 272:0ddcc6240d47 0.2
Added Info class to serve general information on the server application.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Thu, 25 Jul 2013 14:23:44 +0200 |
parents | f7b5ff46f3e7 |
children | 7c268f742553 |
comparison
equal
deleted
inserted
replaced
271:f7b5ff46f3e7 | 272:0ddcc6240d47 |
---|---|
10 import javax.ws.rs.core.HttpHeaders; | 10 import javax.ws.rs.core.HttpHeaders; |
11 import javax.ws.rs.core.UriInfo; | 11 import javax.ws.rs.core.UriInfo; |
12 | 12 |
13 import de.intevation.lada.auth.Authentication; | 13 import de.intevation.lada.auth.Authentication; |
14 import de.intevation.lada.auth.AuthenticationException; | 14 import de.intevation.lada.auth.AuthenticationException; |
15 | |
16 class Info { | |
17 String user; | |
18 String groups; | |
19 String version; | |
20 public Info(String user, String groups, String version) { | |
21 this.user = user; | |
22 this.groups = groups; | |
23 this.version = version; | |
24 } | |
25 public String getUser() { | |
26 return user; | |
27 } | |
28 public void setUser(String user) { | |
29 this.user = user; | |
30 } | |
31 public String getGroups() { | |
32 return groups; | |
33 } | |
34 public void setGroups(String groups) { | |
35 this.groups = groups; | |
36 } | |
37 public String getVersion() { | |
38 return version; | |
39 } | |
40 public void setVersion(String version) { | |
41 this.version = version; | |
42 } | |
43 } | |
15 | 44 |
16 /** | 45 /** |
17 * This class produces a RESTful service to read, write and update | 46 * This class produces a RESTful service to read, write and update |
18 * LOrt objects. | 47 * LOrt objects. |
19 * | 48 * |
47 ) { | 76 ) { |
48 try { | 77 try { |
49 if (!authentication.isAuthorizedUser(headers)) { | 78 if (!authentication.isAuthorizedUser(headers)) { |
50 return new Response(false, 699, null); | 79 return new Response(false, 699, null); |
51 } | 80 } |
52 Response response = new Response(true, 200, null); | 81 Response response = new Response(true, 200, new Info("-/-", "-/-", "-/-")); |
53 return response; | 82 return response; |
54 } | 83 } |
55 catch(AuthenticationException ae) { | 84 catch(AuthenticationException ae) { |
56 return new Response(false, 699, null); | 85 return new Response(false, 699, null); |
57 } | 86 } |