Class BaseUserPreferencesServiceImpl
java.lang.Object
fr.paris.lutece.portal.service.prefs.BaseUserPreferencesServiceImpl
- All Implemented Interfaces:
IUserPreferencesService
- Direct Known Subclasses:
PortalUserPreferenceServiceImpl
@ApplicationScoped
public class BaseUserPreferencesServiceImpl
extends Object
implements IUserPreferencesService
Abstract User Preferences Service
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidClear all preferences for a given uservoidClear a preference for a given uservoidclearKeyPrefix(String strUserId, String strPrefix) Clear all preferences with a given prefix for a given userbooleanCheks if a preference key existsbooleanexistsValueForKey(String strKey, String strValue) Checks if a value is already used for a preference given keyGet a preference for a given userbooleangetBoolean(String strUserId, String strKey, boolean bDefault) Get a boolean preference for a given userintGet an integer preference for a given userGet the list of users associated with a key and a valueGet all preference keys for a given uservoidPut a preference for a given uservoidputBoolean(String strUserId, String strKey, boolean bValue) Put a boolean preference for a given uservoidPut an integer preference for a given uservoidsetDao(IPreferencesDAO dao) Sets the DAO
-
Method Details
-
setDao
Sets the DAO- Parameters:
dao- The DAO
-
get
Get a preference for a given user- Specified by:
getin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keystrDefault- The default value- Returns:
- The preference's value
-
getInt
Get an integer preference for a given user- Specified by:
getIntin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keynDefault- The default value- Returns:
- The preference's value
-
getBoolean
Get a boolean preference for a given user- Specified by:
getBooleanin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keybDefault- The default value- Returns:
- The preference's value
-
put
Put a preference for a given user- Specified by:
putin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keystrValue- The value
-
putInt
Put an integer preference for a given user- Specified by:
putIntin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keynValue- The value
-
putBoolean
Put a boolean preference for a given user- Specified by:
putBooleanin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's keybValue- The value
-
keys
Get all preference keys for a given user- Specified by:
keysin interfaceIUserPreferencesService- Parameters:
strUserId- The user's ID- Returns:
- The keys
-
clear
Clear all preferences for a given user- Specified by:
clearin interfaceIUserPreferencesService- Parameters:
strUserId- The user's ID
-
clearKey
Clear a preference for a given user- Specified by:
clearKeyin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrKey- The preference's key
-
clearKeyPrefix
Clear all preferences with a given prefix for a given user- Specified by:
clearKeyPrefixin interfaceIUserPreferencesService- Parameters:
strUserId- The user's IDstrPrefix- The keys prefix
-
existsKey
Cheks if a preference key exists- Specified by:
existsKeyin interfaceIUserPreferencesService- Parameters:
strUserId- The User IDstrKey- The Pref key- Returns:
- 1 if exists otherwise false
-
getUsers
Get the list of users associated with a key and a value- Specified by:
getUsersin interfaceIUserPreferencesService- Parameters:
strKey- The preference's keystrValue- The preference's value- Returns:
- The list of user id associated with a key and a value, or an empty list if no user id is associated with the given parameters.
-
existsValueForKey
Description copied from interface:IUserPreferencesServiceChecks if a value is already used for a preference given key- Specified by:
existsValueForKeyin interfaceIUserPreferencesService- Parameters:
strKey- The Pref keystrValue- The Pref Value- Returns:
- 1 if exists otherwise false
-