|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ServerConfigurationService
ServerConfigurationService provides information about how the server is configured.
| Nested Class Summary | |
|---|---|
static interface |
ServerConfigurationService.ConfigData
Defines the config data holding class |
static interface |
ServerConfigurationService.ConfigHistory
Defines the config item history class |
static interface |
ServerConfigurationService.ConfigItem
Defines the config item holding class |
static interface |
ServerConfigurationService.ConfigurationListener
Allows a service to be notified when configuration settings are changed NOTE: this does NOT include any changes which happen during the initial properties file loading |
static interface |
ServerConfigurationService.ConfigurationProvider
Allows registration of configuration settings (config items) from outside the Server Configuration Service and the standard set of properties files which will be loaded early on the configuration cycle NOTE: the implemented ConfigurationProvider MUST be a Spring singleton and it MUST be registered in the main Sakai application context from a component (from a webapp will not work), it also must be set explicitly to not lazy initialize (lazy-init="false"), it is always possible to update the configuration later using #registerConfigItems(ConfigData)
so this is mainly for loading configurations very early in the system startup |
| Field Summary | |
|---|---|
static String |
CURRENT_PORTAL_PATH
Key in the ThreadLocalManager for the path based on the current request. |
static String |
CURRENT_SERVER_URL
Key in the ThreadLocalManager for the serverUrl based on the current request. |
static String |
SERVICE_NAME
This string can be used to find the service in the service manager. |
static String |
TYPE_ARRAY
|
static String |
TYPE_BOOLEAN
|
static String |
TYPE_INT
|
static String |
TYPE_STRING
|
static String |
UNKNOWN
|
| Method Summary | ||
|---|---|---|
String |
getAccessPath()
Access the path to the access service on the server relative to the base URL for the server. |
|
String |
getAccessUrl()
Access the URL to the access service on the server - append any additional path to the end. |
|
boolean |
getBoolean(String name,
boolean dflt)
Access some named configuration value as a boolean. |
|
|
getConfig(String name,
T defaultValue)
Retrieves config values from the configuration service |
|
ServerConfigurationService.ConfigData |
getConfigData()
Returns data about all the configuration values which are known to the system at the time and some stats which are useful |
|
ServerConfigurationService.ConfigItem |
getConfigItem(String name)
Retrieve the internally stored the config item, this is not really for general use, if you want the value of a configuration variable then you should use getConfig(String, Object) |
|
List<String> |
getDefaultTools(String category)
Access the list of tool ids that are selected by default for this category. |
|
String |
getGatewaySiteId()
Access the site id for the gateway (public) site. |
|
String |
getHelpUrl(String helpContext)
Access the URL to the help service on the server - append in the path the tool well known id for context sensitive help. |
|
int |
getInt(String name,
int dflt)
Access some named configuration value as an int. |
|
String |
getLoggedOutUrl()
Access the URL to use as a redirect when the user has logged out. |
|
String |
getPortalUrl()
Access the URL to the portal service on the server - append any additional path to the end. |
|
String |
getRawProperty(String name)
Access the undereferenced value of the given property. |
|
String |
getSakaiHomePath()
Access the file path to the "sakai home" on the app server. |
|
String |
getServerId()
Access the unique (to the cluster) id of the server. |
|
String |
getServerIdInstance()
Access the combined server / instance id. |
|
String |
getServerInstance()
Access the unique (to the cluster) instance id of the server. |
|
String |
getServerName()
Access the server DNS name. |
|
String |
getServerUrl()
Access the URL to the root of the server - append any additional path to the end. |
|
String |
getString(String name)
Access some named configuration value as a string. |
|
String |
getString(String name,
String dflt)
Access some named configuration value as a string. |
|
String[] |
getStrings(String name)
Access some named configuration values as an array of strings. |
|
List<String> |
getToolCategories(String category)
access the list of tool categories for the given site type |
|
Map<String,List<String>> |
getToolCategoriesAsMap(String category)
access the map of tool categories to tool ids for this site type |
|
List<String> |
getToolOrder(String category)
Access the list of tool ids in order for this category, to impose on the displays of many tools |
|
List<String> |
getToolsRequired(String category)
Access the list of tool ids that are required for this category. |
|
Map<String,String> |
getToolToCategoryMap(String category)
access a map of tool id to tool category id for this site type |
|
String |
getToolUrl()
Access the URL to the tool dispatcher service on the server - append any additional path to the end. |
|
String |
getUserHomeUrl()
Access the URL to the user's "home" (My Workspace) in the service. |
|
ServerConfigurationService.ConfigItem |
registerConfigItem(ServerConfigurationService.ConfigItem configItem)
Register a configuration item (or override an existing config), this should be called when changing or creating a configuration setting |
|
void |
registerListener(ServerConfigurationService.ConfigurationListener configurationListener)
Register a listener which will be notified whenever there is a configuration setting change, there is no need to unregister a listener as all listener references will be held weakly (if there are no more variables which reference the listener then it will be GCed and removed from the list of listeners) Registering the same ServerConfigurationService.ConfigurationListener object multiple times has no effect |
|
| Field Detail |
|---|
static final String SERVICE_NAME
static final String CURRENT_SERVER_URL
static final String CURRENT_PORTAL_PATH
static final String UNKNOWN
static final String TYPE_BOOLEAN
static final String TYPE_INT
static final String TYPE_ARRAY
static final String TYPE_STRING
| Method Detail |
|---|
String getServerId()
String getServerInstance()
String getServerIdInstance()
String getServerName()
String getServerUrl()
String getHelpUrl(String helpContext)
helpContext - The context string.
String getAccessUrl()
String getAccessPath()
String getPortalUrl()
String getToolUrl()
String getGatewaySiteId()
String getLoggedOutUrl()
String getUserHomeUrl()
String getSakaiHomePath()
String getString(String name)
name - The configuration value name.
String getString(String name,
String dflt)
name - The configuration value name.dflt - The value to return if not found.
String[] getStrings(String name)
name - The configuration value name base.
int getInt(String name,
int dflt)
name - The configuration value name.dflt - The value to return if not found.
boolean getBoolean(String name,
boolean dflt)
name - The configuration value name.dflt - The value to return if not found.
String getRawProperty(String name)
property1=foo
property2=${property1}
Invoking getString(String), passing "property2"
will return "foo". However, invoking this method
with the same argument will return "${property1}".
Typically, a client of this method, e.g. a dynamic configuration management tool, is interested in reporting on the system's actual state from which return values of other getters are calculated. In such cases, caller-specified default values have no utility. Thus this method does not accept an argument specifying the property's default value.
For a given undefined property "X", this method should return
exactly the same value as getString("X"). Thus it may
not be possible in all cases to distinguish between defined and
undefined properties.
name - a property name. Must not be null
List<String> getToolOrder(String category)
category - The tool category
List<String> getToolsRequired(String category)
category - The tool category.
List<String> getDefaultTools(String category)
category - The tool category.
List<String> getToolCategories(String category)
category - the site type
Map<String,List<String>> getToolCategoriesAsMap(String category)
category - the site type
Map<String,String> getToolToCategoryMap(String category)
category - the site type
<T> T getConfig(String name,
T defaultValue)
name - the name of the setting to retrieve, Should be a string name: e.g. auto.ddl,
mystuff.config, etc.defaultValue - a specified default value to return if this setting cannot be found,
NOTE: You can set the default value to null but you must specify the class type in parens
ServerConfigurationService.ConfigItem getConfigItem(String name)
getConfig(String, Object)
name - the name of the setting to retrieve, Should be a string name: e.g. auto.ddl,
mystuff.config, etc.
ServerConfigurationService.ConfigItem registerConfigItem(ServerConfigurationService.ConfigItem configItem)
configItem - an instance of the ServerConfigurationService.ConfigItem interface with the name, value, source params set,
use BasicConfigItem as an easy way to construct a ServerConfigurationService.ConfigItem
ServerConfigurationService.ConfigItem
IllegalArgumentException - if the ServerConfigurationService.ConfigItem is not valid (does not have all required fields set)void registerListener(ServerConfigurationService.ConfigurationListener configurationListener)
ServerConfigurationService.ConfigurationListener object multiple times has no effect
configurationListener - a ServerConfigurationService.ConfigurationListener objectServerConfigurationService.ConfigData getConfigData()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||