public MongoDBBasedUserManager(MongoDBUtil mongoDBUtil) { cache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(5, TimeUnit.MINUTES).build( new CacheLoader<String, User>() { @Override public User load(String key) throws Exception { User user; user = fetchUserFromMongoDB(key); if (user == null) { return new User(); } else { return user; } } }); this.mongoDBUtil = mongoDBUtil; passwordProtector = new NonePasswordProtector(); }
public MongoDBBasedUserManager(MongoDBUtil mongoDBUtil) { cache = CacheBuilder.newBuilder().maximumSize(1000).expireAfterAccess(5, TimeUnit.MINUTES).build( new CacheLoader<String, User>() { @Override public User load(String key) throws Exception { User user; user = fetchUserFromMongoDB(key); if (user == null) { return new User(); } else { return user; } } }); this.mongoDBUtil = mongoDBUtil; passwordProtector = new NonePasswordProtector(); }
private String generateEncryptPassword(final User user, String newPassword) { User tempUser = user.copy(); if (newPassword != null) { tempUser.setPassword(newPassword); } if (passwordProtector == null) { passwordProtector = new NonePasswordProtector(); } return passwordProtector.encrypt(tempUser); }
private String generateEncryptPassword(final User user, String newPassword) { User tempUser = user.copy(); if (newPassword != null) { tempUser.setPassword(newPassword); } if (passwordProtector == null) { passwordProtector = new NonePasswordProtector(); } return passwordProtector.encrypt(tempUser); }
private String generateEncryptPassword(final User user, String newPassword) { User tempUser = user.copy(); if (newPassword != null) { tempUser.setPassword(newPassword); } if (passwordProtector == null) { passwordProtector = new NonePasswordProtector(); } return passwordProtector.encrypt(tempUser); }
private String generateEncryptPassword(final User user, String newPassword) { User tempUser = user.copy(); if (newPassword != null) { tempUser.setPassword(newPassword); } if (passwordProtector == null) { passwordProtector = new NonePasswordProtector(); } return passwordProtector.encrypt(tempUser); }