annotate src/main/java/de/intevation/lada/rest/OrtService.java @ 263:2098db2e8fbd M1

Code documentation.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 17 Jul 2013 09:40:53 +0200
parents f4b359aa9127
children 183f8116d9a6
rev   line source
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
1 package de.intevation.lada.rest;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
2
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
4
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
5 import javax.enterprise.context.RequestScoped;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
6 import javax.inject.Inject;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
7 import javax.inject.Named;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
8 import javax.ws.rs.Consumes;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
9 import javax.ws.rs.DELETE;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
10 import javax.ws.rs.GET;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
11 import javax.ws.rs.POST;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
12 import javax.ws.rs.PUT;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
13 import javax.ws.rs.Path;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
14 import javax.ws.rs.PathParam;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
15 import javax.ws.rs.Produces;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
16 import javax.ws.rs.core.Context;
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
17 import javax.ws.rs.core.HttpHeaders;
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
18
232
d8a3d188046f Renamed package authentication to auth.
Raimund Renkert <rrenkert@intevation.de>
parents: 210
diff changeset
19 import de.intevation.lada.auth.Authentication;
d8a3d188046f Renamed package authentication to auth.
Raimund Renkert <rrenkert@intevation.de>
parents: 210
diff changeset
20 import de.intevation.lada.auth.AuthenticationException;
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
21 import de.intevation.lada.data.Repository;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
22 import de.intevation.lada.model.Ort;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
23
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
24 /**
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
25 * This class produces a RESTful service to read, write and update
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
26 * Ort objects.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
27 *
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
28 * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
29 */
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
30 @Path("/ortinfo")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
31 @RequestScoped
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
32 public class OrtService
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
33 {
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
34 /**
263
2098db2e8fbd Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 262
diff changeset
35 * The Repository for Ort.
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
36 */
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
37 @Inject
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
38 @Named("ortrepository")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
39 private Repository repository;
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
40
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
41 /**
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
42 * The authorization module.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
43 */
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
44 @Inject
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
45 @Named("ldapauth")
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
46 private Authentication authentication;
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
47
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
48 /**
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
49 * Request a Ort object via its id.
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
50 *
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
51 * @param id The Ort id
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
52 * @param headers The HTTP header containing authorization information.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
53 * @return Response object.
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
54 */
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
55 @GET
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
56 @Path("/{id}")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
57 @Produces("text/json")
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
58 public Response findById(
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
59 @PathParam("id") String id,
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
60 @Context HttpHeaders headers
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
61 ) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
62 try {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
63 if (authentication.isAuthorizedUser(headers)) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
64 return repository.findById(Ort.class, id);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
65 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
66 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
67 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
68 catch(AuthenticationException ae) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
69 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
70 }
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
71 }
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
72
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
73 /**
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
74 * Request all Ort objects
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
75 *
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
76 * @param headers The HTTP header containing authorization information.
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
77 * @return JSON Object via Rest service.
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
78 */
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
79 @GET
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
80 @Produces("text/json")
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
81 public Response filter(@Context HttpHeaders headers) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
82 try {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
83 if (authentication.isAuthorizedUser(headers)) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
84 return repository.findAll(Ort.class);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
85 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
86 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
87 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
88 catch(AuthenticationException ae) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
89 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
90 }
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
91 }
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
92
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
93 /**
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
94 * Update a Ort object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
95 *
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
96 * @param ort The Ort object to update.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
97 * @param headers The HTTP header containing authorization information.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
98 * @return Response object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
99 */
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
100 @PUT
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
101 @Produces("text/json")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
102 @Path("/{ortId}")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
103 @Consumes("application/json")
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
104 public Response update(Ort ort, @Context HttpHeaders headers) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
105 try {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
106 if (authentication.isAuthorizedUser(headers)) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
107 return repository.update(ort);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
108 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
109 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
110 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
111 catch(AuthenticationException ae) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
112 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
113 }
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
114 }
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
115
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
116 /**
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
117 * Create a new Ort object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
118 *
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
119 * @param ort The new Ort object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
120 * @param headers The HTTP header containing authorization information.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
121 * @return Response object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
122 */
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
123 @POST
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
124 @Produces("text/json")
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
125 @Consumes("application/json")
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
126 public Response create(Ort ort, @Context HttpHeaders headers) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
127 try {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
128 if (authentication.isAuthorizedUser(headers)) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
129 return repository.create(ort);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
130 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
131 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
132 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
133 catch(AuthenticationException ae) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
134 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
135 }
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
136 }
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
137
210
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
138 /**
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
139 * Delete a Ort object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
140 *
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
141 * @param ortId The object od.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
142 * @param headers The HTTP header containing authorization information.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
143 * @return Response object.
a305412206a3 Code documentation.
Raimund Renkert <rrenkert@intevation.de>
parents: 208
diff changeset
144 */
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
145 @DELETE
262
f4b359aa9127 Added produces annotation to Ort service.
Raimund Renkert <rrenkert@intevation.de>
parents: 252
diff changeset
146 @Produces("text/json")
252
000bcc8c8fde Fixed path to delete function
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 232
diff changeset
147 @Path("/{ortId}/{probeId}")
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
148 public Response delete(
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
149 @PathParam("ortId") String ortId,
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
150 @Context HttpHeaders headers
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
151 ) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
152 try {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
153 if (authentication.isAuthorizedUser(headers)) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
154 Response response = repository.findById(Ort.class, ortId);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
155 Ort ort = (Ort)response.getData();
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
156 if (ort != null) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
157 repository.delete(ort);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
158 return new Response(true, 200, null);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
159 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
160 return new Response(false, 600, null);
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
161 }
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
162 return new Response(false, 699, new ArrayList<Ort>());
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
163 }
208
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
164 catch(AuthenticationException ae) {
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
165 return new Response(false, 699, new ArrayList<Ort>());
832e67663fd9 Added authorization to all services.
Raimund Renkert <rrenkert@intevation.de>
parents: 196
diff changeset
166 }
195
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
167 }
ad8e9cc164a8 New service and repository for 'Ort'.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff changeset
168 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)