Class AbstractUserPreferencesDAO
- java.lang.Object
-
- fr.paris.lutece.portal.business.prefs.AbstractUserPreferencesDAO
-
- All Implemented Interfaces:
IPreferencesDAO
- Direct Known Subclasses:
AdminUserPreferencesDAO,UserPreferencesDAO
public abstract class AbstractUserPreferencesDAO extends java.lang.Object implements IPreferencesDAO
User Preferences DAO
-
-
Constructor Summary
Constructors Constructor Description AbstractUserPreferencesDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexistsKey(java.lang.String strUserId, java.lang.String strKey)Cheks if a preference key existsbooleanexistsValueForKey(java.lang.String strKey, java.lang.String strValue)Checks if a value is already used for a preference given keyjava.util.List<java.lang.String>getUserId(java.lang.String strKey, java.lang.String strValue)Get the list of user id associated with the given key and valuejava.util.List<java.lang.String>keys(java.lang.String strUserId)Get all preference keys for a given userjava.lang.Stringload(java.lang.String strUserId, java.lang.String strKey, java.lang.String strDefault)Get a preference for a given uservoidremove(java.lang.String strUserId)Clear all preferences for a given uservoidremoveKey(java.lang.String strUserId, java.lang.String strKey)Clear all preferences for a given uservoidremoveKeyPrefix(java.lang.String strUserId, java.lang.String strKeyPrefix)Clear all preferences for a given uservoidstore(java.lang.String strUserId, java.lang.String strKey, java.lang.String strValue)Store a preference for a given user
-
-
-
Method Detail
-
load
public java.lang.String load(java.lang.String strUserId, java.lang.String strKey, java.lang.String strDefault)Get a preference for a given user- Specified by:
loadin interfaceIPreferencesDAO- Parameters:
strUserId- The user's IDstrKey- The preference's keystrDefault- The default value- Returns:
- The preference's value
-
getUserId
public java.util.List<java.lang.String> getUserId(java.lang.String strKey, java.lang.String strValue)Get the list of user id associated with the given key and value- Specified by:
getUserIdin interfaceIPreferencesDAO- Parameters:
strKey- The preference's keystrValue- The preference's value- Returns:
- The list of user id associated with the given key and value. If there is no user id associated with the parameters, then an empty list is returned
-
store
public void store(java.lang.String strUserId, java.lang.String strKey, java.lang.String strValue)Store a preference for a given user- Specified by:
storein interfaceIPreferencesDAO- Parameters:
strUserId- The user's IDstrKey- The preference's keystrValue- The value
-
keys
public java.util.List<java.lang.String> keys(java.lang.String strUserId)
Get all preference keys for a given user- Specified by:
keysin interfaceIPreferencesDAO- Parameters:
strUserId- The user's ID- Returns:
- The keys
-
remove
public void remove(java.lang.String strUserId)
Clear all preferences for a given user- Specified by:
removein interfaceIPreferencesDAO- Parameters:
strUserId- The user's ID
-
removeKey
public void removeKey(java.lang.String strUserId, java.lang.String strKey)Clear all preferences for a given user- Specified by:
removeKeyin interfaceIPreferencesDAO- Parameters:
strUserId- The user's IDstrKey- The preference's key
-
removeKeyPrefix
public void removeKeyPrefix(java.lang.String strUserId, java.lang.String strKeyPrefix)Clear all preferences for a given user- Specified by:
removeKeyPrefixin interfaceIPreferencesDAO- Parameters:
strUserId- The user's IDstrKeyPrefix- The key prefix
-
existsKey
public boolean existsKey(java.lang.String strUserId, java.lang.String strKey)Cheks if a preference key exists- Specified by:
existsKeyin interfaceIPreferencesDAO- Parameters:
strUserId- The User IDstrKey- The Pref key- Returns:
- 1 if exists otherwise false
-
existsValueForKey
public boolean existsValueForKey(java.lang.String strKey, java.lang.String strValue)Checks if a value is already used for a preference given key- Specified by:
existsValueForKeyin interfaceIPreferencesDAO- Parameters:
strKey- The Pref keystrValue- The Pref value- Returns:
- 1 if exists otherwise false
-
-