Enum Class Pointcut

java.lang.Object
java.lang.Enum<Pointcut>
ca.uhn.fhir.interceptor.api.Pointcut
All Implemented Interfaces:
IPointcut, Serializable, Comparable<Pointcut>, Constable

public enum Pointcut extends Enum<Pointcut> implements IPointcut
Value for Hook.value()

Hook pointcuts are divided into several broad categories:

  • INTERCEPTOR_xxx: Hooks on the interceptor infrastructure itself
  • CLIENT_xxx: Hooks on the HAPI FHIR Client framework
  • SERVER_xxx: Hooks on the HAPI FHIR Server framework
  • SUBSCRIPTION_xxx: Hooks on the HAPI FHIR Subscription framework
  • STORAGE_xxx: Hooks on the storage engine
  • VALIDATION_xxx: Hooks on the HAPI FHIR Validation framework
  • JPA_PERFTRACE_xxx: Performance tracing hooks on the JPA server

  • Enum Constant Details

    • INTERCEPTOR_REGISTERED

      public static final Pointcut INTERCEPTOR_REGISTERED
      Interceptor Framework Hook: This pointcut will be called once when a given interceptor is registered
    • CLIENT_REQUEST

      public static final Pointcut CLIENT_REQUEST
      Client Hook: This hook is called before an HTTP client request is sent

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request
      • ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request

      Hook methods must return void.
    • CLIENT_RESPONSE

      public static final Pointcut CLIENT_RESPONSE
      Client Hook: This hook is called after an HTTP client request has completed, prior to returning the results to the calling code. Hook methods may modify the response.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request
      • ca.uhn.fhir.rest.client.api.IHttpResponse - The details of the response
      • ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
      • ca.uhn.fhir.rest.client.api.ClientResponseContext - Contains an IHttpRequest, an IHttpResponse, and an IRestfulClient and also allows the client to mutate the contained IHttpResponse

      Hook methods must return void.
    • SERVER_CAPABILITY_STATEMENT_GENERATED

      Server Hook: This hook is called when a server CapabilityStatement is generated for returning to a client.

      This pointcut will not necessarily be invoked for every client request to the `/metadata` endpoint. If caching of the generated CapabilityStatement is enabled, a new CapabilityStatement will be generated periodically and this pointcut will be invoked at that time.

      Hooks may accept the following parameters:

      • org.hl7.fhir.instance.model.api.IBaseConformance - The CapabilityStatement resource that will be returned to the client by the server. Interceptors may make changes to this resource. The parameter must be of type IBaseConformance, so it is the responsibility of the interceptor hook method code to cast to the appropriate version.
      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.

      Hook methods may an instance of a new CapabilityStatement resource which will replace the one that was supplied to the interceptor, or void to use the original one. If the interceptor chooses to modify the CapabilityStatement that was supplied to the interceptor, it is fine for your hook method to return void or null.
    • SERVER_INCOMING_REQUEST_PRE_PROCESSED

      Server Hook: This hook is called before any other processing takes place for each incoming request. It may be used to provide alternate handling for some requests, or to screen requests before they are handled, etc.

      Note that any exceptions thrown by this method will not be trapped by HAPI (they will be passed up to the server)

      Hooks may accept the following parameters:

      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return true or void if processing should continue normally. This is generally the right thing to do. If your interceptor is providing a response rather than letting HAPI handle the response normally, you must return false. In this case, no further processing will occur and no further interceptors will be called.
    • SERVER_HANDLE_EXCEPTION

      public static final Pointcut SERVER_HANDLE_EXCEPTION
      Server Hook: This hook is invoked upon any exception being thrown within the server's request processing code. This includes any exceptions thrown within resource provider methods (e.g. Search and Read methods) as well as any runtime exceptions thrown by the server itself. This also includes any AuthenticationException thrown.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
      • ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException - The exception that was thrown

      Implementations of this method may choose to ignore/log/count/etc exceptions, and return true or void. In this case, processing will continue, and the server will automatically generate an OperationOutcome. Implementations may also choose to provide their own response to the client. In this case, they should return false, to indicate that they have handled the request and processing should stop.

    • SERVER_INCOMING_REQUEST_PRE_HANDLER_SELECTED

      Server Hook: This method is immediately before the handling method is selected. Interceptors may make changes to the request that can influence which handler will ultimately be called.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated at the time this hook is called.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return true or void if processing should continue normally. This is generally the right thing to do. If your interceptor is providing an HTTP response rather than letting HAPI handle the response normally, you must return false. In this case, no further processing will occur and no further interceptors will be called.

      Hook methods may also throw AuthenticationException if they would like. This exception may be thrown to indicate that the interceptor has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.

      Since:
      5.4.0
    • SERVER_INCOMING_REQUEST_POST_PROCESSED

      Server Hook: This method is called just before the actual implementing server method is invoked.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return true or void if processing should continue normally. This is generally the right thing to do. If your interceptor is providing an HTTP response rather than letting HAPI handle the response normally, you must return false. In this case, no further processing will occur and no further interceptors will be called.

      Hook methods may also throw AuthenticationException if they would like. This exception may be thrown to indicate that the interceptor has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.

    • SERVER_INCOMING_REQUEST_PRE_HANDLED

      Server Hook: This hook is invoked before an incoming request is processed. Note that this method is called after the server has begun preparing the response to the incoming client request. As such, it is not able to supply a response to the incoming request in the way that SERVER_INCOMING_REQUEST_PRE_PROCESSED and SERVER_INCOMING_REQUEST_POST_PROCESSED are. At this point the request has already been passed to the handler so any changes (e.g. adding parameters) will not be considered. If you'd like to modify request parameters before they are passed to the handler, use SERVER_INCOMING_REQUEST_PRE_HANDLER_SELECTED or SERVER_INCOMING_REQUEST_POST_PROCESSED. If you are attempting to modify a search before it occurs, use STORAGE_PRESEARCH_REGISTERED.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • ca.uhn.fhir.rest.api.RestOperationTypeEnum - The type of operation that the FHIR server has determined that the client is trying to invoke

      Hook methods must return void

      Hook methods method may throw a subclass of BaseServerResponseException, and processing will be aborted with an appropriate error returned to the client.

    • SERVER_PROVIDER_METHOD_BOUND

      Server Hook: This method is called when a resource provider method is registered and being bound by the HAPI FHIR Plain Server / RestfulServer.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.server.method.BaseMethodBinding - The method binding.

      Hook methods may modify the method binding, replace it, or return null to cancel the binding.

    • SERVER_PRE_PROCESS_OUTGOING_EXCEPTION

      Server Hook: This method is called upon any exception being thrown within the server's request processing code. This includes any exceptions thrown within resource provider methods (e.g. Search and Read methods) as well as any runtime exceptions thrown by the server itself. This hook method is invoked for each interceptor (until one of them returns a non-null response or the end of the list is reached), after which SERVER_HANDLE_EXCEPTION is called for each interceptor.

      This may be used to add an OperationOutcome to a response, or to convert between exception types for any reason.

      Implementations of this method may choose to ignore/log/count/etc exceptions, and return null. In this case, processing will continue, and the server will automatically generate an OperationOutcome. Implementations may also choose to provide their own response to the client. In this case, they should return a non-null, to indicate that they have handled the request and processing should stop.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • java.lang.Throwable - The exception that was thrown. This will often be an instance of BaseServerResponseException but will not necessarily be one (e.g. it could be a NullPointerException in the case of a bug being triggered.
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return a new exception to use for processing, or null if this interceptor is not trying to modify the exception. For example, if this interceptor has nothing to do with exception processing, it should always return null. If this interceptor adds an OperationOutcome to the exception, it should return an exception.

    • SERVER_OUTGOING_RESPONSE

      public static final Pointcut SERVER_OUTGOING_RESPONSE
      Server Hook: This method is called after the server implementation method has been called, but before any attempt to stream the response back to the client. Interceptors may examine or modify the response before it is returned, or even prevent the response.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be returned. This parameter may be null for some responses.
      • ca.uhn.fhir.rest.api.server.ResponseDetails - This object contains details about the response, including the contents. Hook methods may modify this object to change or replace the response.
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return true or void if processing should continue normally. This is generally the right thing to do. If your interceptor is providing a response rather than letting HAPI handle the response normally, you must return false. In this case, no further processing will occur and no further interceptors will be called.

      Hook methods may also throw AuthenticationException to indicate that the interceptor has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.

    • SERVER_OUTGOING_WRITER_CREATED

      Server Hook: This method is called when a stream writer is generated that will be used to stream a non-binary response to a client. Hooks may return a wrapped writer which adds additional functionality as needed.

      Hooks may accept the following parameters:

      • java.io.Writer - The response writing Writer. Typically a hook will wrap this writer and layer additional functionality into the wrapping writer.
      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.

      Hook methods should return a Writer instance that will be used to stream the response. Hook methods should not throw any exception.

      Since:
      5.0.0
    • SERVER_OUTGOING_GRAPHQL_RESPONSE

      Server Hook: This method is called after the server implementation method has been called, but before any attempt to stream the response back to the client, specifically for GraphQL requests (as these do not fit cleanly into the model provided by SERVER_OUTGOING_RESPONSE).

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • java.lang.String - The GraphQL query
      • java.lang.String - The GraphQL response
      • jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
      • jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment

      Hook methods may return true or void if processing should continue normally. This is generally the right thing to do. If your interceptor is providing a response rather than letting HAPI handle the response normally, you must return false. In this case, no further processing will occur and no further interceptors will be called.

      Hook methods may also throw AuthenticationException to indicate that the interceptor has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.

    • SERVER_OUTGOING_FAILURE_OPERATIONOUTCOME

      Server Hook: This method is called when an OperationOutcome is being returned in response to a failure. Hook methods may use this hook to modify the OperationOutcome being returned.

      Hooks may accept the following parameters:

      • ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. Note that the bean properties are not all guaranteed to be populated, depending on how early during processing the exception occurred.
      • ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
      • org.hl7.fhir.instance.model.api.IBaseOperationOutcome - The OperationOutcome resource that will be returned.
    • ca.uhn.fhir.rest.api.server.ResponseDetails - A wrapper around the Http Status Code and resource that will be used in the response to the caller. The Pointcut may decide to change this value from the default value of 500 representing an Internal Server Error. The OperationOutcome is passed for modification directly, and as part of the ResponseDetails parameter. To replace the response resource entirely, use ResponseDetails.setResponseResource().

    Hook methods must return void