
Package ca.uhn.fhir.jpa.interceptor
Class RequestHeaderPartitionInterceptor
java.lang.Object
ca.uhn.fhir.jpa.interceptor.RequestHeaderPartitionInterceptor
This is an interceptor to identify the partition ID from a request header.
It reads the value of the X-Request-Partition-IDs header, which is expected to be a comma separated partition ids.
For the read operations it uses all the partitions specified in the header.
The create operations it uses the first partition ID from the header.
The tests for the functionality of this interceptor can be found in the ca.uhn.fhir.jpa.interceptor.RequestHeaderPartitionTest class.
-
Constructor Summary
ConstructorsConstructorDescriptionRequestHeaderPartitionInterceptor
(IDefaultPartitionSettings theDefaultPartitionSettings) -
Method Summary
Modifier and TypeMethodDescriptionidentifyPartitionForCreate
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Identifies the partition ID for create operations by parsing the first ID from the X-Request-Partition-IDs header.identifyPartitionForRead
(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Identifies partition IDs for read operations by parsing all IDs from the X-Request-Partition-IDs header.
-
Constructor Details
-
RequestHeaderPartitionInterceptor
-
-
Method Details
-
identifyPartitionForCreate
public RequestPartitionId identifyPartitionForCreate(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Identifies the partition ID for create operations by parsing the first ID from the X-Request-Partition-IDs header. -
identifyPartitionForRead
public RequestPartitionId identifyPartitionForRead(ca.uhn.fhir.rest.api.server.RequestDetails theRequestDetails) Identifies partition IDs for read operations by parsing all IDs from the X-Request-Partition-IDs header.
-