/** * Deletes a user preference. * * @param key * the key under which the preference is stored. */ @Override public void removeUserPreference(String key) { if (getUserPreferencesStore() != null) { getUserPreferencesStore().removePreference(key); } }
/** * Reads a user preference. * * @param key * the key under which the preference as been stored. * @return the stored preference or null. */ @Override public String getUserPreference(String key) { if (getUserPreferencesStore() != null) { return getUserPreferencesStore().getPreference(key); } return null; }
/** * Stores a user preference. * * @param key * the key under which the preference as to be stored. * @param value * the value of the preference to be stored. */ @Override public void putUserPreference(String key, String value) { if (getUserPreferencesStore() != null) { getUserPreferencesStore().putPreference(key, value); } }
applicationSession.clear(); if (getUserPreferencesStore() != null) { getUserPreferencesStore().setStorePath(IPreferencesStore.GLOBAL_STORE);
/** * {@inheritDoc} */ @Override public void loggedIn(Subject subject) { getApplicationSession().setSubject(subject); String userPreferredLanguageCode = (String) getApplicationSession().getPrincipal().getCustomProperty( UserPrincipal.LANGUAGE_PROPERTY); if (userPreferredLanguageCode != null) { getApplicationSession().setLocale(LocaleUtils.toLocale(userPreferredLanguageCode)); } if (getUserPreferencesStore() != null) { getUserPreferencesStore().setStorePath(getApplicationSession().getUsername()); } }