Class SysPrefType
- java.lang.Object
-
- java.util.Observable
-
- com.microstrategy.web.preferences.SysPrefType
-
- All Implemented Interfaces:
CacheHint
- Direct Known Subclasses:
SysDefaultPrefType
public class SysPrefType extends java.util.Observable implements CacheHint
SysPrefType manages the PreferenceLevel.SYSTEM definitions file for application user preferences (object instance:
getDefinition()
, while its subclassgetDefault()
manages the PreferenceLevel.SYSTEM definitions file for administrative defaults.The Observable parent class allows the cache/backing store to be informed when
setFilePath(String)
is called.- Since:
- MicroStrategy Web 7.3.1 or earlier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
_filepath
protected java.lang.String
_label
protected static java.lang.String
LABEL_DEFAULTS
protected static java.lang.String
USER_SYSTEM_DEFAULTS_FILE
-
Fields inherited from interface com.microstrategy.utils.cache.CacheHint
ZERO_STATE_ID
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
java.lang.Long
getCacheStateId(java.lang.String name)
Returns a value for the current state of the cache hint This value is used in maintaining cache consistency across different caches using the same hint object (for instance, session based cache across a web cluster where each machine in the cluster holds a copy of the cache) Whenever a change is made to the cached value in one cache, the stateId is incrementedstatic SysDefaultPrefType
getDefault()
This returns theSysPrefType
for the server default definitions.static SysDefaultPrefType
getDefault(WebIServerSession session)
The session object is used as a container for the server name, and either the project name or DSS ID.static SysDefaultPrefType
getDefault(java.lang.String serverName)
Returns the definitions for the given serverstatic SysDefaultPrefType
getDefault(java.lang.String serverName, java.lang.String projectName)
Deprecated.static SysPrefType
getDefinition()
This returns theSysPrefType
for the application user default definitions.java.lang.String
getFilePath()
Retrieve the location of the file persisting this system level preference.java.lang.String
getHint()
An identifier associated with this class, and identifying itself in the cache.static SysDefaultPrefType
getUnsessionedDefaults()
int
hashCode()
void
setCacheStateId(java.lang.String name, java.lang.Long stateId)
Sets the stateId - seeCacheHint.getCacheStateId(String)
.void
setFilePath(java.lang.String path)
Set the file location of the file persisting this system level preference.java.lang.String
toString()
-
-
-
Field Detail
-
LABEL_DEFAULTS
protected static final java.lang.String LABEL_DEFAULTS
- See Also:
- Constant Field Values
-
USER_SYSTEM_DEFAULTS_FILE
protected static final java.lang.String USER_SYSTEM_DEFAULTS_FILE
- Since:
- MicroStrategy Web 8.0.0
- See Also:
- Constant Field Values
-
_label
protected java.lang.String _label
-
_filepath
protected java.lang.String _filepath
-
-
Method Detail
-
getDefinition
public static SysPrefType getDefinition()
This returns theSysPrefType
for the application user default definitions.- Returns:
- SysPrefType user application definitions CacheHint.
-
getUnsessionedDefaults
public static SysDefaultPrefType getUnsessionedDefaults()
- Since:
- MicroStrategy Web 7.5.3
-
getDefault
public static SysDefaultPrefType getDefault() throws PreferencesException
This returns theSysPrefType
for the server default definitions.SysDefaultPrefType
extendsSysPrefType
, and adds information about the designated server level preferences.- Returns:
- SysDefaultPrefType server configuration definitions.
- Throws:
PreferencesException
- error obtaining CacheHint.
-
getDefault
public static SysDefaultPrefType getDefault(java.lang.String serverName) throws PreferencesException
Returns the definitions for the given server- Parameters:
serverName
- server name- Returns:
- SysDefaultPrefType server configuration definitions CacheHint
- Throws:
PreferencesException
- error obtaining CacheHint
-
getDefault
@Deprecated public static SysDefaultPrefType getDefault(java.lang.String serverName, java.lang.String projectName) throws PreferencesException
Deprecated.Returns the definitions for the given server.
This method has been deprecated in favor of
getDefault(WebIServerSession)
- Parameters:
serverName
- server nameprojectName
- project name- Returns:
- SysDefaultPrefType server configuration definitions CacheHint
- Throws:
PreferencesException
- error obtaining CacheHint- Since:
- MicroStrategy Web 7.5.3
-
getDefault
public static SysDefaultPrefType getDefault(WebIServerSession session) throws PreferencesException
The session object is used as a container for the server name, and either the project name or DSS ID.
WebIServerSession
is used to perform the lookup from project name to DSS ID, the latter of which is used as a unique key since project names can now be localized. No user login is required, i.e. no user session is required, but a valid server name, server port, and a valid connection (or ability to auto-connect) is required to enable the project name to DSS ID lookup. Auto-connect is configurable viaWebClusterAdmin.setAutoConnect(boolean)
).- Parameters:
session
- a container for server name, server port, and either project name or project DSS ID.- Returns:
- the
CacheHint
. - Throws:
PreferencesException
- thrown if an error occurs.- Since:
- MicroStrategy Web 9.0.0
-
getFilePath
public java.lang.String getFilePath() throws java.lang.IllegalStateException
Retrieve the location of the file persisting this system level preference.- Returns:
- path of the definitions file.
- Throws:
java.lang.IllegalStateException
- if path not configured
-
setFilePath
public void setFilePath(java.lang.String path) throws java.io.FileNotFoundException, java.io.IOException, java.lang.IllegalArgumentException
Set the file location of the file persisting this system level preference. In a distributed environment (e.g. application clustering), this file should be set to a shared location.- Parameters:
path
- the file path.- Throws:
java.io.IOException
- if an error occurs locating the file.java.io.FileNotFoundException
- if the file cannot be found.java.lang.IllegalArgumentException
- if the file path is empty.
-
getHint
public java.lang.String getHint()
An identifier associated with this class, and identifying itself in the cache.- Returns:
- CacheHint identifier
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getCacheStateId
public java.lang.Long getCacheStateId(java.lang.String name)
Description copied from interface:CacheHint
Returns a value for the current state of the cache hint This value is used in maintaining cache consistency across different caches using the same hint object (for instance, session based cache across a web cluster where each machine in the cluster holds a copy of the cache) Whenever a change is made to the cached value in one cache, the stateId is incremented- Specified by:
getCacheStateId
in interfaceCacheHint
- Parameters:
name
- cache name- Returns:
- current state of the cache hint
- See Also:
CacheHint.getCacheStateId(String)
-
setCacheStateId
public void setCacheStateId(java.lang.String name, java.lang.Long stateId)
Description copied from interface:CacheHint
Sets the stateId - seeCacheHint.getCacheStateId(String)
.- Specified by:
setCacheStateId
in interfaceCacheHint
- Parameters:
name
- cache namestateId
- new cache state id- See Also:
CacheHint.setCacheStateId(String, Long)
-
-