Class BeamlineConfigurationService

java.lang.Object
uk.ac.diamond.daq.configuration.BeamlineConfigurationService
All Implemented Interfaces:
BeamlineConfiguration, PropertyService

public class BeamlineConfigurationService extends Object implements BeamlineConfiguration, PropertyService
  • Constructor Details

    • BeamlineConfigurationService

      public BeamlineConfigurationService()
  • Method Details

    • activate

      public void activate(Map<String,String> properties)
    • getSpringXml

      public Stream<URL> getSpringXml()
      Specified by:
      getSpringXml in interface BeamlineConfiguration
    • getPropertiesFiles

      public Stream<URL> getPropertiesFiles()
      Specified by:
      getPropertiesFiles in interface BeamlineConfiguration
    • getLoggingConfiguration

      public Stream<URL> getLoggingConfiguration()
      Specified by:
      getLoggingConfiguration in interface BeamlineConfiguration
    • getProfiles

      public Stream<String> getProfiles()
      Specified by:
      getProfiles in interface BeamlineConfiguration
    • properties

      public org.apache.commons.configuration2.Configuration properties()
      Specified by:
      properties in interface BeamlineConfiguration
    • properties

      public Map<String,String> properties(Predicate<String> keyFilter)
      Specified by:
      properties in interface BeamlineConfiguration
    • directProperties

      public Map<String,String> directProperties()
      Description copied from interface: BeamlineConfiguration
      The properties made available directly rather than loaded via files
      Specified by:
      directProperties in interface BeamlineConfiguration
    • getAsString

      public String getAsString(String property, String defaultValue)
      Description copied from interface: PropertyService
      Get the value of a property as a String with a default.
      Specified by:
      getAsString in interface PropertyService
      Parameters:
      property - The property to lookup
      defaultValue - The value to return if the property is not set
      Returns:
      The property value or the defaultValue if not set
      See Also:
    • getAsInt

      public int getAsInt(String property, int defaultValue)
      Description copied from interface: PropertyService
      Get the value of a property as an int with a default. An attempt to convert the property value to an int will be made, if this fails the default will be returned.
      Specified by:
      getAsInt in interface PropertyService
      Parameters:
      property - The property to lookup
      defaultValue - The value to return if the property is not set
      Returns:
      The property value or the defaultValue if not set
    • getAsDouble

      public double getAsDouble(String property, double defaultValue)
      Description copied from interface: PropertyService
      Get the value of a property as an double with a default. An attempt to convert the property value to a double will be made, if this fails the default will be returned.
      Specified by:
      getAsDouble in interface PropertyService
      Parameters:
      property - The property to lookup
      defaultValue - The value to return if the property is not set
      Returns:
      The property value or the defaultValue if not set
    • getAsBoolean

      public boolean getAsBoolean(String property, boolean defaultValue)
      Description copied from interface: PropertyService
      Get the value of a property as a boolean with a default. An attempt to convert the property value to a boolean will be made, if this fails the default will be returned.
      Specified by:
      getAsBoolean in interface PropertyService
      Parameters:
      property - The property to lookup
      defaultValue - The value to return if the property is not set
      Returns:
      The property value or the defaultValue if not set
    • isSet

      public boolean isSet(String property)
      Description copied from interface: PropertyService
      Check if a property is set.
      Specified by:
      isSet in interface PropertyService
      Parameters:
      property - The property to lookup
      Returns:
      true if the property is set, false otherwise
    • set

      public void set(String property, String value)
      Description copied from interface: PropertyService
      Sets a property to the provided value. It will only be set for the life of the JVM, it will not be persisted to the property files.

      This method is provided to bridge support for existing code, new code should not set properties programmatically at runtime and support for this feature will be removed in the future.

      Specified by:
      set in interface PropertyService
      Parameters:
      property - The property to set
      value - The value to set the property to