Class PreferencesMgr
- java.lang.Object
-
- com.microstrategy.web.preferences.PreferencesMgr
-
public class PreferencesMgr extends java.lang.Object
This is the entry point to the preferences functionality in the Web API. ThePreferencesMgr
is essentially a facade to the ApplicationPreferences subsystem. It hides from the application details of preferences management, such as the caching layer.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
getBooleanValue(Preferences pref, java.lang.String name)
Returns preference value as boolean.static boolean
getBooleanValue(Preferences pref, java.lang.String name, boolean defaultValue)
Returns preference value as boolean.static PreferencesMgr
getInstance()
Obtain the PreferencesMgr singleton instance.Preferences
getIPASysDefaultPreferences(java.lang.String serverName, java.lang.String templateName)
Obtain the system preferences for a given server name and template name .Preferences
getSysDefaultPreferences()
Obtain system preferences for all servers.Preferences
getSysDefaultPreferences(WebIServerSession session)
Obtain the system preferences for a given server.Preferences
getSysDefaultPreferences(java.lang.String serverName)
Obtain the system preferences for a given server.Preferences
getSysDefaultPreferences(java.lang.String serverName, java.lang.String projectName)
Obtain the system preferences for a given server.Preferences
getUserDefaultPreferences()
ReturnsPreferences
with only default level values populated.Preferences
getUserPreferences(WebIServerSession session)
Before this call is made, ensure the system definitions file has been specified:SysPrefType.getDefinition().setFilePath(String)
.boolean
isConfigured()
-
-
-
Method Detail
-
getInstance
public static PreferencesMgr getInstance()
Obtain the PreferencesMgr singleton instance.- Returns:
- The PreferenceMgr instance.
-
getSysDefaultPreferences
public Preferences getSysDefaultPreferences() throws PreferencesException
Obtain system preferences for all servers.- Returns:
- The system default preferences.
- Throws:
PreferencesException
-
getSysDefaultPreferences
public Preferences getSysDefaultPreferences(java.lang.String serverName) throws PreferencesException
Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.
The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method. Caveat: changing the file name can confuse other processes concurrently accessing the same default preferences.
- Parameters:
serverName
- The name of the Intelligence Server.- Returns:
- The system default preferences.
- Throws:
PreferencesException
- See Also:
SysDefaultPrefType
-
getIPASysDefaultPreferences
public Preferences getIPASysDefaultPreferences(java.lang.String serverName, java.lang.String templateName) throws PreferencesException
Obtain the system preferences for a given server name and template name . Specifying "" as the server name returns the preferences based on the template name
- Parameters:
serverName
- The name of the Intelligence Server.templateName
- The name of the preferences template- Returns:
- The system preferences.
- Throws:
PreferencesException
- See Also:
SysDefaultPrefType
-
getSysDefaultPreferences
public Preferences getSysDefaultPreferences(java.lang.String serverName, java.lang.String projectName) throws PreferencesException
Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.
The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method.
- Parameters:
serverName
- name of the Intelligence ServerprojectName
- name of project in server- Returns:
- the system default preferences
- Throws:
PreferencesException
- Since:
- MicroStrategy Web 7.5.3
- See Also:
SysDefaultPrefType
-
getSysDefaultPreferences
public Preferences getSysDefaultPreferences(WebIServerSession session) throws PreferencesException
Obtain the system preferences for a given server. Specifying "" as the server name returns the default preferences object for all servers.
The SysDefaultPrefType object corresponding to the serverName is then used to define properties such as the file name. To change the file paths associated with the server, change the relevant SysDefaultPrefType instance before invoking this method.
- Parameters:
session
- a session containing the server name, server port, project name or project DSS ID.- Returns:
- the system default preferences
- Throws:
PreferencesException
- Since:
- MicroStrategy Web 9.0.0
- See Also:
SysPrefType.getDefault(WebIServerSession)
-
getUserPreferences
public Preferences getUserPreferences(WebIServerSession session) throws PreferencesException
Before this call is made, ensure the system definitions file has been specified:
SysPrefType.getDefinition().setFilePath(String)
.Obtain a user's preferences. User level preferences are keyed of the user's session, hence it is necessary to login to an Intelligence Server before a user's preferences may be retrieved.
- Parameters:
session
- The user's web session.- Returns:
- The preferences.
- Throws:
PreferencesException
- See Also:
WebIServerSession
-
getUserDefaultPreferences
public Preferences getUserDefaultPreferences() throws PreferencesException
ReturnsPreferences
with only default level values populated. Useful for initialization.- Returns:
Preferences
with only default level values.- Throws:
PreferencesException
- Since:
- MicroStrategy Web 9.0.1
-
isConfigured
public boolean isConfigured()
- Returns:
- whether preferences is properly setup, ie.
SysPrefType.getDefinition().setFilePath(String)
has been configured. - Since:
- MicroStrategy Web 8.0.0
-
getBooleanValue
public static boolean getBooleanValue(Preferences pref, java.lang.String name)
Returns preference value as boolean. Returns false if pref object is null or preference doesn't exist within this preferences collection- Parameters:
pref
- preferences objectname
- preference name- Returns:
- preference value
-
getBooleanValue
public static boolean getBooleanValue(Preferences pref, java.lang.String name, boolean defaultValue)
Returns preference value as boolean. Returns defaultValue if pref object is null or preference doesn't exist within this preferences collection- Parameters:
pref
- preferences objectname
- preference namedefaultValue
- defaulr value- Returns:
- preference value
-
-