fr.paris.lutece.portal.business.prefs
Interface IPreferencesDAO

All Known Implementing Classes:
AbstractUserPreferencesDAO, AdminUserPreferencesDAO, UserPreferencesDAO

public interface IPreferencesDAO

Preferences DAO interface


Method Summary
 boolean existsKey(String strUserId, String strKey)
          Cheks if a preference key exists
 List<String> getUserId(String strKey, String strValue)
          Get the list of user id associated with the given key and value
 List<String> keys(String strUserId)
          Get all preference keys for a given user
 String load(String strUserId, String strKey, String strDefault)
          Get a preference for a given user
 void remove(String strUserId)
          Clear all preferences for a given user
 void removeKey(String strUserId, String strKey)
          Clear all preferences for a given user
 void removeKeyPrefix(String strUserId, String strKeyPrefix)
          Clear all preferences for a given user
 void store(String strUserId, String strKey, String strValue)
          Store a preference for a given user
 

Method Detail

load

String load(String strUserId,
            String strKey,
            String strDefault)
Get a preference for a given user

Parameters:
strUserId - The user's ID
strKey - The preference's key
strDefault - The default value
Returns:
The preference's value

getUserId

List<String> getUserId(String strKey,
                       String strValue)
Get the list of user id associated with the given key and value

Parameters:
strKey - The preference's key
strValue - 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

void store(String strUserId,
           String strKey,
           String strValue)
Store a preference for a given user

Parameters:
strUserId - The user's ID
strKey - The preference's key
strValue - The value

keys

List<String> keys(String strUserId)
Get all preference keys for a given user

Parameters:
strUserId - The user's ID
Returns:
The keys

remove

void remove(String strUserId)
Clear all preferences for a given user

Parameters:
strUserId - The user's ID

removeKey

void removeKey(String strUserId,
               String strKey)
Clear all preferences for a given user

Parameters:
strUserId - The user's ID
strKey - The preference's key

removeKeyPrefix

void removeKeyPrefix(String strUserId,
                     String strKeyPrefix)
Clear all preferences for a given user

Parameters:
strUserId - The user's ID
strKeyPrefix - The key prefix

existsKey

boolean existsKey(String strUserId,
                  String strKey)
Cheks if a preference key exists

Parameters:
strUserId - The User ID
strKey - The Pref key
Returns:
1 if exists otherwise false


Copyright © 2014 Mairie de Paris. All rights reserved.