public interface ServerConfigurationService
ServerConfigurationService provides information about how the server is configured.
| Modifier and Type | Interface and Description |
|---|---|
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,
It is up to the implementor to ignore the changes they do not care about.
|
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 |
| Modifier and Type | Field and Description |
|---|---|
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[] |
TYPES |
static String |
UNKNOWN |
| Modifier and Type | Method and Description |
|---|---|
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.
|
List<String> |
getCategoryGroups(String category)
KNL-989
Access the list of groups by category (site type)
|
<T> T |
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.
|
Locale |
getLocaleFromString(String localeString)
Parse a string into a Locale
|
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.
|
Locale[] |
getSakaiLocales()
Get the list of allowed locales as controlled by config params for "locales" and "locales.more"
Defaults when nothing is specified in the config files come from
SakaiLocales.SAKAI_LOCALES_DEFAULT |
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.
1) IF "name=value" THEN this will return "value"
2) IF "name=" THEN this will return null
3) IF name is not defined in the config THEN this will return "" (empty string)
|
String |
getString(String name,
String dflt)
Access some named configuration value as a string.
1) IF "name=value" THEN this will return "value"
2) IF "name=" THEN this will return null
3) IF name is not defined in the config THEN this will return the provided default value
|
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> |
getToolGroup(String category)
KNL-989
Access the list of tools by group
|
List<String> |
getToolOrder(String category)
KNL-989
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 |
boolean |
toolGroupIsRequired(String groupName,
String toolId)
KNL-989
Returns true if selected tool is contained in pre-initialized list of required items
|
boolean |
toolGroupIsSelected(String groupName,
String toolId)
KNL-989
Returns true if selected tool is contained in pre-initialized list of selected items
|
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
static final String[] TYPES
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 (or key).String getString(String name, String dflt)
name - The configuration value name (or key).dflt - The value to return if not found in the config.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 nullList<String> getToolGroup(String category)
category - The tool categoryList<String> getToolOrder(String category)
category - Site typeboolean toolGroupIsSelected(String groupName, String toolId)
boolean toolGroupIsRequired(String groupName, String toolId)
List<String> getCategoryGroups(String category)
category - The tool categoryList<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 typeMap<String,List<String>> getToolCategoriesAsMap(String category)
category - the site typeMap<String,String> getToolToCategoryMap(String category)
category - the site typeLocale[] getSakaiLocales()
SakaiLocales.SAKAI_LOCALES_DEFAULTSakaiLocalesLocale getLocaleFromString(String localeString)
<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 parensServerConfigurationService.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.ConfigItemServerConfigurationService.ConfigItemIllegalArgumentException - 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 effectconfigurationListener - a ServerConfigurationService.ConfigurationListener objectServerConfigurationService.ConfigData getConfigData()
Copyright © 2003-2014 The Sakai Foundation. All Rights Reserved.