Package org.codice.ddf.configuration
Class ConfigurationManager
java.lang.Object
org.codice.ddf.configuration.ConfigurationManager
The DDF Configuration Manager manages the DDF system settings. Some of these settings are
displayed in the Web Admin Console's Configuration tab under the DDF System Settings
configuration. Other settings are read-only, not displayed in the DDF System Settings
configuration (but appear in other OSGi bundle configurations such as CXF). These read-only
settings are included in the list of configuration settings pushed to registered listeners.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe map of DDF system settings, including the read-only settings.protected org.osgi.service.cm.ConfigurationAdminstatic final StringSite (email) contactstatic final StringThe directory where DDF is installedstatic final StringThe hostname or IP address of the machine that DDF is running onstatic final StringThe port number that CXF's underlying Jetty server is listening on, e.g., 8181static final StringKey store to use for outgoing DDF connectionsstatic final StringPassword associated with the key storestatic final StringThe organization that this instance of DDF is running forstatic final StringService PID to use to look up System Settings Configuration.static final StringThe port number that DDF is listening on, e.g., 8181static final StringThe protocol that DDF is using http/httpsThe 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>List of DdfManagedServices to push the DDF system settings to.static final StringThe context root for all DDF services, e.g., the /services portion of the http://hostname:8181/services URLstatic final StringThe site name for this DDF instancestatic final StringTrust store to use for outgoing DDF connectionsstatic final StringPassword associated with the trust storestatic final StringThe version of DDF currently running -
Constructor Summary
ConstructorsConstructorDescriptionConfigurationManager(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. -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(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.ConfigurationAdmingetConfigurationValue(String servicePid, String propertyName) Retrieves the value of an OSGi bundle's configuration propertyvoidinit()Called once after all managed property setters have been called.voidsetConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) voidsetContact(String contact) voidvoidvoidsetOrganization(String organization) voidvoidsetProtocol(String protocol) voidsetVersion(String version) voidInvoked 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.
-
Field Details
-
PID
Service PID to use to look up System Settings Configuration.- See Also:
-
HOME_DIR
The directory where DDF is installed- See Also:
-
HTTP_PORT
The port number that CXF's underlying Jetty server is listening on, e.g., 8181- See Also:
-
SERVICES_CONTEXT_ROOT
The context root for all DDF services, e.g., the /services portion of the http://hostname:8181/services URL- See Also:
-
HOST
The hostname or IP address of the machine that DDF is running on- See Also:
-
PORT
The port number that DDF is listening on, e.g., 8181- See Also:
-
PROTOCOL
The protocol that DDF is using http/https- See Also:
-
TRUST_STORE
Trust store to use for outgoing DDF connections- See Also:
-
TRUST_STORE_PASS
Password associated with the trust store- See Also:
-
KEY_STORE
Key store to use for outgoing DDF connections- See Also:
-
KEY_STORE_PASS
Password associated with the key store- See Also:
-
SITE_NAME
The site name for this DDF instance- See Also:
-
VERSION
The version of DDF currently running- See Also:
-
ORGANIZATION
The organization that this instance of DDF is running for- See Also:
-
CONTACT
Site (email) contact- See Also:
-
services
List of DdfManagedServices to push the DDF system settings to. -
configuration
The map of DDF system settings, including the read-only settings. -
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. -
configurationAdmin
protected org.osgi.service.cm.ConfigurationAdmin configurationAdmin
-
-
Constructor Details
-
ConfigurationManager
public 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.- Parameters:
services- the list of watchers of changes to the DDF System SettingsconfigurationAdmin- the OSGi Configuration Admin service handle
-
-
Method Details
-
setProtocol
-
setHost
-
setPort
-
setId
-
setVersion
-
setOrganization
-
setContact
-
init
public void init()Called once after all managed property setters have been called. -
updated
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.- Parameters:
updatedConfig- map of DDF system settings, not including the read-only settings. Can be null.
-
bind
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.- Parameters:
service-properties- does nothing
-
getConfigurationAdmin
public org.osgi.service.cm.ConfigurationAdmin getConfigurationAdmin()- Returns:
- OSGi Configuratrion Admin service handle
-
setConfigurationAdmin
public void setConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin configurationAdmin) - Parameters:
configurationAdmin-
-
getConfigurationValue
Retrieves the value of an OSGi bundle's configuration property- Parameters:
servicePid- PID for an OSGi bundlepropertyName- name of the bundle's configuration property to get a value for- Returns:
- the value of the specified bundle's configuration property
-