
Package ca.uhn.fhir.repository.impl
Class UrlRepositoryFactory
java.lang.Object
ca.uhn.fhir.repository.impl.UrlRepositoryFactory
Use ServiceLoader to load
IRepositoryLoader implementations
and provide chain-of-responsibility style matching by url to build IRepository instances.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRepositorybuildRepository(FhirContext theFhirContext, String theRepositoryUrl) Find a factory forIRepositorybased on the given URL.buildRequest(String theBaseUrl, FhirContext theFhirContext) Builder for our abstractIRepositoryLoader.IRepositoryRequestinterface.static booleanisRepositoryUrl(String theBaseUrl)
-
Field Details
-
FHIR_REPOSITORY_URL_SCHEME
- See Also:
-
-
Constructor Details
-
UrlRepositoryFactory
public UrlRepositoryFactory()
-
-
Method Details
-
isRepositoryUrl
-
buildRepository
@Nonnull public static IRepository buildRepository(@Nullable FhirContext theFhirContext, @Nonnull String theRepositoryUrl) Find a factory forIRepositorybased on the given URL. This URL is expected to be in the form of fhir-repository:subscheme:details. The subscheme is used to find a matchingIRepositoryLoaderimplementation.- Parameters:
theFhirContext- the FHIR context to use for the repository, if required.theRepositoryUrl- a url of the form fhir-repository:subscheme:details- Returns:
- a repository instance
- Throws:
IllegalArgumentException- if the URL is not a valid repository URL, or no loader can be found for the URL.
-
buildRequest
@Nonnull public static IRepositoryLoader.IRepositoryRequest buildRequest(@Nonnull String theBaseUrl, @Nullable FhirContext theFhirContext) Builder for our abstractIRepositoryLoader.IRepositoryRequestinterface.- Parameters:
theBaseUrl- the fhir-repository URL to parse, e.g. fhir-repository:memory:my-repotheFhirContext- the FHIR context to use for the repository, if required.
-