Package org.intermine.api.profile
Class PreferencesManager
- java.lang.Object
-
- org.intermine.api.profile.PreferencesManager
-
public class PreferencesManager extends java.lang.Object
Class encapsulating the logic for reading user preferences in and out of the DB.- Author:
- Alex Kalderimis
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PreferencesManager(ObjectStoreWriter osw)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteAllPreferences(Profile profile)
protected void
deletePreference(Profile profile, java.lang.String key)
protected java.util.Map<java.lang.String,java.lang.String>
getPreferences(Profile profile)
java.lang.Integer
getUserWithUniqueMapping(java.lang.String key, java.lang.String value)
boolean
mappingExists(java.lang.String key, java.lang.String value)
protected void
setPreference(Profile profile, java.lang.String key, java.lang.String value)
-
-
-
Constructor Detail
-
PreferencesManager
protected PreferencesManager(ObjectStoreWriter osw)
Constructor- Parameters:
osw
- objectstore writer
-
-
Method Detail
-
getPreferences
protected java.util.Map<java.lang.String,java.lang.String> getPreferences(Profile profile) throws java.sql.SQLException
- Parameters:
profile
- userprofile- Returns:
- user preferences
- Throws:
java.sql.SQLException
- if userprofile is unavailable
-
setPreference
protected void setPreference(Profile profile, java.lang.String key, java.lang.String value) throws java.sql.SQLException
- Parameters:
profile
- userprofilekey
- keyvalue
- value- Throws:
java.sql.SQLException
- if something goes wrong
-
deletePreference
protected void deletePreference(Profile profile, java.lang.String key) throws java.sql.SQLException
- Parameters:
profile
- userprofilekey
- key- Throws:
java.sql.SQLException
- if something goes wrong
-
deleteAllPreferences
public void deleteAllPreferences(Profile profile) throws java.sql.SQLException
- Parameters:
profile
- userprofile- Throws:
java.sql.SQLException
- if something goes wrong
-
mappingExists
public boolean mappingExists(java.lang.String key, java.lang.String value) throws java.sql.SQLException
- Parameters:
key
- keyvalue
- value- Returns:
- true if mapping exists
- Throws:
java.sql.SQLException
- if something goes wrong
-
getUserWithUniqueMapping
public java.lang.Integer getUserWithUniqueMapping(java.lang.String key, java.lang.String value) throws java.sql.SQLException
- Parameters:
key
- keyvalue
- value- Returns:
- user id
- Throws:
java.sql.SQLException
- something goes wrong
-
-