Interface DataSourceConfiguration


public interface DataSourceConfiguration

This interface allows public access to values inside a DataSource configuration file. To access each element, simply pass the field name as a parameter and its value will be returned.

Each value in the configuration file has an implicit type. To return that type, call the corresponding method (NB all values can be returned as Strings). For more information on value types, refer to other Caplin documentation (eg Liberator Administration Guide).

  • Method Details

    • getBooleanValue

      boolean getBooleanValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as a boolean.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a boolean. false as default.
    • getBooleanValue

      boolean getBooleanValue(String fieldName, boolean defaultValue)

      Accesses the configuration file and returns the value of the requested field as a boolean.

      Parameters:
      fieldName - name of the field in the configuration file.
      defaultValue - defaultValue to be used if there is no configuration value.
      Returns:
      value parsed as a boolean or defaultValue if no value exists.
    • getIntValue

      int getIntValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as an int.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as an int. -1 as default
    • getIntValue

      int getIntValue(String fieldName, int defaultValue)

      Accesses the configuration file and returns the value of the requested field as a int.

      Parameters:
      fieldName - name of the field in the configuration file.
      defaultValue - defaultValue to be used if there is no configuration value.
      Returns:
      value parsed as a int or defaultValue if no value exists.
    • getDoubleValue

      double getDoubleValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as a double.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a double. -1.0 as default.
    • getDoubleValue

      double getDoubleValue(String fieldName, double defaultValue)

      Accesses the configuration file and returns the value of the requested field as a double.

      Parameters:
      fieldName - name of the field in the configuration file.
      defaultValue - defaultValue to be used if there is no configuration value.
      Returns:
      value parsed as a double or defaultValue if no value exists.
    • getStringValue

      String getStringValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as a string.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a string. Empty String as default.
    • getStringValue

      String getStringValue(String fieldName, String defaultValue)

      Accesses the configuration file and returns the last value of the requested field as a string. Note this value is interpolated with System properties.

      Parameters:
      fieldName - name of the field in the configuration file.
      defaultValue - defaultValue to be used if there is no configuration value.
      Returns:
      value parsed as a double or defaultValue if no value exists.
    • getStringValueExpanded

      String getStringValueExpanded(String fieldName)

      Accesses the configuration file and returns the last value of the requested field as a string. Note this value is interpolated with System properties.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a double. Empty String as default.
    • getStringValueExpanded

      String getStringValueExpanded(String fieldName, String defaultValue)

      Accesses the configuration file and returns the last value of the requested field as a string. Note this value is interpolated with System properties.

      Parameters:
      fieldName - name of the field in the configuration file.
      defaultValue - defaultValue to be used if there is no configuration value.
      Returns:
      value parsed as a double or defaultValue if no value exists.
    • getStringArrayValue

      List<String> getStringArrayValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as an List of String.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a String. Empty List as default.
    • getStringArrayValueExpanded

      List<String> getStringArrayValueExpanded(String fieldName)

      Accesses the configuration file and returns the value of the requested field as an List of String. Note this value is interpolated with System properties.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a String. Empty List as default.
    • getBooleanArrayValue

      List<Boolean> getBooleanArrayValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as an List of Boolean.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a Boolean. Empty List as default.
    • getIntegerArrayValue

      List<Integer> getIntegerArrayValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as an List of Integer.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as an Integer. Empty List as default.
    • getDoubleArrayValue

      List<Double> getDoubleArrayValue(String fieldName)

      Accesses the configuration file and returns the value of the requested field as a List of Double.

      Parameters:
      fieldName - name of the field in the configuration file.
      Returns:
      value parsed as a Double. Empty List as default.
    • getConfigurationBlocksByName

      List<DataSourceConfiguration> getConfigurationBlocksByName(String blockName)
      Accesses the configuration file and returns the Configuration Block(s) of blockName with list, return as List of DataSourceConfiguration Object E.G a add-log configuration block would be accessed by passing in a blackName value of "logList"
      Parameters:
      blockName - the name of the config block
      Returns:
      the configuration parent block
    • toPrettyString

      String toPrettyString(StringBuilder builder, String indent)

       

      Create a formatted String representation of this configuration node
      Parameters:
      builder - the builder to append the data to.
      indent - the indent value to use.
      Returns:
      formatted String representation of this configuration node.
    • getAppName

      String getAppName()