fr.paris.lutece.portal.service.prefs
Class BaseUserPreferencesServiceImpl

java.lang.Object
  extended by fr.paris.lutece.portal.service.prefs.BaseUserPreferencesServiceImpl
All Implemented Interfaces:
IUserPreferencesService, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
PortalUserPreferenceServiceImpl

public class BaseUserPreferencesServiceImpl
extends Object
implements IUserPreferencesService, org.springframework.beans.factory.InitializingBean

Abstract User Preferences Service

Since:
4.0

Constructor Summary
protected BaseUserPreferencesServiceImpl()
          Constructor
 
Method Summary
 void afterPropertiesSet()
          
 void clear(String strUserId)
          Clear all preferences for a given user
 String get(String strUserId, String strKey, String strDefault)
          Get a preference for a given user
 boolean getBoolean(String strUserId, String strKey, boolean bDefault)
          Get a boolean preference for a given user
 int getInt(String strUserId, String strKey, int nDefault)
          Get an integer preference for a given user
 List<String> getUsers(String strKey, String strValue)
          Get the list of users associated with a key and a value
 List<String> keys(String strUserId)
          Get all preference keys for a given user
 void put(String strUserId, String strKey, String strValue)
          Put a preference for a given user
 void putBoolean(String strUserId, String strKey, boolean bValue)
          Put a boolean preference for a given user
 void putInt(String strUserId, String strKey, int nValue)
          Put an integer preference for a given user
 void setDao(IPreferencesDAO dao)
          Sets the DAO
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseUserPreferencesServiceImpl

protected BaseUserPreferencesServiceImpl()
Constructor

Method Detail

setDao

public void setDao(IPreferencesDAO dao)
Sets the DAO

Parameters:
dao - The DAO

get

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

Specified by:
get in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
strDefault - The default value
Returns:
The preference's value

getInt

public int getInt(String strUserId,
                  String strKey,
                  int nDefault)
Get an integer preference for a given user

Specified by:
getInt in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
nDefault - The default value
Returns:
The preference's value

getBoolean

public boolean getBoolean(String strUserId,
                          String strKey,
                          boolean bDefault)
Get a boolean preference for a given user

Specified by:
getBoolean in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
bDefault - The default value
Returns:
The preference's value

put

public void put(String strUserId,
                String strKey,
                String strValue)
Put a preference for a given user

Specified by:
put in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
strValue - The value

putInt

public void putInt(String strUserId,
                   String strKey,
                   int nValue)
Put an integer preference for a given user

Specified by:
putInt in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
nValue - The value

putBoolean

public void putBoolean(String strUserId,
                       String strKey,
                       boolean bValue)
Put a boolean preference for a given user

Specified by:
putBoolean in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
strKey - The preference's key
bValue - The value

keys

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

Specified by:
keys in interface IUserPreferencesService
Parameters:
strUserId - The user's ID
Returns:
The keys

clear

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

Specified by:
clear in interface IUserPreferencesService
Parameters:
strUserId - The user's ID

getUsers

public List<String> getUsers(String strKey,
                             String strValue)
Get the list of users associated with a key and a value

Specified by:
getUsers in interface IUserPreferencesService
Parameters:
strKey - The preference's key
strValue - 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.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2014 Mairie de Paris. All Rights Reserved.