Mercurial > hg > AnnotationManagerN4J
comparison src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java @ 75:25eb2e1df106
change logging to java.util.logging.
author | casties |
---|---|
date | Fri, 21 Mar 2014 13:32:41 +0100 |
parents | 2b1e6df5e21a |
children |
comparison
equal
deleted
inserted
replaced
74:e5ff09208c28 | 75:25eb2e1df106 |
---|---|
25 * #L% | 25 * #L% |
26 */ | 26 */ |
27 | 27 |
28 import java.io.UnsupportedEncodingException; | 28 import java.io.UnsupportedEncodingException; |
29 import java.net.URLDecoder; | 29 import java.net.URLDecoder; |
30 import java.util.logging.Logger; | |
30 | 31 |
31 import org.apache.log4j.Logger; | |
32 import org.restlet.data.Form; | 32 import org.restlet.data.Form; |
33 import org.restlet.data.MediaType; | 33 import org.restlet.data.MediaType; |
34 import org.restlet.data.Reference; | 34 import org.restlet.data.Reference; |
35 import org.restlet.data.Status; | 35 import org.restlet.data.Status; |
36 import org.restlet.representation.Representation; | 36 import org.restlet.representation.Representation; |
51 * @author casties | 51 * @author casties |
52 * | 52 * |
53 */ | 53 */ |
54 public class PersonResource extends ServerResource { | 54 public class PersonResource extends ServerResource { |
55 | 55 |
56 public static Logger logger = Logger.getLogger(PersonResource.class); | 56 public static Logger logger = Logger.getLogger("de.mpiwg.itgroup.annotations.restlet.annotations_ui.PersonResource"); |
57 | 57 |
58 protected AnnotationStore store; | 58 protected AnnotationStore store; |
59 | 59 |
60 protected String requestId; | 60 protected String requestId; |
61 | 61 |
64 @Override | 64 @Override |
65 protected void doInit() throws ResourceException { | 65 protected void doInit() throws ResourceException { |
66 super.doInit(); | 66 super.doInit(); |
67 // id from URI /annotations/persons/{id} | 67 // id from URI /annotations/persons/{id} |
68 requestId = (String) getRequest().getAttributes().get("id"); | 68 requestId = (String) getRequest().getAttributes().get("id"); |
69 logger.debug("person-id=" + requestId); | 69 logger.fine("person-id=" + requestId); |
70 // get store instance | 70 // get store instance |
71 if (store == null) { | 71 if (store == null) { |
72 store = ((BaseRestlet) getApplication()).getAnnotationStore(); | 72 store = ((BaseRestlet) getApplication()).getAnnotationStore(); |
73 } | 73 } |
74 // get person from store | 74 // get person from store |
140 * @param entity | 140 * @param entity |
141 * @return | 141 * @return |
142 */ | 142 */ |
143 @Put | 143 @Put |
144 public Representation doPut(Representation entity) { | 144 public Representation doPut(Representation entity) { |
145 logger.debug("PersonResource.doPut!"); | 145 logger.fine("PersonResource.doPut!"); |
146 if (person == null) { | 146 if (person == null) { |
147 // invalid id | 147 // invalid id |
148 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 148 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |
149 return null; | 149 return null; |
150 } | 150 } |
173 * @param entity | 173 * @param entity |
174 * @return | 174 * @return |
175 */ | 175 */ |
176 @Delete | 176 @Delete |
177 public Representation doDelete(Representation entity) { | 177 public Representation doDelete(Representation entity) { |
178 logger.debug("PersonResource.doDelete!"); | 178 logger.fine("PersonResource.doDelete!"); |
179 if (person == null) { | 179 if (person == null) { |
180 // invalid id | 180 // invalid id |
181 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); | 181 setStatus(Status.CLIENT_ERROR_BAD_REQUEST); |
182 return null; | 182 return null; |
183 } | 183 } |