Class StartupConfiguration

    • Field Detail

      • SENSITIVE_CONFIGURATION_VARIABLES

        public static final List<String> SENSITIVE_CONFIGURATION_VARIABLES
        List of configuration keys or JVM override keys that should hide their values. Short keys are used for dumps to the log, qualified JVM argument keys are for About page.
    • Constructor Detail

      • StartupConfiguration

        public StartupConfiguration​(String midPointHome,
                                    String configFilename)
        Alternative constructor for use in the tests.
    • Method Detail

      • getMidpointHome

        public String getMidpointHome()
        Specified by:
        getMidpointHome in interface MidpointConfiguration
        Returns:
        midPoint home directory. Currently, it is the same value as in "midpoint.home" system property.
      • getConfiguration

        public org.apache.commons.configuration2.Configuration getConfiguration​(@NotNull
                                                                                @NotNull String componentName)
        Description copied from interface: MidpointConfiguration
        Get configuration for symbolic name of the component from configuration subsystem.
        Specified by:
        getConfiguration in interface MidpointConfiguration
        Parameters:
        componentName - name of the component Samples of names:
        • repository -> midpoint.repository
          provisioning -> midpoint.provisioning
      • Returns:
        Configuration object Sample how to get config value: config.getInt("port", 1234);
      • getConfiguration

        public org.apache.commons.configuration2.Configuration getConfiguration()
        Specified by:
        getConfiguration in interface MidpointConfiguration
        Returns:
        Global configuration.
      • init

        public void init()
        Initialize system configuration
      • isPrintSensitiveValues

        public static boolean isPrintSensitiveValues()
      • isSafeMode

        public boolean isSafeMode()
        Specified by:
        isSafeMode in interface MidpointConfiguration
        Returns:
        True if we are running in safe mode (the exact meaning gradually evolves; but the overall idea is to make midPoint barely usable to be able to fix the worst problems preventing it from running normally).
      • keyMatches

        public boolean keyMatches​(String key,
                                  String... regexPatterns)
        Description copied from interface: MidpointConfiguration
        Returns true if the configuration key matches any of provided regular expression patterns. Provided pattern must match the whole value, see String.matches(java.lang.String). Some examples:
        • x\.y.* - value starts with x.y (dot must be escaped, in Java String syntax double backslash must be used!)
        • (?i)sql - value is exactly SQL, ignoring casing
        Specified by:
        keyMatches in interface MidpointConfiguration
        Parameters:
        key - key from configuration, starting at configuration element (root), can be complex, e.g. midpoint.repository.type.
        regexPatterns - regular expression patterns that must match the whole value. It is possible to match null too, if no regex pattern is used, or if the first pattern itself is null.