Class AbstractConfiguration

java.lang.Object
io.goobi.viewer.controller.AbstractConfiguration
Direct Known Subclasses:
Configuration

public abstract class AbstractConfiguration extends Object
Abstract configuration with base getters.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration>
     
    protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.commons.configuration2.XMLConfiguration
     
    protected org.apache.commons.configuration2.XMLConfiguration
     
    protected boolean
    getLocalBoolean(String inPath, boolean inDefault)
    getLocalBoolean.
    protected org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>
    getLocalConfigurationAt.
    protected List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>>
    getLocalConfigurationsAt.
    protected static List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>>
    getLocalConfigurationsAt(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath)
     
    protected float
    getLocalFloat.
    protected float
    getLocalFloat(String inPath, float inDefault)
    getLocalFloat.
    protected int
    getLocalInt(String inPath, int inDefault)
    getLocalInt.
    protected List<String>
    getLocalList.
    protected List<String>
    getLocalList(String inPath, List<String> defaultList)
    getLocalList.
    protected static List<String>
    getLocalList(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath, List<String> defaultList)
    getLocalList.
    protected List<Object>
    getLocalNodeList.
    protected String
    getLocalString.
    protected String
    getLocalString(String inPath, String inDefault)
    getLocalString.
    void
    overrideValue(String property, Object value)
    Overrides values in the config file (for unit test purposes).

    Methods inherited from class java.lang.Object

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

    • builder

      protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration> builder
    • builderLocal

      protected org.apache.commons.configuration2.builder.ReloadingFileBasedConfigurationBuilder<org.apache.commons.configuration2.XMLConfiguration> builderLocal
  • Constructor Details

    • AbstractConfiguration

      public AbstractConfiguration()
  • Method Details

    • getConfig

      protected org.apache.commons.configuration2.XMLConfiguration getConfig()
      Returns:
      XMLConfiguration that is synced with the current state of the config file
    • getConfigLocal

      protected org.apache.commons.configuration2.XMLConfiguration getConfigLocal()
      Returns:
      XMLConfiguration that is synced with the current state of the config file
    • getLocalInt

      protected int getLocalInt(String inPath, int inDefault)

      getLocalInt.

      Parameters:
      inPath - a String object.
      inDefault - a int.
      Returns:
      a int.
    • getLocalFloat

      protected float getLocalFloat(String inPath)

      getLocalFloat.

      Parameters:
      inPath - a String object.
      Returns:
      a float.
    • getLocalFloat

      protected float getLocalFloat(String inPath, float inDefault)

      getLocalFloat.

      Parameters:
      inPath - a String object.
      inDefault - a float.
      Returns:
      a float.
    • getLocalString

      protected String getLocalString(String inPath, String inDefault)

      getLocalString.

      Parameters:
      inPath - a String object.
      inDefault - a String object.
      Returns:
      a String object.
    • getLocalString

      protected String getLocalString(String inPath)

      getLocalString.

      Parameters:
      inPath - a String object.
      Returns:
      a String object.
    • getLocalNodeList

      protected List<Object> getLocalNodeList(String inPath)

      getLocalNodeList.

      Parameters:
      inPath - a String object.
      Returns:
      a List object.
    • getLocalList

      protected static List<String> getLocalList(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath, List<String> defaultList)

      getLocalList.

      Parameters:
      config - Preferred configuration
      altConfig - Alternative configuration
      inPath - XML path
      defaultList - List of default values to return if none found in config
      Returns:
      a List object.
    • getLocalList

      protected List<String> getLocalList(String inPath, List<String> defaultList)

      getLocalList.

      Parameters:
      inPath - a String object.
      defaultList - a List object.
      Returns:
      configured list; defaultList if none found
    • getLocalList

      protected List<String> getLocalList(String inPath)

      getLocalList.

      Parameters:
      inPath - a String object.
      Returns:
      configured list; empty list if none found
    • getLocalBoolean

      protected boolean getLocalBoolean(String inPath, boolean inDefault)

      getLocalBoolean.

      Parameters:
      inPath - a String object.
      inDefault - a boolean.
      Returns:
      a boolean.
    • getLocalConfigurationsAt

      protected static List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>> getLocalConfigurationsAt(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> altConfig, String inPath)
      Parameters:
      config -
      altConfig -
      inPath -
      Returns:
      List<HierarchicalConfiguration<ImmutableNode>>
    • getLocalConfigurationsAt

      protected List<org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode>> getLocalConfigurationsAt(String inPath)

      getLocalConfigurationsAt.

      Parameters:
      inPath - a String object.
      Returns:
      a List object.
    • getLocalConfigurationAt

      protected org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> getLocalConfigurationAt(String inPath)

      getLocalConfigurationAt.

      Parameters:
      inPath - a String object.
      Returns:
      a HierarchicalConfiguration object.
    • overrideValue

      public void overrideValue(String property, Object value)
      Overrides values in the config file (for unit test purposes).
      Parameters:
      property - Property path (e.g. "accessConditions.fullAccessForLocalhost")
      value - New value to set