Class FHIRConfiguration


  • public class FHIRConfiguration
    extends Object
    This class serves up a singleton instance of ConfigurationService containing the FHIR Server's configuration.
    • Constructor Detail

      • FHIRConfiguration

        public FHIRConfiguration()
    • Method Detail

      • setConfigHome

        public static void setConfigHome​(String s)
        This method is used to configure an explicit top-level directory where FHIR Server configuration information is expected to reside.

        For example, by calling this method with value "/mydir", then we'd expect to find config files whose names are of the form: "/mydir/config/<tenant-id>/fhir-server-config.json"

        The default location for config files is the current working directory (i.e. "" - the empty string).

        Parameters:
        s - the new config home directory name
      • getConfigHome

        public static String getConfigHome()
        Returns the "home" directory for FHIR Server configuration information (this directory will contain the "config" directory, etc.).

        The default value of this property is "" which is interpretted to mean the current working directory (which for a running FHIR Server will be $WLP_HOME/wlp/usr/servers/fhir-server).

      • loadConfiguration

        public PropertyGroup loadConfiguration()
                                        throws Exception
        Retrieves the FHIR Server default configuration and returns it as a PropertyGroup.
        Returns:
        the top-level property group of the default tenant or null if it doesn't exist
        Throws:
        Exception - if the configuration file was found but couldn't be loaded
      • loadConfigurationForTenant

        public PropertyGroup loadConfigurationForTenant​(String tenantId)
                                                 throws Exception
        Loads the configuration for the specified tenant id.
        Parameters:
        tenantId - a shortname representing the tenant whose configuration will be loaded
        Returns:
        the top-level property group representing this tenant's configuration or null if it doesn't exist
        Throws:
        Exception
      • clearConfiguration

        public void clearConfiguration()
        Clears the entire cache of configuration objects. This can be used perhaps during testing when you need to clear and re-load the configuration.
      • getConfiguredTenants

        public List<String> getConfiguredTenants()
        This method returns the list of tenant id's for which a configuration exists.
        Returns: