public class ConfigurationManager extends Object
Registered listeners implement the ConfigurationWatcher interface and have these DDF configuration settings pushed to them when they come online (aka bind) and when one or more of the settings are changed in the Admin Console.
Modifier and Type | Field and Description |
---|---|
protected Map<String,String> |
configuration
The map of DDF system settings, including the read-only settings.
|
protected org.osgi.service.cm.ConfigurationAdmin |
configurationAdmin |
static String |
CONTACT
Site (email) contact
|
static String |
HOME_DIR
The directory where DDF is installed
|
static String |
HOST
The hostname or IP address of the machine that DDF is running on
|
static String |
HTTP_PORT
The port number that CXF's underlying Jetty server is listening on, e.g., 8181
|
static String |
KEY_STORE
Key store to use for outgoing DDF connections
|
static String |
KEY_STORE_PASSWORD
Password associated with the key store
|
static String |
ORGANIZATION
The organization that this instance of DDF is running for
|
static String |
PID
Service PID to use to look up System Settings Configuration.
|
static String |
PORT
The port number that DDF is listening on, e.g., 8181
|
static String |
PROTOCOL
The protocol that DDF is using http/https
|
protected Map<String,String> |
readOnlySettings
The map of DDF system settings that are read-only, i.e., they are set in OSGi system bundles,
not displayed in Admin Console's DDF System Settings configuration, but are pushed out in the
configuration settings to ConfigurationWatchers.
|
protected List<ConfigurationWatcher> |
services
List of DdfManagedServices to push the DDF system settings to.
|
static String |
SERVICES_CONTEXT_ROOT
The context root for all DDF services, e.g., the /services portion of the
http://hostname:8181/services URL
|
static String |
SITE_NAME
The site name for this DDF instance
|
static String |
TRUST_STORE
Trust store to use for outgoing DDF connections
|
static String |
TRUST_STORE_PASSWORD
Password associated with the trust store
|
static String |
VERSION
The version of DDF currently running
|
Constructor and Description |
---|
ConfigurationManager(List<ConfigurationWatcher> services,
org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
Constructs the list of DDF system Settings (read-only and configurable settings) to be pushed
to registered ConfigurationWatchers.
|
Modifier and Type | Method and Description |
---|---|
void |
bind(ConfigurationWatcher service,
Map properties)
Invoked when a ConfigurationWatcher first comes online, e.g., when a federated source is
configured, this method pushes the DDF system settings to the newly registered (bound)
ConfigurationWatcher.
|
org.osgi.service.cm.ConfigurationAdmin |
getConfigurationAdmin() |
String |
getConfigurationValue(String servicePid,
String propertyName)
Retrieves the value of an OSGi bundle's configuration property
|
void |
init()
Called once after all managed property setters have been called.
|
void |
setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) |
void |
setContact(String contact) |
void |
setHost(String host) |
void |
setId(String id) |
void |
setOrganization(String organization) |
void |
setPort(String port) |
void |
setProtocol(String protocol) |
void |
setVersion(String version) |
void |
updated(Map<String,?> updatedConfig)
Invoked when the DDF system settings are changed in the Admin Console, this method then pushes
those DDF system settings to each of the registered ConfigurationWatchers.
|
public static final String PID
public static final String HOME_DIR
public static final String HTTP_PORT
public static final String SERVICES_CONTEXT_ROOT
public static final String HOST
public static final String PORT
public static final String PROTOCOL
public static final String TRUST_STORE
public static final String TRUST_STORE_PASSWORD
public static final String KEY_STORE
public static final String KEY_STORE_PASSWORD
public static final String SITE_NAME
public static final String VERSION
public static final String ORGANIZATION
public static final String CONTACT
protected List<ConfigurationWatcher> services
protected Map<String,String> configuration
protected Map<String,String> readOnlySettings
protected org.osgi.service.cm.ConfigurationAdmin configurationAdmin
public ConfigurationManager(List<ConfigurationWatcher> services, org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
services
- the list of watchers of changes to the DDF System SettingsconfigurationAdmin
- the OSGi Configuration Admin service handlepublic void setProtocol(String protocol)
public void setHost(String host)
public void setPort(String port)
public void setId(String id)
public void setVersion(String version)
public void setOrganization(String organization)
public void setContact(String contact)
public void init()
public void updated(Map<String,?> updatedConfig)
updatedConfig
- map of DDF system settings, not including the read-only settings. Can be
null.public void bind(ConfigurationWatcher service, Map properties)
service
- properties
- does nothingpublic org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()
public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin)
configurationAdmin
- public String getConfigurationValue(String servicePid, String propertyName)
servicePid
- PID for an OSGi bundlepropertyName
- name of the bundle's configuration property to get a value forThis work is licensed under a Creative Commons Attribution 4.0 International License.