Package com.googlecode.memwords.domain

Examples of com.googlecode.memwords.domain.Preferences


            account.setEncryptedSecretKey(encryptedSecretKey);
            em.persist(account);
            tx.commit();
            return new UserInformation(account.getUserId(),
                                       secretKey,
                                       new Preferences(account.getPreferredLocale(),
                                                       account.getPreferredTimeZone(),
                                                       account.isPasswordsUnmasked(),
                                                       account.getPasswordGenerationPreferences()));
        }
        finally {
View Full Code Here


                                                           wrappingKey,
                                                           iv);
        SecretKey secretKey = cryptoEngine.bytesToSecretKey(encryptionKeyAsBytes);
        return new UserInformation(account.getUserId(),
                                   secretKey,
                                   new Preferences(account.getPreferredLocale(),
                                                   account.getPreferredTimeZone(),
                                                   account.isPasswordsUnmasked(),
                                                   account.getPasswordGenerationPreferences()));
    }
View Full Code Here

     * Changes the preferred locale
     * @return a redirect resolution to the preferences page, with a success message
     */
    public Resolution change() {
        UserInformation userInformation = getContext().getUserInformation();
        Preferences preferences = userInformation.getPreferences();
        Preferences newPreferences = preferences.withLocale(this.locale);
        accountService.changePreferences(userInformation.getUserId(), newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
        getContext().getMessages().add(new ScopedLocalizableMessage(ChangePreferredLocaleActionBean.class,
                                                                    "preferredLocaleChanged"));
View Full Code Here

    /**
     * Performs the change
     */
    private void doChange() {
        UserInformation userInformation = getContext().getUserInformation();
        Preferences preferences = userInformation.getPreferences();

        PasswordGenerationPreferences newGenerationPreferences =
            new PasswordGenerationPreferences(this.length,
                                              this.lowerCaseLettersIncluded,
                                              this.upperCaseLettersIncluded,
                                              this.digitsIncluded,
                                              this.specialCharactersIncluded);
        Preferences newPreferences =
            preferences.withPasswordGenerationPreferences(newGenerationPreferences);
        accountService.changePreferences(userInformation.getUserId(),
                                         newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
View Full Code Here

    /**
     * Performs the change
     */
    private void doChange() {
        UserInformation userInformation = getContext().getUserInformation();
        Preferences preferences = userInformation.getPreferences();
        Preferences newPreferences = preferences.withPasswordsUnmasked(this.unmasked);
        accountService.changePreferences(userInformation.getUserId(),
                                         newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
        getContext().getMessages().add(
View Full Code Here

    /**
     * Performs the change
     */
    private void doChange() {
        UserInformation userInformation = getContext().getUserInformation();
        Preferences preferences = userInformation.getPreferences();
        TimeZone timeZone = TimeZone.getTimeZone(this.timeZoneId);
        Preferences newPreferences = preferences.withTimeZone(timeZone);
        accountService.changePreferences(userInformation.getUserId(), newPreferences);
        getContext().setUserInformation(
            userInformation.withPreferences(newPreferences));
        getContext().getMessages().add(new ScopedLocalizableMessage(ChangePreferredTimeZoneActionBean.class,
                                                                    "preferredTimeZoneChanged"));
View Full Code Here

        assertEquals(TimeZone.getTimeZone(MwConstants.GMT), userInfoBeforeChange.getPreferences().getTimeZone());
        assertFalse(userInfoBeforeChange.getPreferences().isPasswordsUnmasked());
        Locale newLocale = new Locale("fr", "FR");
        TimeZone newTimeZone = TimeZone.getTimeZone("Europe/Paris");
        implWithRealCryptoEngine.changePreferences(userId,
                                                   new Preferences(newLocale,
                                                                   newTimeZone,
                                                                   true,
                                                                   new PasswordGenerationPreferences(4, false, true, false, true)));
        UserInformation userInfoAfterChange =
            implWithRealCryptoEngine.login(userId, "masterPassword");
View Full Code Here

TOP

Related Classes of com.googlecode.memwords.domain.Preferences

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.