Class BackendRegistry
java.lang.Object
org.fhirfrog.frog.server.registry.BackendRegistry
Registry of available FHIR server backends for test execution.
Backends are loaded from multiple sources in priority order (last wins on name collision):
- Project-local:
sushi-config.yaml→fhir-frog.server/fhir-frog.servers - User-level:
~/.fhir-frog/backends.yaml - Environment variables:
FHIR_FROG_SERVER_URL,FHIR_FROG_AUTH_*
All tools (CLI, Ant, Maven plugin, frog-runner) resolve backends through this class.
-
Method Summary
Modifier and TypeMethodDescriptionall()All registered backends.static BackendRegistryempty()Creates an empty registry.findByConformsTo(String canonical) Find all backends claiming the given IG canonical.findByName(String name) Find a backend by its human-readable name.static BackendRegistryLoads and merges backends from multiple sources.static BackendRegistryLoads with a custom environment variable resolver (for testing).static BackendRegistryof(List<ServerBackend> backends) Creates a registry from an explicit list of backends.Resolves a single backend for a test run.
-
Method Details
-
empty
Creates an empty registry. -
of
Creates a registry from an explicit list of backends. -
load
Loads and merges backends from multiple sources. Later sources override earlier ones when backends share the same name.- Parameters:
sources- paths tobackends.yamlorsushi-config.yamlfiles; non-existent files are silently skipped- Returns:
- merged registry
-
load
Loads with a custom environment variable resolver (for testing). -
all
All registered backends. -
findByConformsTo
Find all backends claiming the given IG canonical. -
findByName
Find a backend by its human-readable name. -
resolve
Resolves a single backend for a test run.Resolution order:
- If
explicitUrlis given, creates an ad-hoc anonymous backend - If
nameis given, looks up by name - If
conformsTois given, returns the first matching backend - If there is exactly one backend in the registry, returns it
- Throws:
IllegalArgumentException- if resolution fails (no match, ambiguous)
- If
-