Package org.sakaiproject.profile2.logic
Interface ProfilePreferencesLogic
-
public interface ProfilePreferencesLogicAn interface for dealing with ProfilePreferences in Profile2- Author:
- Steve Swinsburg (steve.swinsburg@gmail.com)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProfilePreferencesgetPreferencesRecordForUser(String userId)Retrieve the preferences record from the database for this user.ProfilePreferencesgetPreferencesRecordForUser(String userId, boolean useCache)Retrieve the preferences record from the database for this user but the caller has the option on whether or not to use the cached version (PRFL-504)booleanisPreferenceEnabled(String userUuid, PreferenceType type)Does this user have the specific preference enabled?booleansavePreferencesRecord(ProfilePreferences profilePreferences)Save the preferences record to the database
-
-
-
Method Detail
-
getPreferencesRecordForUser
ProfilePreferences getPreferencesRecordForUser(String userId)
Retrieve the preferences record from the database for this user. If none exists, will attempt to create one for the user. If that also fails, will return null.Defaults to using the cached version where possible
- Parameters:
userId- uuid of the user to retrieve the record for- Returns:
- ProfilePreferences record or null
-
getPreferencesRecordForUser
ProfilePreferences getPreferencesRecordForUser(String userId, boolean useCache)
Retrieve the preferences record from the database for this user but the caller has the option on whether or not to use the cached version (PRFL-504)- Parameters:
userId- uuid of the user to retrieve the record foruseCache- whether or not to use the cache- Returns:
- ProfilePreferences record or null
-
savePreferencesRecord
boolean savePreferencesRecord(ProfilePreferences profilePreferences)
Save the preferences record to the database- Parameters:
profilePreferences- the record for the user
-
isPreferenceEnabled
boolean isPreferenceEnabled(String userUuid, PreferenceType type)
Does this user have the specific preference enabled? used for querying all of the preferences- Parameters:
userUuid- uuid of the usertype- PreferenceType enum- Returns:
- true if enabled, false if not
- Since:
- 1.5
-
-