Package ca.uhn.fhir.rest.server.tenant
Interface ITenantIdentificationStrategy
- All Known Implementing Classes:
UrlBaseTenantIdentificationStrategy
public interface ITenantIdentificationStrategy
-
Method Summary
Modifier and TypeMethodDescriptionvoid
extractTenant
(ca.uhn.fhir.util.UrlPathTokenizer theUrlPathTokenizer, RequestDetails theRequestDetails) Implementations should use this method to determine the tenant ID based on the incoming request and populate it in theRequestDetails.setTenantId(String)
.massageServerBaseUrl
(String theFhirServerBase, RequestDetails theRequestDetails) Implementations may use this method to tweak the server base URL if necessary based on the tenant IDresolveRelativeUrl
(String theRelativeUrl, RequestDetails theRequestDetails) Implementations may use this method to resolve relative URL based on the tenant ID from RequestDetails.
-
Method Details
-
extractTenant
void extractTenant(ca.uhn.fhir.util.UrlPathTokenizer theUrlPathTokenizer, RequestDetails theRequestDetails) Implementations should use this method to determine the tenant ID based on the incoming request and populate it in theRequestDetails.setTenantId(String)
.- Parameters:
theUrlPathTokenizer
- The tokenizer which is used to parse the request paththeRequestDetails
- The request details object which can be used to access headers and to populate the tenant ID to
-
massageServerBaseUrl
Implementations may use this method to tweak the server base URL if necessary based on the tenant ID -
resolveRelativeUrl
Implementations may use this method to resolve relative URL based on the tenant ID from RequestDetails.- Parameters:
theRelativeUrl
- URL that only includes the path, e.g. "Patient/123"theRequestDetails
- The request details object which can be used to access tenant ID- Returns:
- Resolved relative URL that starts with tenant ID (if tenant ID present in RequestDetails). Example: "TENANT-A/Patient/123".
-