protected boolean doRememberMe(ID userId, String expireDate, RememberMeLoginSpecifiedOption option) {
        final boolean updateToken = option.isUpdateToken();
        final boolean silentLogin = option.isSilentLogin();
        if (logger.isDebugEnabled()) {
            final StringBuilder sb = new StringBuilder();
            sb.append("...Doing remember-me: user=").append(userId);
            sb.append(", expire=").append(expireDate);
            if (updateToken) {
                sb.append(", updateToken");
            }
            if (silentLogin) {
                sb.append(", silently");
            }
            logger.debug(sb.toString());
        }
        try {
            identityLogin(userId, op -> op.rememberMe(updateToken).silentLogin(silentLogin));
            return true;
        } catch (NumberFormatException invalidUserKey) { // just in case
            // to know invalid user key or bug
            logger.debug("*The user key might be invalid: {}, {}", userId, invalidUserKey.getMessage());
            return false;
        } catch (LoginFailureException autoLoginFailed) {
            return false;
        }
    }
protected boolean doRememberMe ( ID userId , String expireDate , RememberMeLoginSpecifiedOption option ) { final boolean updateToken = option . isUpdateToken ( ) ; final boolean silentLogin = option . isSilentLogin ( ) ; if ( logger . isDebugEnabled ( ) ) { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "...Doing remember-me: user=" ) . append ( userId ) ; sb . append ( ", expire=" ) . append ( expireDate ) ; if ( updateToken ) { sb . append ( ", updateToken" ) ; } if ( silentLogin ) { sb . append ( ", silently" ) ; } logger . debug ( sb . toString ( ) ) ; } try { identityLogin ( userId , op -> op . rememberMe ( updateToken ) . silentLogin ( silentLogin ) ) ; return true ; } catch ( NumberFormatException invalidUserKey ) { logger . debug ( "*The user key might be invalid: {}, {}" , userId , invalidUserKey . getMessage ( ) ) ; return false ; } catch ( LoginFailureException autoLoginFailed ) { return false ; } }
Do actually remember-me for the user.
@param userId The ID of the login user, used by identity login. (NotNull)
@param expireDate The string expression for expire date of remember-me access token. (NotNull)
@param option The option of remember-me login specified by caller. (NotNull)
@return Is the remember-me success?