Changeset 89:247cbbb385de in AnnotationManagerN4J for src
- Timestamp:
- Feb 4, 2015, 6:37:02 PM (10 years ago)
- Branch:
- default
- Location:
- src/main/java/de/mpiwg/itgroup/annotations/restlet
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java
r88 r89 73 73 public abstract class AnnotatorResourceImpl extends ServerResource { 74 74 75 protected static Logger logger = Logger.getLogger(AnnotatorResourceImpl.class.toString());75 protected static Logger logger = Logger.getLogger(AnnotatorResourceImpl.class.getCanonicalName()); 76 76 77 77 private AnnotationStore store; … … 171 171 if (authToken == null) { 172 172 if (!((BaseRestlet) getApplication()).isAuthorizationMode()) { 173 // no token, no-auth mode -> anonymous 173 174 return Person.getAnonymous(); 174 175 } 176 // no token, auth mode -> null 175 177 return null; 176 178 } 177 Person user = null;178 179 try { 179 180 // decode token first to get consumer key … … 198 199 // userId is mandatory 199 200 String userId = payload.get("userId").getAsString(); 200 user = new Person(userId);201 Person user = new Person(userId); 201 202 // displayName is optional 202 203 if (payload.has("displayName")) { … … 212 213 user.groups = groups; 213 214 } 215 logger.fine("auth OK! user=" + user); 216 return user; 214 217 } catch (Exception e) { 215 218 logger.warning("Error checking auth token: "+e.toString()); 216 return null; 217 } 218 // must be ok then 219 logger.fine("auth OK! user=" + user); 220 return user; 219 } 220 return null; 221 221 } 222 222 -
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorRestlet.java
r88 r89 1 /**2 *3 */4 1 package de.mpiwg.itgroup.annotations.restlet; 5 2 -
src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorSearch.java
r88 r89 120 120 } 121 121 122 logger.fine("sending :");123 logger.fine (result.toString());122 logger.fine("sending response"); 123 logger.finest(result.toString()); 124 124 return new JsonRepresentation(result); 125 125 } -
src/main/java/de/mpiwg/itgroup/annotations/restlet/BaseRestlet.java
r86 r89 57 57 public abstract class BaseRestlet extends Application { 58 58 59 public static Logger logger = Logger.getLogger( "de.mpiwg.itgroup.annotations.restlet.BaseRestlet");59 public static Logger logger = Logger.getLogger(BaseRestlet.class.getCanonicalName()); 60 60 61 61 /** … … 154 154 ServletContext sc = (ServletContext) attrs.get("org.restlet.ext.servlet.ServletContext"); 155 155 if (sc != null) { 156 logger = context.getLogger(); 157 logger.info(getVersion() + " starting..."); 156 logger.info(getVersion() + " starting..."); 158 157 159 158 /* … … 241 240 consumerKeys.load(ps); 242 241 } catch (IOException e) { 243 // TODO Auto-generated catch block 244 e.printStackTrace(); 242 logger.fine("Error loading consumer keys: "+e); 245 243 } 246 244 logger.fine("consumer keys: " + consumerKeys);
Note: See TracChangeset
for help on using the changeset viewer.