Class ConfigurationService


  • public class ConfigurationService
    extends java.lang.Object
    The ConfigurationService is used by the FHIR Server to retrieve JSON-based configuration data.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ConfigurationService.EnvironmentVariables
      Utility class that allows mocking system environment variables retrieval in test classes (as Mockito disallows mocking static methods of System).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PROPERTY_GROUP_CLASSNAME
      This property can be used to set the name of the "property group" class that should be instantiated with the top-level JsonObject representing the configuration.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PropertyGroup loadConfiguration​(java.io.InputStream is)
      Loads the specified input stream as a JSON file and returns a PropertyGroup containing the contents of the JSON file as the root property group.
      static PropertyGroup loadConfiguration​(java.lang.String filename)
      Loads the specified file as a JSON file and returns a PropertyGroup containing the contents of the JSON file as the root property group.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PROPERTY_GROUP_CLASSNAME

        public static final java.lang.String PROPERTY_GROUP_CLASSNAME
        This property can be used to set the name of the "property group" class that should be instantiated with the top-level JsonObject representing the configuration.
        See Also:
        Constant Field Values
    • Constructor Detail

      • ConfigurationService

        public ConfigurationService()
    • Method Detail

      • loadConfiguration

        public static PropertyGroup loadConfiguration​(java.lang.String filename)
                                               throws java.lang.Exception
        Loads the specified file as a JSON file and returns a PropertyGroup containing the contents of the JSON file as the root property group.
        Parameters:
        filename - the name of the JSON file to be loaded
        Throws:
        java.io.FileNotFoundException
        java.lang.Exception
      • loadConfiguration

        public static PropertyGroup loadConfiguration​(java.io.InputStream is)
                                               throws java.lang.Exception
        Loads the specified input stream as a JSON file and returns a PropertyGroup containing the contents of the JSON file as the root property group.
        Parameters:
        is - an InputStream to the input JSON file
        Throws:
        java.lang.Exception