class TokenHandler extends HttpResource {

   protected FullHttpResponse doHandleRefreshToken(String refresh, String appId) throws Exception {
      Pair<UUID, Integer> personWithTtl = oauthDao.getPersonWithRefresh(appId, refresh);
      if(personWithTtl == null) {
         OAuthMetrics.incRefreshTokenExpired();
         return OAuthUtil.badRequest(INVALID_GRANT);
      }

      try {
         FullHttpResponse response = updateTokensAndRespond(personWithTtl.getKey(), personWithTtl.getValue(), appId, refresh);
         OAuthMetrics.incRefreshTokenSuccess();
         return response;
      } catch(Exception e) {
         logger.warn("Failed to update tokens", e);
         OAuthMetrics.incRefreshTokenException();
         throw e;
      }
   }

   @Inject public  TokenHandler(
         ApplicationAuth authorizer,
         BridgeMetrics metrics,
         AppRegistry appRegistry,
         OAuthDAO oauthDao,
         OAuthConfig config,
         PlaceSelectionHandler placeSelectionHandler
   );

}