
Class ConsentInterceptor
java.lang.Object
ca.uhn.fhir.rest.server.interceptor.consent.ConsentInterceptor
The ConsentInterceptor can be used to apply arbitrary consent rules and data access policies
on responses from a FHIR server.
See Consent Interceptor for more information on this interceptor.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructorConsentInterceptor(IConsentService theConsentService) ConstructorConsentInterceptor(IConsentService theConsentService, IConsentContextServices theContextConsentServices) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected voidauthorizeRequest(RequestDetails theRequestDetails) protected RequestDetailsgetRequestDetailsForCurrentExportOperation(BulkExportJobParameters theParameters, org.hl7.fhir.instance.model.api.IBaseResource theBaseResource) voidinterceptOutgoingResponse(RequestDetails theRequestDetails, ResponseDetails theResponseDetails) voidinterceptPreAccess(RequestDetails theRequestDetails, IPreResourceAccessDetails thePreResourceAccessDetails) booleaninterceptPreCheckForCachedSearch(RequestDetails theRequestDetails) Check if this request is eligible for cached search results.voidinterceptPreHandled(RequestDetails theRequestDetails) voidinterceptPreSearchRegistered(RequestDetails theRequestDetails, ICachedSearchDetails theCachedSearchDetails) Check if the search results from this request might be reused by later searches.voidinterceptPreShow(RequestDetails theRequestDetails, IPreResourceShowDetails thePreResourceShowDetails) registerConsentService(IConsentService theConsentService) Adds a consent service to the chain.voidrequestFailed(RequestDetails theRequest, ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException theException) voidrequestSucceeded(RequestDetails theRequest) voidsetConsentService(IConsentService theConsentService) Deprecated.voidsetContextConsentServices(IConsentContextServices theContextConsentServices) booleanshouldBulkExportIncludeResource(BulkExportJobParameters theParameters, org.hl7.fhir.instance.model.api.IBaseResource theResource) unregisterConsentService(IConsentService theConsentService) Removes a consent service from the chain.
-
Constructor Details
-
ConsentInterceptor
public ConsentInterceptor()Constructor -
ConsentInterceptor
Constructor- Parameters:
theConsentService- Must not benull
-
ConsentInterceptor
public ConsentInterceptor(IConsentService theConsentService, IConsentContextServices theContextConsentServices) Constructor- Parameters:
theConsentService- Must not benulltheContextConsentServices- Must not benull
-
-
Method Details
-
setContextConsentServices
-
setConsentService
Deprecated.UseregisterConsentService(IConsentService)instead -
registerConsentService
Adds a consent service to the chain.Thread safety note: This method can be called while the service is actively processing requestes
- Parameters:
theConsentService- The service to register. Must not benull.- Since:
- 6.0.0
-
unregisterConsentService
Removes a consent service from the chain.Thread safety note: This method can be called while the service is actively processing requestes
- Parameters:
theConsentService- The service to unregister. Must not benull.- Since:
- 6.0.0
-
getConsentServices
-
interceptPreHandled
-
authorizeRequest
-
interceptPreCheckForCachedSearch
Check if this request is eligible for cached search results. We can't use a cached result if consent may use canSeeResource. This checks for AUTHORIZED requests, and the responses from shouldProcessCanSeeResource() to see if this holds.- Returns:
- may the request be satisfied from cache.
-
interceptPreSearchRegistered
public void interceptPreSearchRegistered(RequestDetails theRequestDetails, ICachedSearchDetails theCachedSearchDetails) Check if the search results from this request might be reused by later searches. We can't use a cached result if consent may use canSeeResource. This checks for AUTHORIZED requests, and the responses from shouldProcessCanSeeResource() to see if this holds. If not, marks the result as single-use. -
interceptPreAccess
public void interceptPreAccess(RequestDetails theRequestDetails, IPreResourceAccessDetails thePreResourceAccessDetails) -
interceptPreShow
public void interceptPreShow(RequestDetails theRequestDetails, IPreResourceShowDetails thePreResourceShowDetails) -
interceptOutgoingResponse
public void interceptOutgoingResponse(RequestDetails theRequestDetails, ResponseDetails theResponseDetails) -
requestFailed
public void requestFailed(RequestDetails theRequest, ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException theException) -
requestSucceeded
-
getRequestDetailsForCurrentExportOperation
protected RequestDetails getRequestDetailsForCurrentExportOperation(BulkExportJobParameters theParameters, org.hl7.fhir.instance.model.api.IBaseResource theBaseResource) -
shouldBulkExportIncludeResource
public boolean shouldBulkExportIncludeResource(BulkExportJobParameters theParameters, org.hl7.fhir.instance.model.api.IBaseResource theResource)
-
registerConsentService(IConsentService)instead