Beispiel #1
0
 @Override
 public void updateOnlineState(long uid) {
   try {
     memcachedClient.set(MemcachedKeyGenerator.genUserOnlineKey(uid), userOnlineExpireTime, true);
   } catch (Exception e) {
     log.error(e.getMessage(), e);
   }
 }
Beispiel #2
0
 @Override
 public void logout(HttpServletRequest request, HttpServletResponse response, long uid) {
   loginSessionManager.logout(request, response);
   try {
     memcachedClient.delete(MemcachedKeyGenerator.genUserOnlineKey(uid));
   } catch (Exception e) {
     log.error(e.getMessage(), e);
   }
 }
Beispiel #3
0
 @Override
 public boolean isOnline(long uid) {
   try {
     Boolean online = memcachedClient.get(MemcachedKeyGenerator.genUserOnlineKey(uid));
     return online == null ? false : online;
   } catch (Exception e) {
     log.error(e.getMessage(), e);
     return false;
   }
 }