Class ConfluenceApplicationConfig

java.lang.Object
com.atlassian.config.internal.ApplicationConfig
com.atlassian.confluence.impl.setup.ConfluenceApplicationConfig
All Implemented Interfaces:
com.atlassian.config.ApplicationConfiguration

public class ConfluenceApplicationConfig extends com.atlassian.config.internal.ApplicationConfig
Confluence wrapper for ApplicationConfiguration which allows to mutate SetupContext setupComplete state as false only during setup process. Secures all properties named in propertiesToSecure using the SecretService instead of saving them in plaintext.
Since:
9.0.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from class com.atlassian.config.internal.ApplicationConfig

    configurationPersister, DEFAULT_APPLICATION_HOME, DEFAULT_CONFIG_FILE_NAME, NULL_BOOLEAN_VALUE, NULL_INTEGER_VALUE
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfluenceApplicationConfig(com.atlassian.secrets.api.SecretService secretService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    enableSecureProperties(com.atlassian.config.ApplicationConfiguration applicationConfiguration)
    A method to enable the secret service
    void
    Overload of the load method which loads properties from the SecretService if a property value is equal to ConfluenceSecretService.SECRET_PLACEHOLDER.
    void
    Overload of the ApplicationConfiguration.save() method which saves properties in the SecretService and replaces them with the ConfluenceSecretService.SECRET_PLACEHOLDER.
    void
    setSetupComplete(boolean setupComplete)
     

    Methods inherited from class com.atlassian.config.internal.ApplicationConfig

    configFileExists, getApplicationHome, getApplicationVersion, getBooleanProperty, getBuildNumber, getConfigurationFileName, getCurrentSetupStep, getIntegerProperty, getMajorVersion, getMinorVersion, getProperties, getPropertiesWithPrefix, getProperty, getSetupType, isApplicationHomeValid, isSetupComplete, removeProperty, reset, setApplicationHome, setBuildNumber, setConfigurationFileName, setConfigurationPersister, setCurrentSetupStep, setInitialProperties, setMajorVersion, setMinorVersion, setProperty, setProperty, setProperty, setSetupType

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ConfluenceApplicationConfig

      public ConfluenceApplicationConfig(com.atlassian.secrets.api.SecretService secretService)
  • Method Details

    • load

      public void load() throws com.atlassian.config.ConfigurationException
      Overload of the load method which loads properties from the SecretService if a property value is equal to ConfluenceSecretService.SECRET_PLACEHOLDER. Reading secured properties can be disabled through the use of the system-wide flag SecretService.SECRET_SERVICE_STATE_SYSTEM_PROP.
      Specified by:
      load in interface com.atlassian.config.ApplicationConfiguration
      Overrides:
      load in class com.atlassian.config.internal.ApplicationConfig
      Throws:
      com.atlassian.config.ConfigurationException
      Since:
      9.0.0
    • save

      public void save() throws com.atlassian.config.ConfigurationException
      Overload of the ApplicationConfiguration.save() method which saves properties in the SecretService and replaces them with the ConfluenceSecretService.SECRET_PLACEHOLDER. Securing properties can be disabled through the use of the system-wide flag SecretService.SECRET_SERVICE_STATE_SYSTEM_PROP or by removing the SECURED_PROPERTIES property.
      Specified by:
      save in interface com.atlassian.config.ApplicationConfiguration
      Overrides:
      save in class com.atlassian.config.internal.ApplicationConfig
      Throws:
      com.atlassian.config.ConfigurationException
      Since:
      9.0.0
    • setSetupComplete

      public void setSetupComplete(boolean setupComplete)
      Specified by:
      setSetupComplete in interface com.atlassian.config.ApplicationConfiguration
      Overrides:
      setSetupComplete in class com.atlassian.config.internal.ApplicationConfig
    • enableSecureProperties

      public static void enableSecureProperties(com.atlassian.config.ApplicationConfiguration applicationConfiguration)
      A method to enable the secret service
      Parameters:
      applicationConfiguration - represents the application config for shared or local home
      Since:
      9.1.0