Package org.linuxforhealth.fhir.config
Class FHIRConfiguration
- java.lang.Object
-
- org.linuxforhealth.fhir.config.FHIRConfiguration
-
public class FHIRConfiguration extends java.lang.Object
This class serves up a singleton instance of ConfigurationService containing the FHIR Server's configuration.
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description FHIRConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearConfiguration()
Clears the entire cache of configuration objects.static java.lang.String
getConfigHome()
Returns the "home" directory for FHIR Server configuration information (this directory will contain the "config" directory, etc.).java.util.List<java.lang.String>
getConfiguredTenants()
This method returns the list of tenant ids for which a configuration directory exists.static FHIRConfiguration
getInstance()
PropertyGroup
loadConfiguration()
Retrieves the FHIR Server default configuration and returns it as a PropertyGroup.PropertyGroup
loadConfigurationForTenant(java.lang.String tenantId)
Loads the configuration for the specified tenant id.static void
setConfigHome(java.lang.String s)
This method is used to configure an explicit top-level directory where FHIR Server configuration information is expected to reside.static java.lang.String
validateDatastoreId(java.lang.String dsId)
Validate the datastore id against a regexstatic java.lang.String
validateTenantId(java.lang.String tenantId)
Validate the tenant id against a regex (to prevent path manipulation)
-
-
-
Field Detail
-
CONFIG_LOCATION
public static final java.lang.String CONFIG_LOCATION
- See Also:
- Constant Field Values
-
CONFIG_FILE_BASENAME
public static final java.lang.String CONFIG_FILE_BASENAME
- See Also:
- Constant Field Values
-
DEFAULT_TENANT_ID
public static final java.lang.String DEFAULT_TENANT_ID
- See Also:
- Constant Field Values
-
DEFAULT_DATASTORE_ID
public static final java.lang.String DEFAULT_DATASTORE_ID
- See Also:
- Constant Field Values
-
PROPERTY_ORIGINAL_REQUEST_URI_HEADER_NAME
public static final java.lang.String PROPERTY_ORIGINAL_REQUEST_URI_HEADER_NAME
- See Also:
- Constant Field Values
-
PROPERTY_TENANT_ID_HEADER_NAME
public static final java.lang.String PROPERTY_TENANT_ID_HEADER_NAME
- See Also:
- Constant Field Values
-
PROPERTY_SHARD_KEY_HEADER_NAME
public static final java.lang.String PROPERTY_SHARD_KEY_HEADER_NAME
- See Also:
- Constant Field Values
-
PROPERTY_DATASTORE_ID_HEADER_NAME
public static final java.lang.String PROPERTY_DATASTORE_ID_HEADER_NAME
- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_TENANT_ID
public static final java.lang.String PROPERTY_DEFAULT_TENANT_ID
- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_PRETTY_PRINT
public static final java.lang.String PROPERTY_DEFAULT_PRETTY_PRINT
- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_HANDLING
public static final java.lang.String PROPERTY_DEFAULT_HANDLING
- See Also:
- Constant Field Values
-
PROPERTY_ALLOW_CLIENT_HANDLING_PREF
public static final java.lang.String PROPERTY_ALLOW_CLIENT_HANDLING_PREF
- See Also:
- Constant Field Values
-
PROPERTY_CHECK_REFERENCE_TYPES
public static final java.lang.String PROPERTY_CHECK_REFERENCE_TYPES
- See Also:
- Constant Field Values
-
PROPERTY_CHECK_CONTROL_CHARS
public static final java.lang.String PROPERTY_CHECK_CONTROL_CHARS
- See Also:
- Constant Field Values
-
PROPERTY_CONDITIONAL_DELETE_MAX_NUMBER
public static final java.lang.String PROPERTY_CONDITIONAL_DELETE_MAX_NUMBER
- See Also:
- Constant Field Values
-
PROPERTY_IF_NONE_MATCH_RETURNS_NOT_MODIFIED
public static final java.lang.String PROPERTY_IF_NONE_MATCH_RETURNS_NOT_MODIFIED
- See Also:
- Constant Field Values
-
PROPERTY_SERVER_REGISTRY_RESOURCE_PROVIDER_ENABLED
public static final java.lang.String PROPERTY_SERVER_REGISTRY_RESOURCE_PROVIDER_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_SERVER_RESOLVE_FUNCTION_ENABLED
public static final java.lang.String PROPERTY_SERVER_RESOLVE_FUNCTION_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_CAPABILITY_STATEMENT_CACHE
public static final java.lang.String PROPERTY_CAPABILITY_STATEMENT_CACHE
- See Also:
- Constant Field Values
-
PROPERTY_EXTENDED_CODEABLE_CONCEPT_VALIDATION
public static final java.lang.String PROPERTY_EXTENDED_CODEABLE_CONCEPT_VALIDATION
- See Also:
- Constant Field Values
-
PROPERTY_DISABLED_OPERATIONS
public static final java.lang.String PROPERTY_DISABLED_OPERATIONS
- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_PAGE_SIZE
public static final java.lang.String PROPERTY_DEFAULT_PAGE_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_MAX_PAGE_SIZE
public static final java.lang.String PROPERTY_MAX_PAGE_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_MAX_PAGE_INCLUDE_COUNT
public static final java.lang.String PROPERTY_MAX_PAGE_INCLUDE_COUNT
- See Also:
- Constant Field Values
-
PROPERTY_CAPABILITIES_URL
public static final java.lang.String PROPERTY_CAPABILITIES_URL
- See Also:
- Constant Field Values
-
PROPERTY_DEFAULT_FHIR_VERSION
public static final java.lang.String PROPERTY_DEFAULT_FHIR_VERSION
- See Also:
- Constant Field Values
-
PROPERTY_WHOLE_SYSTEM_TYPE_SCOPING
public static final java.lang.String PROPERTY_WHOLE_SYSTEM_TYPE_SCOPING
- See Also:
- Constant Field Values
-
PROPERTY_VALIDATION_FAIL_FAST
public static final java.lang.String PROPERTY_VALIDATION_FAIL_FAST
- See Also:
- Constant Field Values
-
PROPERTY_TERM_SERVICE_CAPABILITIES_URL
public static final java.lang.String PROPERTY_TERM_SERVICE_CAPABILITIES_URL
- See Also:
- Constant Field Values
-
PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_ENABLED
public static final java.lang.String PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_TIME_LIMIT
public static final java.lang.String PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_TIME_LIMIT
- See Also:
- Constant Field Values
-
PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_CONFIGURATION
public static final java.lang.String PROPERTY_GRAPH_TERM_SERVICE_PROVIDER_CONFIGURATION
- See Also:
- Constant Field Values
-
PROPERTY_RESOURCES
public static final java.lang.String PROPERTY_RESOURCES
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_OPEN
public static final java.lang.String PROPERTY_FIELD_RESOURCES_OPEN
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_INTERACTIONS
public static final java.lang.String PROPERTY_FIELD_RESOURCES_INTERACTIONS
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_SEARCH_PARAMETERS
public static final java.lang.String PROPERTY_FIELD_RESOURCES_SEARCH_PARAMETERS
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_SEARCH_INCLUDES
public static final java.lang.String PROPERTY_FIELD_RESOURCES_SEARCH_INCLUDES
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_SEARCH_REV_INCLUDES
public static final java.lang.String PROPERTY_FIELD_RESOURCES_SEARCH_REV_INCLUDES
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_SEARCH_PARAMETER_COMBINATIONS
public static final java.lang.String PROPERTY_FIELD_RESOURCES_SEARCH_PARAMETER_COMBINATIONS
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_PROFILES
public static final java.lang.String PROPERTY_FIELD_RESOURCES_PROFILES
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_PROFILES_AT_LEAST_ONE
public static final java.lang.String PROPERTY_FIELD_RESOURCES_PROFILES_AT_LEAST_ONE
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_PROFILES_NOT_ALLOWED
public static final java.lang.String PROPERTY_FIELD_RESOURCES_PROFILES_NOT_ALLOWED
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_PROFILES_ALLOW_UNKNOWN
public static final java.lang.String PROPERTY_FIELD_RESOURCES_PROFILES_ALLOW_UNKNOWN
- See Also:
- Constant Field Values
-
PROPERTY_FIELD_RESOURCES_PROFILES_DEFAULT_VERSIONS
public static final java.lang.String PROPERTY_FIELD_RESOURCES_PROFILES_DEFAULT_VERSIONS
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_CORS
public static final java.lang.String PROPERTY_SECURITY_CORS
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_BASIC_ENABLED
public static final java.lang.String PROPERTY_SECURITY_BASIC_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_CERT_ENABLED
public static final java.lang.String PROPERTY_SECURITY_CERT_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_ENABLED
public static final java.lang.String PROPERTY_SECURITY_OAUTH_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_REG_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_REG_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_AUTH_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_AUTH_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_TOKEN_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_TOKEN_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_MANAGE_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_MANAGE_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_INTROSPECT_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_INTROSPECT_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_REVOKE_URL
public static final java.lang.String PROPERTY_SECURITY_OAUTH_REVOKE_URL
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_SMART_ENABLED
public static final java.lang.String PROPERTY_SECURITY_OAUTH_SMART_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_SMART_SCOPES
public static final java.lang.String PROPERTY_SECURITY_OAUTH_SMART_SCOPES
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_OAUTH_SMART_CAPABILITIES
public static final java.lang.String PROPERTY_SECURITY_OAUTH_SMART_CAPABILITIES
- See Also:
- Constant Field Values
-
PROPERTY_SECURITY_VALIDATE_BINARY_SECURITY_CONTEXT
public static final java.lang.String PROPERTY_SECURITY_VALIDATE_BINARY_SECURITY_CONTEXT
- See Also:
- Constant Field Values
-
PROPERTY_AUDIT_SERVICE_CLASS_NAME
public static final java.lang.String PROPERTY_AUDIT_SERVICE_CLASS_NAME
- See Also:
- Constant Field Values
-
PROPERTY_AUDIT_SERVICE_PROPERTIES
public static final java.lang.String PROPERTY_AUDIT_SERVICE_PROPERTIES
- See Also:
- Constant Field Values
-
PROPERTY_AUDIT_PATIENT_ID_EXTURL
public static final java.lang.String PROPERTY_AUDIT_PATIENT_ID_EXTURL
- See Also:
- Constant Field Values
-
PROPERTY_AUDIT_HOSTNAME
public static final java.lang.String PROPERTY_AUDIT_HOSTNAME
- See Also:
- Constant Field Values
-
PROPERTY_AUDIT_IP
public static final java.lang.String PROPERTY_AUDIT_IP
- See Also:
- Constant Field Values
-
PROPERTY_NOTIFICATION_RESOURCE_TYPES
public static final java.lang.String PROPERTY_NOTIFICATION_RESOURCE_TYPES
- See Also:
- Constant Field Values
-
PROPERTY_NOTIFICATION_NOTIFICATION_SIZE_BEHAVIOR
public static final java.lang.String PROPERTY_NOTIFICATION_NOTIFICATION_SIZE_BEHAVIOR
- See Also:
- Constant Field Values
-
PROPERTY_NOTIFICATION_MAX_SIZE
public static final java.lang.String PROPERTY_NOTIFICATION_MAX_SIZE
- See Also:
- Constant Field Values
-
PROPERTY_WEBSOCKET_ENABLED
public static final java.lang.String PROPERTY_WEBSOCKET_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_ENABLED
public static final java.lang.String PROPERTY_KAFKA_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_TOPICNAME
public static final java.lang.String PROPERTY_KAFKA_TOPICNAME
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_CONNECTIONPROPS
public static final java.lang.String PROPERTY_KAFKA_CONNECTIONPROPS
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_SYNC
public static final java.lang.String PROPERTY_KAFKA_SYNC
- See Also:
- Constant Field Values
-
PROPERTY_NATS_ENABLED
public static final java.lang.String PROPERTY_NATS_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_NATS_CLUSTER
public static final java.lang.String PROPERTY_NATS_CLUSTER
- See Also:
- Constant Field Values
-
PROPERTY_NATS_CHANNEL
public static final java.lang.String PROPERTY_NATS_CHANNEL
- See Also:
- Constant Field Values
-
PROPERTY_NATS_CLIENT
public static final java.lang.String PROPERTY_NATS_CLIENT
- See Also:
- Constant Field Values
-
PROPERTY_NATS_SERVERS
public static final java.lang.String PROPERTY_NATS_SERVERS
- See Also:
- Constant Field Values
-
PROPERTY_NATS_TLS_ENABLED
public static final java.lang.String PROPERTY_NATS_TLS_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_NATS_TRUSTSTORE
public static final java.lang.String PROPERTY_NATS_TRUSTSTORE
- See Also:
- Constant Field Values
-
PROPERTY_NATS_TRUSTSTORE_PW
public static final java.lang.String PROPERTY_NATS_TRUSTSTORE_PW
- See Also:
- Constant Field Values
-
PROPERTY_NATS_KEYSTORE
public static final java.lang.String PROPERTY_NATS_KEYSTORE
- See Also:
- Constant Field Values
-
PROPERTY_NATS_KEYSTORE_PW
public static final java.lang.String PROPERTY_NATS_KEYSTORE_PW
- See Also:
- Constant Field Values
-
PROPERTY_REMOTE_INDEX_SERVICE_TYPE
public static final java.lang.String PROPERTY_REMOTE_INDEX_SERVICE_TYPE
- See Also:
- Constant Field Values
-
PROPERTY_REMOTE_INDEX_SERVICE_INSTANCEIDENTIFIER
public static final java.lang.String PROPERTY_REMOTE_INDEX_SERVICE_INSTANCEIDENTIFIER
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_INDEX_SERVICE_TOPICNAME
public static final java.lang.String PROPERTY_KAFKA_INDEX_SERVICE_TOPICNAME
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_INDEX_SERVICE_CONNECTIONPROPS
public static final java.lang.String PROPERTY_KAFKA_INDEX_SERVICE_CONNECTIONPROPS
- See Also:
- Constant Field Values
-
PROPERTY_KAFKA_INDEX_SERVICE_MODE
public static final java.lang.String PROPERTY_KAFKA_INDEX_SERVICE_MODE
- See Also:
- Constant Field Values
-
PROPERTY_OPERATIONS_EVERYTHING
public static final java.lang.String PROPERTY_OPERATIONS_EVERYTHING
- See Also:
- Constant Field Values
-
PROPERTY_OPERATIONS_EVERYTHING_INCLUDE_TYPES
public static final java.lang.String PROPERTY_OPERATIONS_EVERYTHING_INCLUDE_TYPES
- See Also:
- Constant Field Values
-
PROPERTY_UPDATE_CREATE_ENABLED
public static final java.lang.String PROPERTY_UPDATE_CREATE_ENABLED
- See Also:
- Constant Field Values
-
PROPERTY_PERSISTENCE_FACTORY
public static final java.lang.String PROPERTY_PERSISTENCE_FACTORY
- See Also:
- Constant Field Values
-
PROPERTY_DATASOURCES
public static final java.lang.String PROPERTY_DATASOURCES
- See Also:
- Constant Field Values
-
PROPERTY_JDBC_ENABLE_READ_ONLY_REPLICAS
public static final java.lang.String PROPERTY_JDBC_ENABLE_READ_ONLY_REPLICAS
- See Also:
- Constant Field Values
-
PROPERTY_PERSISTENCE_PAYLOAD
public static final java.lang.String PROPERTY_PERSISTENCE_PAYLOAD
- See Also:
- Constant Field Values
-
PROPERTY_JDBC_SEARCH_OPTIMIZER_OPTIONS
public static final java.lang.String PROPERTY_JDBC_SEARCH_OPTIMIZER_OPTIONS
- See Also:
- Constant Field Values
-
PROPERTY_SEARCH_BOUNDING_AREA_RADIUS_TYPE
public static final java.lang.String PROPERTY_SEARCH_BOUNDING_AREA_RADIUS_TYPE
- See Also:
- Constant Field Values
-
DEFAULT_TENANT_ID_HEADER_NAME
public static final java.lang.String DEFAULT_TENANT_ID_HEADER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_DATASTORE_ID_HEADER_NAME
public static final java.lang.String DEFAULT_DATASTORE_ID_HEADER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_PRETTY_RESPONSE_HEADER_NAME
public static final java.lang.String DEFAULT_PRETTY_RESPONSE_HEADER_NAME
- See Also:
- Constant Field Values
-
DEFAULT_SHARD_KEY_HEADER_NAME
public static final java.lang.String DEFAULT_SHARD_KEY_HEADER_NAME
- See Also:
- Constant Field Values
-
FHIR_SERVER_DEFAULT_CONFIG
public static final java.lang.String FHIR_SERVER_DEFAULT_CONFIG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static FHIRConfiguration getInstance()
-
setConfigHome
public static void setConfigHome(java.lang.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 java.lang.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 interpreted 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 java.lang.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:
java.lang.Exception
- if the configuration file was found but couldn't be loaded
-
loadConfigurationForTenant
public PropertyGroup loadConfigurationForTenant(java.lang.String tenantId) throws java.lang.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:
java.lang.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 java.util.List<java.lang.String> getConfiguredTenants()
This method returns the list of tenant ids for which a configuration directory exists.- Returns:
- a possibly-empty list of tenant ids that isn't null
-
validateTenantId
public static java.lang.String validateTenantId(java.lang.String tenantId) throws FHIRException
Validate the tenant id against a regex (to prevent path manipulation)- Parameters:
tenantId
-- Returns:
- Throws:
FHIRException
-
validateDatastoreId
public static java.lang.String validateDatastoreId(java.lang.String dsId) throws FHIRException
Validate the datastore id against a regex- Parameters:
dsId
- the datasource id to validate- Returns:
- Throws:
FHIRException
-
-