/** Sets the user login time to the current time */ public void setLoginTimeAndUpdate() { secondToLastLoginTime = lastLoginTime; lastLoginTime = DateUtil.now(); doUpdateAndRetry(); Logger.debug( getClass().getCanonicalName() + " " + pk + " login time updated to " + lastLoginTime); }
/** Sets the user last access time to the current time */ public void setLastAccessTimeAndUpdate() { lastAccessTime = DateUtil.now(); doUpdateAndRetry(); Logger.debug( getClass().getCanonicalName() + " " + pk + " last access time updated to " + lastAccessTime); }
/** Creates a user with the given information Username will be some default value */ private UserModel( String fbId, String username, String email, boolean isTestUser, UserModel creator) { Date now = DateUtil.now(); this.pk = UUID.randomUUID(); this.fbId = fbId; this.fbIsAuthed = (this.fbId != null); this.username = username; this.email = email; this.registerTime = now; this.isTestUser = isTestUser; this.creator = creator; this.lastAccessTime = now; this.lastLoginTime = now; this.secondToLastLoginTime = null; }