Package ca.uhn.fhir.jpa.partition
Interface IRequestPartitionHelperSvc
public interface IRequestPartitionHelperSvc
-
Method Summary
Modifier and TypeMethodDescriptionca.uhn.fhir.interceptor.model.RequestPartitionId
determineCreatePartitionForRequest
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, org.hl7.fhir.instance.model.api.IBaseResource theResource, String theResourceType) ca.uhn.fhir.interceptor.model.RequestPartitionId
determineGenericPartitionForRequest
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequest
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, ReadPartitionIdRequestDetails theDetails) default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForHistory
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, org.hl7.fhir.instance.model.api.IIdType theIdType) Determine partition to use when performing the history operation based on a resource type and resource instance.default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForRead
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, org.hl7.fhir.instance.model.api.IIdType theId) Determine partition to use when performing database reads against a certain resource type based on a resource instance.default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForRead
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, org.hl7.fhir.instance.model.api.IIdType theId) Determine partition to use when performing database reads based on a resource instance.default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForSearchType
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType) Determine partition to use when performing a database search against a certain resource type.default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForSearchType
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, SearchParameterMap theParams) Determine partition to use when performing a database search based on a resource type and other search parameters.default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForSearchType
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, SearchParameterMap theParams, org.hl7.fhir.instance.model.api.IBaseResource theConditionalOperationTargetOrNull) Determine partition to use when performing a database search based on a resource type, search parameters and a conditional target resource (if available).default ca.uhn.fhir.interceptor.model.RequestPartitionId
determineReadPartitionForRequestForServerOperation
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theOperationName) Determine partition to use when performing a server operation such as $bulk-import, $bulk-export, $reindex etc.boolean
isResourcePartitionable
(String theResourceType) toReadPartitions
(ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) ca.uhn.fhir.interceptor.model.RequestPartitionId
validateAndNormalizePartitionIds
(ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) No interceptors should be invoked by this method.ca.uhn.fhir.interceptor.model.RequestPartitionId
validateAndNormalizePartitionNames
(ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) No interceptors should be invoked by this method.default void
validateHasPartitionPermissions
(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId)
-
Method Details
-
determineReadPartitionForRequest
@Nonnull ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequest(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull ReadPartitionIdRequestDetails theDetails) -
determineReadPartitionForRequestForServerOperation
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForServerOperation(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull String theOperationName) Determine partition to use when performing a server operation such as $bulk-import, $bulk-export, $reindex etc.- Parameters:
theRequest
- the request details from the context of the calltheOperationName
- the explicit name of the operation- Returns:
- the partition id which should be used for the operation
-
determineReadPartitionForRequestForRead
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForRead(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull org.hl7.fhir.instance.model.api.IIdType theId) Determine partition to use when performing database reads based on a resource instance.- Parameters:
theRequest
- the request details from the context of the calltheId
- the id of the resource instance- Returns:
- the partition id which should be used for the database read
-
determineReadPartitionForRequestForRead
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForRead(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull String theResourceType, @Nonnull org.hl7.fhir.instance.model.api.IIdType theId) Determine partition to use when performing database reads against a certain resource type based on a resource instance.- Parameters:
theRequest
- the request details from the context of the calltheResourceType
- the resource typetheId
- the id of the resource instance- Returns:
- the partition id which should be used for the database read
-
determineReadPartitionForRequestForSearchType
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForSearchType(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull String theResourceType) Determine partition to use when performing a database search against a certain resource type.- Parameters:
theRequest
- the request details from the context of the calltheResourceType
- the resource type- Returns:
- the partition id which should be used for the database search
-
determineReadPartitionForRequestForSearchType
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForSearchType(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull String theResourceType, @Nonnull SearchParameterMap theParams) Determine partition to use when performing a database search based on a resource type and other search parameters.- Parameters:
theRequest
- the request details from the context of the calltheResourceType
- the resource typetheParams
- the search parameters- Returns:
- the partition id which should be used for the database search
-
determineReadPartitionForRequestForSearchType
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForSearchType(ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, SearchParameterMap theParams, org.hl7.fhir.instance.model.api.IBaseResource theConditionalOperationTargetOrNull) Determine partition to use when performing a database search based on a resource type, search parameters and a conditional target resource (if available).- Parameters:
theRequest
- the request details from the context of the calltheResourceType
- the resource typetheParams
- the search parameterstheConditionalOperationTargetOrNull
- the conditional target resource- Returns:
- the partition id which should be used for the database search
-
determineGenericPartitionForRequest
ca.uhn.fhir.interceptor.model.RequestPartitionId determineGenericPartitionForRequest(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) -
determineReadPartitionForRequestForHistory
@Nonnull default ca.uhn.fhir.interceptor.model.RequestPartitionId determineReadPartitionForRequestForHistory(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, org.hl7.fhir.instance.model.api.IIdType theIdType) Determine partition to use when performing the history operation based on a resource type and resource instance.- Parameters:
theRequest
- the request details from the context of the calltheResourceType
- the resource typetheIdType
- the id of the resource instance- Returns:
- the partition id which should be used for the history operation
-
validateHasPartitionPermissions
default void validateHasPartitionPermissions(@Nonnull ca.uhn.fhir.rest.api.server.RequestDetails theRequest, String theResourceType, ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) -
determineCreatePartitionForRequest
@Nonnull ca.uhn.fhir.interceptor.model.RequestPartitionId determineCreatePartitionForRequest(@Nullable ca.uhn.fhir.rest.api.server.RequestDetails theRequest, @Nonnull org.hl7.fhir.instance.model.api.IBaseResource theResource, @Nonnull String theResourceType) -
toReadPartitions
@Nonnull Set<Integer> toReadPartitions(@Nonnull ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) -
isResourcePartitionable
-
validateAndNormalizePartitionIds
ca.uhn.fhir.interceptor.model.RequestPartitionId validateAndNormalizePartitionIds(ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) No interceptors should be invoked by this method. It should ONLY be used when partition ids are known, but partition names are not.
Ensures the list of partition ids inside the givenRequestPartitionId
correctly map to the list of partition names. If the list of partition names is empty, this method will map the correct partition names and return a normalizedRequestPartitionId
.- Parameters:
theRequestPartitionId
- - An unvalidated and unnormalizedRequestPartitionId
.- Returns:
- - A
RequestPartitionId
with a normalized list of partition ids and partition names.
-
validateAndNormalizePartitionNames
ca.uhn.fhir.interceptor.model.RequestPartitionId validateAndNormalizePartitionNames(ca.uhn.fhir.interceptor.model.RequestPartitionId theRequestPartitionId) No interceptors should be invoked by this method. It should ONLY be used when partition names are known, but partition ids are not.
Ensures the list of partition names inside the givenRequestPartitionId
correctly map to the list of partition ids. If the list of partition ids is empty, this method will map the correct partition ids and return a normalizedRequestPartitionId
.- Parameters:
theRequestPartitionId
- - An unvalidated and unnormalizedRequestPartitionId
.- Returns:
- - A
RequestPartitionId
with a normalized list of partition ids and partition names.
-