Class ConfigurationManager

java.lang.Object
org.codice.ddf.configuration.ConfigurationManager

public class ConfigurationManager extends Object
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 Details

    • PID

      public static final String PID
      Service PID to use to look up System Settings Configuration.
      See Also:
    • HOME_DIR

      public static final String HOME_DIR
      The directory where DDF is installed
      See Also:
    • HTTP_PORT

      public static final String HTTP_PORT
      The port number that CXF's underlying Jetty server is listening on, e.g., 8181
      See Also:
    • SERVICES_CONTEXT_ROOT

      public static final String 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

      public static final String HOST
      The hostname or IP address of the machine that DDF is running on
      See Also:
    • PORT

      public static final String PORT
      The port number that DDF is listening on, e.g., 8181
      See Also:
    • PROTOCOL

      public static final String PROTOCOL
      The protocol that DDF is using http/https
      See Also:
    • TRUST_STORE

      public static final String TRUST_STORE
      Trust store to use for outgoing DDF connections
      See Also:
    • TRUST_STORE_PASS

      public static final String TRUST_STORE_PASS
      Password associated with the trust store
      See Also:
    • KEY_STORE

      public static final String KEY_STORE
      Key store to use for outgoing DDF connections
      See Also:
    • KEY_STORE_PASS

      public static final String KEY_STORE_PASS
      Password associated with the key store
      See Also:
    • SITE_NAME

      public static final String SITE_NAME
      The site name for this DDF instance
      See Also:
    • VERSION

      public static final String VERSION
      The version of DDF currently running
      See Also:
    • ORGANIZATION

      public static final String ORGANIZATION
      The organization that this instance of DDF is running for
      See Also:
    • CONTACT

      public static final String CONTACT
      Site (email) contact
      See Also:
    • services

      protected List<ConfigurationWatcher> services
      List of DdfManagedServices to push the DDF system settings to.
    • configuration

      protected Map<String,String> configuration
      The map of DDF system settings, including the read-only settings.
    • readOnlySettings

      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.
    • 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 Settings
      configurationAdmin - the OSGi Configuration Admin service handle
  • Method Details

    • setProtocol

      public void setProtocol(String protocol)
    • setHost

      public void setHost(String host)
    • setPort

      public void setPort(String port)
    • setId

      public void setId(String id)
    • setVersion

      public void setVersion(String version)
    • setOrganization

      public void setOrganization(String organization)
    • setContact

      public void setContact(String contact)
    • init

      public void init()
      Called once after all managed property setters have been called.
    • updated

      public 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.
      Parameters:
      updatedConfig - map of DDF system settings, not including the read-only settings. Can be null.
    • bind

      public 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.
      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

      public String getConfigurationValue(String servicePid, String propertyName)
      Retrieves the value of an OSGi bundle's configuration property
      Parameters:
      servicePid - PID for an OSGi bundle
      propertyName - name of the bundle's configuration property to get a value for
      Returns:
      the value of the specified bundle's configuration property