public class BasicConfigItem extends Object implements ServerConfigurationService.ConfigItem
ServerConfigurationService.ConfigItem which is valid without having to build their own implementation
Use the static methods to easily generate the ServerConfigurationService.ConfigItem for use with the methods in the ServerConfigurationService| Modifier and Type | Field and Description |
|---|---|
protected Object |
defaultValue
the default value for this config (null indicates it is not set)
|
protected String |
description
the human readable description for this configuration value (null if not set)
|
protected boolean |
dynamic
Indicates if this config item is dynamic (true) or static (false).
|
protected String |
name
the name/key for this configuration value
|
protected String |
source
the name of the most recent source for this config value (e.g. sakai/sakai.properties)
|
protected Object |
value
the actual stored value for this config (null indicates it is not set)
|
| Modifier | Constructor and Description |
|---|---|
protected |
BasicConfigItem()
Do NOT use this - INTERNAL ONLY
|
|
BasicConfigItem(String name,
Object value,
Object defaultValue,
String description,
String source,
boolean dynamic)
Constructor for when you know the source,
leave defaultValue null if you do not know have one
OR if this is a registration for a defaultValue then fill in the defaultValue and leave the value null
(either value OR defaultValue MUST be set)
Recommend use of the static make methods unless you know what you are doing
|
| Modifier and Type | Method and Description |
|---|---|
int |
changed(Object value,
String source)
Called whenever this config item is changed
|
ServerConfigurationService.ConfigItem |
copy()
Duplicate this config item
This is mostly used to ensure we do not send the internal objects out where they could be changed
|
int |
getChanged() |
Object |
getDefaultValue() |
String |
getDescription() |
ServerConfigurationService.ConfigHistory[] |
getHistory() |
String |
getName() |
int |
getRequested() |
String |
getSource() |
String |
getType() |
Object |
getValue() |
int |
getVersion() |
boolean |
isDefaulted() |
boolean |
isDynamic()
Indicates is this config item is dynamic or static (default is static)
|
boolean |
isRegistered() |
boolean |
isSecured() |
static ServerConfigurationService.ConfigItem |
makeConfigItem(String name,
Object value,
Object defaultValue,
String description,
String source,
boolean dynamic)
Create a complete config item with default value and a description which can be dynamic
|
static ServerConfigurationService.ConfigItem |
makeConfigItem(String name,
Object value,
String source)
Create a basic config item which stores a value
|
static ServerConfigurationService.ConfigItem |
makeConfigItem(String name,
Object value,
String source,
boolean dynamic)
Create a basic config item which can be dynamic
|
static ServerConfigurationService.ConfigItem |
makeConfigItem(String name,
Object value,
String description,
String source,
boolean dynamic)
Create a basic config item with description which can be dynamic
|
static ServerConfigurationService.ConfigItem |
makeDefaultedConfigItem(String name,
Object defaultValue,
String source)
Create a config item which stores a default value but does not have an actual value
|
int |
requested()
Called whenever this config item is requested
|
protected String name
protected Object value
protected Object defaultValue
protected String description
protected String source
protected boolean dynamic
protected BasicConfigItem()
public BasicConfigItem(String name, Object value, Object defaultValue, String description, String source, boolean dynamic)
name - the config name key (the ID of this configuration setting)value - [OPTIONAL] the config value (this IS the configurations setting)defaultValue - [OPTIONAL] the default value for this configdescription - [OPTIONAL] the human readable description of this config settingsource - [OPTIONAL] the name of the origin for this config setting (defaults to UNKNOWN)dynamic - default false, static config items cannot be changed at runtime, dynamic items can be changed at runtimepublic int requested()
ServerConfigurationService.ConfigItemrequested in interface ServerConfigurationService.ConfigItempublic int changed(Object value, String source)
ServerConfigurationService.ConfigItemchanged in interface ServerConfigurationService.ConfigItemvalue - the new valuesource - the source which is making the changepublic ServerConfigurationService.ConfigItem copy()
ServerConfigurationService.ConfigItemcopy in interface ServerConfigurationService.ConfigItempublic String getName()
getName in interface ServerConfigurationService.ConfigItempublic Object getValue()
getValue in interface ServerConfigurationService.ConfigItempublic String getType()
getType in interface ServerConfigurationService.ConfigItemServerConfigurationService.TYPESpublic String getDescription()
getDescription in interface ServerConfigurationService.ConfigItempublic String getSource()
getSource in interface ServerConfigurationService.ConfigItempublic Object getDefaultValue()
getDefaultValue in interface ServerConfigurationService.ConfigItempublic int getRequested()
getRequested in interface ServerConfigurationService.ConfigItempublic int getChanged()
getChanged in interface ServerConfigurationService.ConfigItempublic int getVersion()
getVersion in interface ServerConfigurationService.ConfigItempublic ServerConfigurationService.ConfigHistory[] getHistory()
getHistory in interface ServerConfigurationService.ConfigItempublic boolean isRegistered()
isRegistered in interface ServerConfigurationService.ConfigItempublic boolean isDefaulted()
isDefaulted in interface ServerConfigurationService.ConfigItempublic boolean isSecured()
isSecured in interface ServerConfigurationService.ConfigItempublic boolean isDynamic()
ServerConfigurationService.ConfigItemisDynamic in interface ServerConfigurationService.ConfigItempublic static ServerConfigurationService.ConfigItem makeDefaultedConfigItem(String name, Object defaultValue, String source)
name - the config name keydefaultValue - the default value for this configsource - the origin of this config settingServerConfigurationService.ConfigItem which can be registered with the ServerConfigurationServicepublic static ServerConfigurationService.ConfigItem makeConfigItem(String name, Object value, String source)
name - the config name keyvalue - the default value for this configsource - the origin of this config settingServerConfigurationService.ConfigItem which can be registered with the ServerConfigurationServicepublic static ServerConfigurationService.ConfigItem makeConfigItem(String name, Object value, String source, boolean dynamic)
name - the config name keyvalue - the default value for this configsource - the origin of this config settingdynamic - default false, static config items cannot be changed at runtime, dynamic items can be changed at runtimeServerConfigurationService.ConfigItem which can be registered with the ServerConfigurationServicepublic static ServerConfigurationService.ConfigItem makeConfigItem(String name, Object value, String description, String source, boolean dynamic)
name - the config name keyvalue - the default value for this configdescription - the human readable description of this configuration valuesource - the origin of this config settingdynamic - default false, static config items cannot be changed at runtime, dynamic items can be changed at runtimeServerConfigurationService.ConfigItem which can be registered with the ServerConfigurationServicepublic static ServerConfigurationService.ConfigItem makeConfigItem(String name, Object value, Object defaultValue, String description, String source, boolean dynamic)
name - the config name keyvalue - the default value for this configdefaultValue - the default value for this configdescription - the human readable description of this configuration valuesource - the origin of this config settingdynamic - default false, static config items cannot be changed at runtime, dynamic items can be changed at runtimeServerConfigurationService.ConfigItem which can be registered with the ServerConfigurationServiceCopyright © 2003–2018 The Sakai Foundation. All rights reserved.