Ignore:
Timestamp:
Feb 4, 2015, 6:37:02 PM (9 years ago)
Author:
casties
Branch:
default
Message:

improved logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResourceImpl.java

    r88 r89  
    7373public abstract class AnnotatorResourceImpl extends ServerResource {
    7474
    75     protected static Logger logger = Logger.getLogger(AnnotatorResourceImpl.class.toString());
     75        protected static Logger logger = Logger.getLogger(AnnotatorResourceImpl.class.getCanonicalName());
    7676
    7777    private AnnotationStore store;
     
    171171        if (authToken == null) {
    172172            if (!((BaseRestlet) getApplication()).isAuthorizationMode()) {
     173                // no token, no-auth mode -> anonymous
    173174                return Person.getAnonymous();
    174175            }
     176            // no token, auth mode -> null
    175177            return null;
    176178        }
    177         Person user = null;
    178179                try {
    179180                        // decode token first to get consumer key
     
    198199            // userId is mandatory
    199200            String userId = payload.get("userId").getAsString();
    200             user = new Person(userId);
     201            Person user = new Person(userId);
    201202            // displayName is optional
    202203            if (payload.has("displayName")) {
     
    212213                user.groups = groups;
    213214            }
     215            logger.fine("auth OK! user=" + user);
     216            return user;
    214217        } catch (Exception e) {
    215218            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;
    221221    }
    222222
Note: See TracChangeset for help on using the changeset viewer.