001/*-
002 * #%L
003 * HAPI FHIR - Core Library
004 * %%
005 * Copyright (C) 2014 - 2025 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.interceptor.api;
021
022import ca.uhn.fhir.model.base.resource.BaseOperationOutcome;
023import ca.uhn.fhir.rest.annotation.Read;
024import ca.uhn.fhir.rest.annotation.Search;
025import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
026import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
027import ca.uhn.fhir.validation.ValidationResult;
028import jakarta.annotation.Nonnull;
029import org.apache.commons.lang3.Validate;
030import org.hl7.fhir.instance.model.api.IBaseConformance;
031
032import java.io.Writer;
033import java.util.Arrays;
034import java.util.Collections;
035import java.util.HashSet;
036import java.util.List;
037import java.util.Set;
038
039import static ca.uhn.fhir.interceptor.api.IInterceptorBroadcaster.*;
040
041/**
042 * Value for {@link Hook#value()}
043 * <p>
044 * Hook pointcuts are divided into several broad categories:
045 * <ul>
046 * <li>INTERCEPTOR_xxx: Hooks on the interceptor infrastructure itself</li>
047 * <li>CLIENT_xxx: Hooks on the HAPI FHIR Client framework</li>
048 * <li>SERVER_xxx: Hooks on the HAPI FHIR Server framework</li>
049 * <li>SUBSCRIPTION_xxx: Hooks on the HAPI FHIR Subscription framework</li>
050 * <li>STORAGE_xxx: Hooks on the storage engine</li>
051 * <li>VALIDATION_xxx: Hooks on the HAPI FHIR Validation framework</li>
052 * <li>JPA_PERFTRACE_xxx: Performance tracing hooks on the JPA server</li>
053 * </ul>
054 * </p>
055 */
056public enum Pointcut implements IPointcut {
057
058        /**
059         * <b>Interceptor Framework Hook:</b>
060         * This pointcut will be called once when a given interceptor is registered
061         */
062        INTERCEPTOR_REGISTERED(void.class),
063
064        /**
065         * <b>Client Hook:</b>
066         * This hook is called before an HTTP client request is sent
067         * <p>
068         * Hooks may accept the following parameters:
069         * <ul>
070         * <li>
071         * ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request
072         * </li>
073         * <li>
074         *    ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
075         * </li>
076         * </ul>
077         * </p>
078         * Hook methods must return <code>void</code>.
079         */
080        CLIENT_REQUEST(
081                        void.class, "ca.uhn.fhir.rest.client.api.IHttpRequest", "ca.uhn.fhir.rest.client.api.IRestfulClient"),
082
083        /**
084         * <b>Client Hook:</b>
085         * This hook is called after an HTTP client request has completed, prior to returning
086         * the results to the calling code. Hook methods may modify the response.
087         * <p>
088         * Hooks may accept the following parameters:
089         * <ul>
090         * <li>
091         * ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request
092         * </li>
093         * <li>
094         * ca.uhn.fhir.rest.client.api.IHttpResponse - The details of the response
095         * </li>
096         * <li>
097         *    ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request
098         * </li>
099         * <li>
100         *    ca.uhn.fhir.rest.client.api.ClientResponseContext - Contains an IHttpRequest, an IHttpResponse, and an IRestfulClient
101         *    and also allows the client to mutate the contained IHttpResponse
102         * </li>
103         * </ul>
104         * </p>
105         * Hook methods must return <code>void</code>.
106         */
107        CLIENT_RESPONSE(
108                        void.class,
109                        "ca.uhn.fhir.rest.client.api.IHttpRequest",
110                        "ca.uhn.fhir.rest.client.api.IHttpResponse",
111                        "ca.uhn.fhir.rest.client.api.IRestfulClient",
112                        "ca.uhn.fhir.rest.client.api.ClientResponseContext"),
113
114        /**
115         * <b>Server Hook:</b>
116         * This hook is called when a server CapabilityStatement is generated for returning to a client.
117         * <p>
118         * This pointcut will not necessarily be invoked for every client request to the `/metadata` endpoint.
119         * If caching of the generated CapabilityStatement is enabled, a new CapabilityStatement will be
120         * generated periodically and this pointcut will be invoked at that time.
121         * </p>
122         * <p>
123         * Hooks may accept the following parameters:
124         * <ul>
125         * <li>
126         * org.hl7.fhir.instance.model.api.IBaseConformance - The <code>CapabilityStatement</code> resource that will
127         * be returned to the client by the server. Interceptors may make changes to this resource. The parameter
128         * must be of type <code>IBaseConformance</code>, so it is the responsibility of the interceptor hook method
129         * code to cast to the appropriate version.
130         * </li>
131         * <li>
132         * ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to
133         * be processed
134         * </li>
135         * <li>
136         * ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that
137         * is about to be processed. This parameter is identical to the RequestDetails parameter above but will only
138         * be populated when operating in a RestfulServer implementation. It is provided as a convenience.
139         * </li>
140         * </ul>
141         * </p>
142         * Hook methods may an instance of a new <code>CapabilityStatement</code> resource which will replace the
143         * one that was supplied to the interceptor, or <code>void</code> to use the original one. If the interceptor
144         * chooses to modify the <code>CapabilityStatement</code> that was supplied to the interceptor, it is fine
145         * for your hook method to return <code>void</code> or <code>null</code>.
146         */
147        SERVER_CAPABILITY_STATEMENT_GENERATED(
148                        IBaseConformance.class,
149                        "org.hl7.fhir.instance.model.api.IBaseConformance",
150                        "ca.uhn.fhir.rest.api.server.RequestDetails",
151                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
152
153        /**
154         * <b>Server Hook:</b>
155         * This hook is called before any other processing takes place for each incoming request. It may be used to provide
156         * alternate handling for some requests, or to screen requests before they are handled, etc.
157         * <p>
158         * Note that any exceptions thrown by this method will not be trapped by HAPI (they will be passed up to the server)
159         * </p>
160         * <p>
161         * Hooks may accept the following parameters:
162         * <ul>
163         * <li>
164         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
165         * </li>
166         * <li>
167         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
168         * </li>
169         * </ul>
170         * </p>
171         * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally.
172         * This is generally the right thing to do. If your interceptor is providing a response rather than
173         * letting HAPI handle the response normally, you must return <code>false</code>. In this case,
174         * no further processing will occur and no further interceptors will be called.
175         */
176        SERVER_INCOMING_REQUEST_PRE_PROCESSED(
177                        boolean.class, "jakarta.servlet.http.HttpServletRequest", "jakarta.servlet.http.HttpServletResponse"),
178
179        /**
180         * <b>Server Hook:</b>
181         * This hook is invoked upon any exception being thrown within the server's request processing code. This includes
182         * any exceptions thrown within resource provider methods (e.g. {@link Search} and {@link Read} methods) as well as
183         * any runtime exceptions thrown by the server itself. This also includes any {@link AuthenticationException}
184         * thrown.
185         * <p>
186         * Hooks may accept the following parameters:
187         * <ul>
188         * <li>
189         * 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
190         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
191         * pulled out of the servlet request. Note that the bean
192         * properties are not all guaranteed to be populated, depending on how early during processing the
193         * exception occurred.
194         * </li>
195         * <li>
196         * 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
197         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
198         * pulled out of the servlet request. Note that the bean
199         * properties are not all guaranteed to be populated, depending on how early during processing the
200         * exception occurred. This parameter is identical to the RequestDetails parameter above but will
201         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
202         * </li>
203         * <li>
204         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
205         * </li>
206         * <li>
207         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
208         * </li>
209         * <li>
210         * ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException - The exception that was thrown
211         * </li>
212         * </ul>
213         * </p>
214         * <p>
215         * Implementations of this method may choose to ignore/log/count/etc exceptions, and return <code>true</code> or
216         * <code>void</code>. In
217         * this case, processing will continue, and the server will automatically generate an {@link BaseOperationOutcome
218         * OperationOutcome}. Implementations may also choose to provide their own response to the client. In this case, they
219         * should return <code>false</code>, to indicate that they have handled the request and processing should stop.
220         * </p>
221         */
222        SERVER_HANDLE_EXCEPTION(
223                        boolean.class,
224                        "ca.uhn.fhir.rest.api.server.RequestDetails",
225                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
226                        "jakarta.servlet.http.HttpServletRequest",
227                        "jakarta.servlet.http.HttpServletResponse",
228                        "ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException"),
229
230        /**
231         * <b>Server Hook:</b>
232         * This method is immediately before the handling method is selected. Interceptors may make changes
233         * to the request that can influence which handler will ultimately be called.
234         * <p>
235         * Hooks may accept the following parameters:
236         * <ul>
237         * <li>
238         * 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
239         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
240         * pulled out of the servlet request.
241         * Note that the bean properties are not all guaranteed to be populated at the time this hook is called.
242         * </li>
243         * <li>
244         * 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
245         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
246         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
247         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
248         * </li>
249         * <li>
250         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
251         * </li>
252         * <li>
253         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
254         * </li>
255         * </ul>
256         * <p>
257         * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally.
258         * This is generally the right thing to do.
259         * If your interceptor is providing an HTTP response rather than letting HAPI handle the response normally, you
260         * must return <code>false</code>. In this case, no further processing will occur and no further interceptors
261         * will be called.
262         * </p>
263         * <p>
264         * Hook methods may also throw {@link AuthenticationException} if they would like. This exception may be thrown
265         * to indicate that the interceptor has detected an unauthorized access
266         * attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.
267         *
268         * @since 5.4.0
269         */
270        SERVER_INCOMING_REQUEST_PRE_HANDLER_SELECTED(
271                        boolean.class,
272                        "ca.uhn.fhir.rest.api.server.RequestDetails",
273                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
274                        "jakarta.servlet.http.HttpServletRequest",
275                        "jakarta.servlet.http.HttpServletResponse"),
276
277        /**
278         * <b>Server Hook:</b>
279         * This method is called just before the actual implementing server method is invoked.
280         * <p>
281         * Hooks may accept the following parameters:
282         * <ul>
283         * <li>
284         * 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
285         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
286         * pulled out of the servlet request. Note that the bean
287         * properties are not all guaranteed to be populated, depending on how early during processing the
288         * exception occurred.
289         * </li>
290         * <li>
291         * 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
292         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
293         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
294         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
295         * </li>
296         * <li>
297         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
298         * </li>
299         * <li>
300         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
301         * </li>
302         * </ul>
303         * <p>
304         * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally.
305         * This is generally the right thing to do.
306         * If your interceptor is providing an HTTP response rather than letting HAPI handle the response normally, you
307         * must return <code>false</code>. In this case, no further processing will occur and no further interceptors
308         * will be called.
309         * </p>
310         * <p>
311         * Hook methods may also throw {@link AuthenticationException} if they would like. This exception may be thrown
312         * to indicate that the interceptor has detected an unauthorized access
313         * attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.
314         */
315        SERVER_INCOMING_REQUEST_POST_PROCESSED(
316                        boolean.class,
317                        "ca.uhn.fhir.rest.api.server.RequestDetails",
318                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
319                        "jakarta.servlet.http.HttpServletRequest",
320                        "jakarta.servlet.http.HttpServletResponse"),
321
322        /**
323         * <b>Server Hook:</b>
324         * This hook is invoked before an incoming request is processed. Note that this method is called
325         * after the server has begun preparing the response to the incoming client request.
326         * As such, it is not able to supply a response to the incoming request in the way that
327         * SERVER_INCOMING_REQUEST_PRE_PROCESSED and {@link #SERVER_INCOMING_REQUEST_POST_PROCESSED} are.
328         * At this point the request has already been passed to the handler so any changes
329         * (e.g. adding parameters) will not be considered.
330         * If you'd like to modify request parameters before they are passed to the handler,
331         * use {@link Pointcut#SERVER_INCOMING_REQUEST_PRE_HANDLER_SELECTED} or {@link Pointcut#SERVER_INCOMING_REQUEST_POST_PROCESSED}.
332         * If you are attempting to modify a search before it occurs, use {@link Pointcut#STORAGE_PRESEARCH_REGISTERED}.
333         * <p>
334         * Hooks may accept the following parameters:
335         * <ul>
336         * <li>
337         * 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
338         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
339         * pulled out of the servlet request. Note that the bean
340         * properties are not all guaranteed to be populated, depending on how early during processing the
341         * exception occurred.
342         * </li>
343         * <li>
344         * 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
345         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
346         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
347         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
348         * </li>
349         * <li>
350         * ca.uhn.fhir.rest.api.RestOperationTypeEnum - The type of operation that the FHIR server has determined that the client is trying to invoke
351         * </li>
352         * </ul>
353         * </p>
354         * <p>
355         * Hook methods must return <code>void</code>
356         * </p>
357         * <p>
358         * Hook methods method may throw a subclass of {@link BaseServerResponseException}, and processing
359         * will be aborted with an appropriate error returned to the client.
360         * </p>
361         */
362        SERVER_INCOMING_REQUEST_PRE_HANDLED(
363                        void.class,
364                        "ca.uhn.fhir.rest.api.server.RequestDetails",
365                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
366                        "ca.uhn.fhir.rest.api.RestOperationTypeEnum"),
367
368        /**
369         * <b>Server Hook:</b>
370         * This method is called when a resource provider method is registered and being bound
371         * by the HAPI FHIR Plain Server / RestfulServer.
372         * <p>
373         * Hooks may accept the following parameters:
374         * <ul>
375         * <li>
376         * ca.uhn.fhir.rest.server.method.BaseMethodBinding - The method binding.
377         * </li>
378         * </ul>
379         * <p>
380         * Hook methods  may modify the method binding, replace it, or return <code>null</code> to cancel the binding.
381         * </p>
382         */
383        SERVER_PROVIDER_METHOD_BOUND(
384                        "ca.uhn.fhir.rest.server.method.BaseMethodBinding", "ca.uhn.fhir.rest.server.method.BaseMethodBinding"),
385
386        /**
387         * <b>Server Hook:</b>
388         * This method is called upon any exception being thrown within the server's request processing code. This includes
389         * any exceptions thrown within resource provider methods (e.g. {@link Search} and {@link Read} methods) as well as
390         * any runtime exceptions thrown by the server itself. This hook method is invoked for each interceptor (until one of them
391         * returns a non-<code>null</code> response or the end of the list is reached), after which
392         * {@link #SERVER_HANDLE_EXCEPTION} is
393         * called for each interceptor.
394         * <p>
395         * This may be used to add an OperationOutcome to a response, or to convert between exception types for any reason.
396         * </p>
397         * <p>
398         * Implementations of this method may choose to ignore/log/count/etc exceptions, and return <code>null</code>. In
399         * this case, processing will continue, and the server will automatically generate an {@link BaseOperationOutcome
400         * OperationOutcome}. Implementations may also choose to provide their own response to the client. In this case, they
401         * should return a non-<code>null</code>, to indicate that they have handled the request and processing should stop.
402         * </p>
403         * <p>
404         * Hooks may accept the following parameters:
405         * <ul>
406         * <li>
407         * 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
408         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
409         * pulled out of the servlet request. Note that the bean
410         * properties are not all guaranteed to be populated, depending on how early during processing the
411         * exception occurred.
412         * </li>
413         * <li>
414         * 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
415         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
416         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
417         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
418         * </li>
419         * <li>
420         * java.lang.Throwable - The exception that was thrown. This will often be an instance of
421         * {@link BaseServerResponseException} but will not necessarily be one (e.g. it could be a
422         * {@link NullPointerException} in the case of a bug being triggered.
423         * </li>
424         * <li>
425         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
426         * </li>
427         * <li>
428         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
429         * </li>
430         * </ul>
431         * <p>
432         * Hook methods may return a new exception to use for processing, or <code>null</code> if this interceptor is not trying to
433         * modify the exception. For example, if this interceptor has nothing to do with exception processing, it
434         * should always return <code>null</code>. If this interceptor adds an OperationOutcome to the exception, it
435         * should return an exception.
436         * </p>
437         */
438        SERVER_PRE_PROCESS_OUTGOING_EXCEPTION(
439                        BaseServerResponseException.class,
440                        "ca.uhn.fhir.rest.api.server.RequestDetails",
441                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
442                        "java.lang.Throwable",
443                        "jakarta.servlet.http.HttpServletRequest",
444                        "jakarta.servlet.http.HttpServletResponse"),
445
446        /**
447         * <b>Server Hook:</b>
448         * This method is called after the server implementation method has been called, but before any attempt
449         * to stream the response back to the client. Interceptors may examine or modify the response before it
450         * is returned, or even prevent the response.
451         * <p>
452         * Hooks may accept the following parameters:
453         * <ul>
454         * <li>
455         * 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
456         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
457         * pulled out of the servlet request.
458         * </li>
459         * <li>
460         * 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
461         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
462         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
463         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
464         * </li>
465         * <li>
466         * org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be returned. This parameter may be <code>null</code> for some responses.
467         * </li>
468         * <li>
469         * 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.
470         * </li>
471         * <li>
472         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
473         * </li>
474         * <li>
475         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
476         * </li>
477         * </ul>
478         * </p>
479         * <p>
480         * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally.
481         * This is generally the right thing to do. If your interceptor is providing a response rather than
482         * letting HAPI handle the response normally, you must return <code>false</code>. In this case,
483         * no further processing will occur and no further interceptors will be called.
484         * </p>
485         * <p>
486         * Hook methods may also throw {@link AuthenticationException} to indicate that the interceptor
487         * has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401
488         * will be returned to the client.
489         */
490        SERVER_OUTGOING_RESPONSE(
491                        boolean.class,
492                        "ca.uhn.fhir.rest.api.server.RequestDetails",
493                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
494                        "org.hl7.fhir.instance.model.api.IBaseResource",
495                        "ca.uhn.fhir.rest.api.server.ResponseDetails",
496                        "jakarta.servlet.http.HttpServletRequest",
497                        "jakarta.servlet.http.HttpServletResponse"),
498
499        /**
500         * <b>Server Hook:</b>
501         * This method is called when a stream writer is generated that will be used to stream a non-binary response to
502         * a client. Hooks may return a wrapped writer which adds additional functionality as needed.
503         *
504         * <p>
505         * Hooks may accept the following parameters:
506         * <ul>
507         * <li>
508         * java.io.Writer - The response writing Writer. Typically a hook will wrap this writer and layer additional functionality
509         * into the wrapping writer.
510         * </li>
511         * <li>
512         * 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
513         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
514         * pulled out of the servlet request.
515         * </li>
516         * <li>
517         * 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
518         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
519         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
520         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
521         * </li>
522         * </ul>
523         * </p>
524         * <p>
525         * Hook methods should return a {@link Writer} instance that will be used to stream the response. Hook methods
526         * should not throw any exception.
527         * </p>
528         *
529         * @since 5.0.0
530         */
531        SERVER_OUTGOING_WRITER_CREATED(
532                        Writer.class,
533                        "java.io.Writer",
534                        "ca.uhn.fhir.rest.api.server.RequestDetails",
535                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
536
537        /**
538         * <b>Server Hook:</b>
539         * This method is called after the server implementation method has been called, but before any attempt
540         * to stream the response back to the client, specifically for GraphQL requests (as these do not fit
541         * cleanly into the model provided by {@link #SERVER_OUTGOING_RESPONSE}).
542         * <p>
543         * Hooks may accept the following parameters:
544         * <ul>
545         * <li>
546         * 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
547         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
548         * pulled out of the servlet request.
549         * </li>
550         * <li>
551         * 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
552         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
553         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
554         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
555         * </li>
556         * <li>
557         * java.lang.String - The GraphQL query
558         * </li>
559         * <li>
560         * java.lang.String - The GraphQL response
561         * </li>
562         * <li>
563         * jakarta.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment
564         * </li>
565         * <li>
566         * jakarta.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment
567         * </li>
568         * </ul>
569         * </p>
570         * <p>
571         * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally.
572         * This is generally the right thing to do. If your interceptor is providing a response rather than
573         * letting HAPI handle the response normally, you must return <code>false</code>. In this case,
574         * no further processing will occur and no further interceptors will be called.
575         * </p>
576         * <p>
577         * Hook methods may also throw {@link AuthenticationException} to indicate that the interceptor
578         * has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401
579         * will be returned to the client.
580         */
581        SERVER_OUTGOING_GRAPHQL_RESPONSE(
582                        boolean.class,
583                        "ca.uhn.fhir.rest.api.server.RequestDetails",
584                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
585                        "java.lang.String",
586                        "java.lang.String",
587                        "jakarta.servlet.http.HttpServletRequest",
588                        "jakarta.servlet.http.HttpServletResponse"),
589
590        /**
591         * <b>Server Hook:</b>
592         * This method is called when an OperationOutcome is being returned in response to a failure.
593         * Hook methods may use this hook to modify the OperationOutcome being returned.
594         * <p>
595         * Hooks may accept the following parameters:
596         * <ul>
597         * <li>
598         * 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
599         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
600         * pulled out of the servlet request. Note that the bean
601         * properties are not all guaranteed to be populated, depending on how early during processing the
602         * exception occurred.
603         * </li>
604         * <li>
605         * 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
606         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
607         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
608         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
609         * </li>
610         * <li>
611         * org.hl7.fhir.instance.model.api.IBaseOperationOutcome - The OperationOutcome resource that will be
612         * returned.
613         * </ul>
614         * <p>
615         * Hook methods must return <code>void</code>
616         * </p>
617         */
618        SERVER_OUTGOING_FAILURE_OPERATIONOUTCOME(
619                        void.class,
620                        "ca.uhn.fhir.rest.api.server.RequestDetails",
621                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
622                        "org.hl7.fhir.instance.model.api.IBaseOperationOutcome"),
623
624        /**
625         * <b>Server Hook:</b>
626         * This method is called after all processing is completed for a request, but only if the
627         * request completes normally (i.e. no exception is thrown).
628         * <p>
629         * This pointcut is called after the response has completely finished, meaning that the HTTP response to the client
630         * may or may not have already completely been returned to the client by the time this pointcut is invoked. Use caution
631         * if you have timing-dependent logic, since there is no guarantee about whether the client will have already moved on
632         * by the time your method is invoked. If you need a guarantee that your method is invoked before returning to the
633         * client, consider using {@link #SERVER_OUTGOING_RESPONSE} instead.
634         * </p>
635         * <p>
636         * Hooks may accept the following parameters:
637         * <ul>
638         * <li>
639         * 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
640         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
641         * pulled out of the servlet request.
642         * </li>
643         * <li>
644         * 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
645         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
646         * pulled out of the request. This will be null if the server is not deployed to a RestfulServer environment.
647         * </li>
648         * </ul>
649         * </p>
650         * <p>
651         * This method must return <code>void</code>
652         * </p>
653         * <p>
654         * This method should not throw any exceptions. Any exception that is thrown by this
655         * method will be logged, but otherwise not acted upon (i.e. even if a hook method
656         * throws an exception, processing will continue and other interceptors will be
657         * called). Therefore it is considered a bug to throw an exception from hook methods using this
658         * pointcut.
659         * </p>
660         */
661        SERVER_PROCESSING_COMPLETED_NORMALLY(
662                        void.class,
663                        new ExceptionHandlingSpec().addLogAndSwallow(Throwable.class),
664                        "ca.uhn.fhir.rest.api.server.RequestDetails",
665                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
666
667        /**
668         * <b>Server Hook:</b>
669         * This method is called after all processing is completed for a request, regardless of whether
670         * the request completed successfully or not. It is called after {@link #SERVER_PROCESSING_COMPLETED_NORMALLY}
671         * in the case of successful operations.
672         * <p>
673         * Hooks may accept the following parameters:
674         * <ul>
675         * <li>
676         * 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
677         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
678         * pulled out of the servlet request.
679         * </li>
680         * <li>
681         * 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
682         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
683         * pulled out of the request. This will be null if the server is not deployed to a RestfulServer environment.
684         * </li>
685         * </ul>
686         * </p>
687         * <p>
688         * This method must return <code>void</code>
689         * </p>
690         * <p>
691         * This method should not throw any exceptions. Any exception that is thrown by this
692         * method will be logged, but otherwise not acted upon (i.e. even if a hook method
693         * throws an exception, processing will continue and other interceptors will be
694         * called). Therefore it is considered a bug to throw an exception from hook methods using this
695         * pointcut.
696         * </p>
697         */
698        SERVER_PROCESSING_COMPLETED(
699                        void.class,
700                        new ExceptionHandlingSpec().addLogAndSwallow(Throwable.class),
701                        "ca.uhn.fhir.rest.api.server.RequestDetails",
702                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
703
704        /**
705         * <b>Subscription Hook:</b>
706         * Invoked whenever a persisted resource has been modified and is being submitted to the
707         * subscription processing pipeline. This method is called before the resource is placed
708         * on any queues for processing and executes synchronously during the resource modification
709         * operation itself, so it should return quickly.
710         * <p>
711         * Hooks may accept the following parameters:
712         * <ul>
713         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks may modify this parameter. This will affect the checking process.</li>
714         * </ul>
715         * </p>
716         * <p>
717         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
718         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
719         * returns <code>false</code>, subscription processing will not proceed for the given resource;
720         * </p>
721         */
722        SUBSCRIPTION_RESOURCE_MODIFIED(boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
723
724        /**
725         * <b>Subscription Hook:</b>
726         * Invoked any time that a resource is matched by an individual subscription, and
727         * is about to be queued for delivery.
728         * <p>
729         * Hooks may make changes to the delivery payload, or make changes to the
730         * canonical subscription such as adding headers, modifying the channel
731         * endpoint, etc.
732         * </p>
733         * Hooks may accept the following parameters:
734         * <ul>
735         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
736         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
737         * <li>ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult</li>
738         * </ul>
739         * <p>
740         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
741         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
742         * returns <code>false</code>, delivery will be aborted.
743         * </p>
744         */
745        SUBSCRIPTION_RESOURCE_MATCHED(
746                        boolean.class,
747                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
748                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage",
749                        "ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult"),
750
751        /**
752         * <b>Subscription Hook:</b>
753         * Invoked whenever a persisted resource was checked against all active subscriptions, and did not
754         * match any.
755         * <p>
756         * Hooks may accept the following parameters:
757         * <ul>
758         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks should not modify this parameter as changes will not have any effect.</li>
759         * </ul>
760         * </p>
761         * <p>
762         * Hooks should return <code>void</code>.
763         * </p>
764         */
765        SUBSCRIPTION_RESOURCE_DID_NOT_MATCH_ANY_SUBSCRIPTIONS(
766                        void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
767
768        /**
769         * <b>Subscription Hook:</b>
770         * Invoked immediately before the delivery of a subscription, and right before any channel-specific
771         * hooks are invoked (e.g. {@link #SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY}.
772         * <p>
773         * Hooks may make changes to the delivery payload, or make changes to the
774         * canonical subscription such as adding headers, modifying the channel
775         * endpoint, etc.
776         * </p>
777         * Hooks may accept the following parameters:
778         * <ul>
779         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
780         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
781         * </ul>
782         * <p>
783         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
784         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
785         * returns <code>false</code>, processing will be aborted.
786         * </p>
787         */
788        SUBSCRIPTION_BEFORE_DELIVERY(
789                        boolean.class,
790                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
791                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"),
792
793        /**
794         * <b>Subscription Hook:</b>
795         * Invoked immediately after the delivery of a subscription, and right before any channel-specific
796         * hooks are invoked (e.g. {@link #SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY}.
797         * <p>
798         * Hooks may accept the following parameters:
799         * </p>
800         * <ul>
801         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
802         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
803         * </ul>
804         * <p>
805         * Hooks should return <code>void</code>.
806         * </p>
807         */
808        SUBSCRIPTION_AFTER_DELIVERY(
809                        void.class,
810                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
811                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"),
812
813        /**
814         * <b>Subscription Hook:</b>
815         * Invoked immediately after the attempted delivery of a subscription, if the delivery
816         * failed.
817         * <p>
818         * Hooks may accept the following parameters:
819         * </p>
820         * <ul>
821         * <li>java.lang.Exception - The exception that caused the failure.  Note this could be an exception thrown by a SUBSCRIPTION_BEFORE_DELIVERY or SUBSCRIPTION_AFTER_DELIVERY interceptor</li>
822         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage - the message that triggered the exception</li>
823         * <li>java.lang.Exception</li>
824         * </ul>
825         * <p>
826         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
827         * <code>void</code> or <code>true</code>, processing will continue normally, meaning that
828         * an exception will be thrown by the delivery mechanism. This typically means that the
829         * message will be returned to the processing queue. If the method
830         * returns <code>false</code>, processing will be aborted and no further action will be
831         * taken for the delivery.
832         * </p>
833         */
834        SUBSCRIPTION_AFTER_DELIVERY_FAILED(
835                        boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage", "java.lang.Exception"),
836
837        /**
838         * <b>Subscription Hook:</b>
839         * Invoked immediately after the delivery of a REST HOOK subscription.
840         * <p>
841         * When this hook is called, all processing is complete so this hook should not
842         * make any changes to the parameters.
843         * </p>
844         * Hooks may accept the following parameters:
845         * <ul>
846         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
847         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
848         * </ul>
849         * <p>
850         * Hooks should return <code>void</code>.
851         * </p>
852         */
853        SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY(
854                        void.class,
855                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
856                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"),
857
858        /**
859         * <b>Subscription Hook:</b>
860         * Invoked immediately before the delivery of a REST HOOK subscription.
861         * <p>
862         * Hooks may make changes to the delivery payload, or make changes to the
863         * canonical subscription such as adding headers, modifying the channel
864         * endpoint, etc.
865         * </p>
866         * Hooks may accept the following parameters:
867         * <ul>
868         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
869         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
870         * </ul>
871         * <p>
872         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
873         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
874         * returns <code>false</code>, processing will be aborted.
875         * </p>
876         */
877        SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY(
878                        boolean.class,
879                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
880                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"),
881
882        /**
883         * <b>Subscription Hook:</b>
884         * Invoked immediately after the delivery of MESSAGE subscription.
885         * <p>
886         * When this hook is called, all processing is complete so this hook should not
887         * make any changes to the parameters.
888         * </p>
889         * Hooks may accept the following parameters:
890         * <ul>
891         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
892         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
893         * </ul>
894         * <p>
895         * Hooks should return <code>void</code>.
896         * </p>
897         */
898        SUBSCRIPTION_AFTER_MESSAGE_DELIVERY(
899                        void.class,
900                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
901                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"),
902
903        /**
904         * <b>Subscription Hook:</b>
905         * Invoked immediately before the delivery of a MESSAGE subscription.
906         * <p>
907         * Hooks may make changes to the delivery payload, or make changes to the
908         * canonical subscription such as adding headers, modifying the channel
909         * endpoint, etc.
910         * Furthermore, you may modify the outgoing message wrapper, for example adding headers via ResourceModifiedJsonMessage field.
911         * </p>
912         * Hooks may accept the following parameters:
913         * <ul>
914         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
915         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li>
916         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage</li>
917         *
918         * </ul>
919         * <p>
920         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
921         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
922         * returns <code>false</code>, processing will be aborted.
923         * </p>
924         */
925        SUBSCRIPTION_BEFORE_MESSAGE_DELIVERY(
926                        boolean.class,
927                        "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription",
928                        "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage",
929                        "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage"),
930
931        /**
932         * <b>Subscription Hook:</b>
933         * Invoked whenever a persisted resource (a resource that has just been stored in the
934         * database via a create/update/patch/etc.) is about to be checked for whether any subscriptions
935         * were triggered as a result of the operation.
936         * <p>
937         * Hooks may accept the following parameters:
938         * <ul>
939         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks may modify this parameter. This will affect the checking process.</li>
940         * </ul>
941         * </p>
942         * <p>
943         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
944         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
945         * returns <code>false</code>, processing will be aborted.
946         * </p>
947         */
948        SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED(
949                        boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
950
951        /**
952         * <b>Subscription Hook:</b>
953         * Invoked whenever a persisted resource (a resource that has just been stored in the
954         * database via a create/update/patch/etc.) has been checked for whether any subscriptions
955         * were triggered as a result of the operation.
956         * <p>
957         * Hooks may accept the following parameters:
958         * <ul>
959         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - This parameter should not be modified as processing is complete when this hook is invoked.</li>
960         * </ul>
961         * </p>
962         * <p>
963         * Hooks should return <code>void</code>.
964         * </p>
965         */
966        SUBSCRIPTION_AFTER_PERSISTED_RESOURCE_CHECKED(
967                        void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
968
969        /**
970         * <b>Subscription Hook:</b>
971         * Invoked immediately after an active subscription is "registered". In HAPI FHIR, when
972         * a subscription
973         * <p>
974         * Hooks may make changes to the canonicalized subscription and this will have an effect
975         * on processing across this server. Note however that timing issues may occur, since the
976         * subscription is already technically live by the time this hook is called.
977         * </p>
978         * Hooks may accept the following parameters:
979         * <ul>
980         * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li>
981         * </ul>
982         * <p>
983         * Hooks should return <code>void</code>.
984         * </p>
985         */
986        SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED(
987                        void.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription"),
988
989        /**
990         * <b>Subscription Hook:</b>
991         * Invoked immediately after an active subscription is "registered". In HAPI FHIR, when
992         * a subscription
993         * <p>
994         * Hooks may make changes to the canonicalized subscription and this will have an effect
995         * on processing across this server. Note however that timing issues may occur, since the
996         * subscription is already technically live by the time this hook is called.
997         * </p>
998         * No parameters are currently supported.
999         * <p>
1000         * Hooks should return <code>void</code>.
1001         * </p>
1002         */
1003        SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_UNREGISTERED(void.class),
1004
1005        /**
1006         * <b>Storage Hook:</b>
1007         * Invoked when a resource is being deleted in a cascaded delete. This means that
1008         * some other resource is being deleted, but per use request or other
1009         * policy, the given resource (the one supplied as a parameter to this hook)
1010         * is also being deleted.
1011         * <p>
1012         * Hooks may accept the following parameters:
1013         * </p>
1014         * <ul>
1015         * <li>
1016         * 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
1017         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1018         * pulled out of the servlet request. Note that the bean
1019         * properties are not all guaranteed to be populated, depending on how early during processing the
1020         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1021         * known, such as while processing searches</b>
1022         * </li>
1023         * <li>
1024         * 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
1025         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1026         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1027         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1028         * </li>
1029         * <li>
1030         * ca.uhn.fhir.jpa.util.DeleteConflictList - Contains the details about the delete conflicts that are
1031         * being resolved via deletion. The source resource is the resource that will be deleted, and
1032         * is a cascade because the target resource is already being deleted.
1033         * </li>
1034         * <li>
1035         * org.hl7.fhir.instance.model.api.IBaseResource - The actual resource that is about to be deleted via a cascading delete
1036         * </li>
1037         * </ul>
1038         * <p>
1039         * Hooks should return <code>void</code>. They may choose to throw an exception however, in
1040         * which case the delete should be rolled back.
1041         * </p>
1042         */
1043        STORAGE_CASCADE_DELETE(
1044                        void.class,
1045                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1046                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1047                        "ca.uhn.fhir.jpa.api.model.DeleteConflictList",
1048                        "org.hl7.fhir.instance.model.api.IBaseResource"),
1049
1050        /**
1051         * <b>Subscription Topic Hook:</b>
1052         * Invoked whenever a persisted resource (a resource that has just been stored in the
1053         * database via a create/update/patch/etc.) is about to be checked for whether any subscription topics
1054         * were triggered as a result of the operation.
1055         * <p>
1056         * Hooks may accept the following parameters:
1057         * <ul>
1058         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks may modify this parameter. This will affect the checking process.</li>
1059         * </ul>
1060         * </p>
1061         * <p>
1062         * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns
1063         * <code>void</code> or <code>true</code>, processing will continue normally. If the method
1064         * returns <code>false</code>, processing will be aborted.
1065         * </p>
1066         */
1067        SUBSCRIPTION_TOPIC_BEFORE_PERSISTED_RESOURCE_CHECKED(
1068                        boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
1069
1070        /**
1071         * <b>Subscription Topic Hook:</b>
1072         * Invoked whenever a persisted resource (a resource that has just been stored in the
1073         * database via a create/update/patch/etc.) has been checked for whether any subscription topics
1074         * were triggered as a result of the operation.
1075         * <p>
1076         * Hooks may accept the following parameters:
1077         * <ul>
1078         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - This parameter should not be modified as processing is complete when this hook is invoked.</li>
1079         * </ul>
1080         * </p>
1081         * <p>
1082         * Hooks should return <code>void</code>.
1083         * </p>
1084         */
1085        SUBSCRIPTION_TOPIC_AFTER_PERSISTED_RESOURCE_CHECKED(
1086                        void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"),
1087
1088        /**
1089         * <b>Storage Hook:</b>
1090         * Invoked when we are about to <a href="https://smilecdr.com/docs/fhir_repository/creating_data.html#auto-create-placeholder-reference-targets">Auto-Create a Placeholder Reference</a>.
1091         * Hooks may modify/enhance the placeholder reference target that is about to be created, or
1092         * reject the creation of the resource, which generally means that the transaction will be
1093         * rejected instead (because of the invalid reference).
1094         * <p>
1095         * Hooks may accept the following parameters:
1096         * </p>
1097         * <ul>
1098         * <li>
1099         * ca.uhn.fhir.storage.interceptor.AutoCreatePlaceholderReferenceTargetRequest - Contains details about the placeholder that is about to be created, including the source resource whose reference is being fulfilled, as well as the candidate placeholder resource that will be created.
1100         * </li>
1101         * <li>
1102         * 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
1103         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1104         * pulled out of the servlet request.
1105         * </li>
1106         * <li>
1107         * 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
1108         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1109         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1110         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1111         * </li>
1112         * </ul>
1113         * <p>
1114         * Hooks may return <code>void</code> (in which case the placeholder creation will proceed as normal),
1115         * an object of type
1116         * <code>ca.uhn.fhir.storage.interceptor.AutoCreatePlaceholderReferenceTargetResponse</code>
1117         * (in which case the response object can approve or reject the creation),
1118         * and can throw exceptions (which will trigger an appropriate error message being returned
1119         * to the client).
1120         * </p>
1121         */
1122        STORAGE_PRE_AUTO_CREATE_PLACEHOLDER_REFERENCE(
1123                        "ca.uhn.fhir.storage.interceptor.AutoCreatePlaceholderReferenceTargetResponse",
1124                        "ca.uhn.fhir.storage.interceptor.AutoCreatePlaceholderReferenceTargetRequest",
1125                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1126                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1127
1128        /**
1129         * <b>Storage Hook:</b>
1130         * Invoked when a Bulk Export job is being kicked off, but before any permission checks
1131         * have been done.
1132         * This hook can be used to modify or update parameters as need be before
1133         * authorization/permission checks are done.
1134         * <p>
1135         * Hooks may accept the following parameters:
1136         * </p>
1137         * <ul>
1138         * <li>
1139         * ca.uhn.fhir.jpa.bulk.export.api.BulkDataExportOptions - The details of the job being kicked off
1140         * </li>
1141         * <li>
1142         * 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
1143         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1144         * pulled out of the servlet request. Note that the bean
1145         * properties are not all guaranteed to be populated, depending on how early during processing the
1146         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1147         * known, such as while processing searches</b>
1148         * </li>
1149         * <li>
1150         * 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
1151         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1152         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1153         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1154         * </li>
1155         * </ul>
1156         * <p>
1157         * Hooks should return <code>void</code>, and can throw exceptions.
1158         * </p>
1159         */
1160        STORAGE_PRE_INITIATE_BULK_EXPORT(
1161                        void.class,
1162                        "ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters",
1163                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1164                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1165
1166        /**
1167         * <b>Storage Hook:</b>
1168         * Invoked when a Bulk Export job is being kicked off. Hook methods may modify
1169         * the request, or raise an exception to prevent it from being initiated.
1170         * This hook is not guaranteed to be called before permission checks, and so
1171         * anu implementers should be cautious of changing the options in ways that would
1172         * affect permissions.
1173         * <p>
1174         * Hooks may accept the following parameters:
1175         * </p>
1176         * <ul>
1177         * <li>
1178         * ca.uhn.fhir.jpa.bulk.export.api.BulkDataExportOptions - The details of the job being kicked off
1179         * </li>
1180         * <li>
1181         * 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
1182         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1183         * pulled out of the servlet request. Note that the bean
1184         * properties are not all guaranteed to be populated, depending on how early during processing the
1185         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1186         * known, such as while processing searches</b>
1187         * </li>
1188         * <li>
1189         * 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
1190         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1191         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1192         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1193         * </li>
1194         * </ul>
1195         * <p>
1196         * Hooks should return <code>void</code>, and can throw exceptions.
1197         * </p>
1198         */
1199        STORAGE_INITIATE_BULK_EXPORT(
1200                        void.class,
1201                        "ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters",
1202                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1203                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1204
1205        /**
1206         * <b>Storage Hook:</b>
1207         * Invoked when a Bulk Export job is being processed. If any hook method is registered
1208         * for this pointcut, the hook method will be called once for each resource that is
1209         * loaded for inclusion in a bulk export file. Hook methods may modify
1210         * the resource object and this modification will affect the copy that is stored in the
1211         * bulk export data file (but will not affect the original). Hook methods may also
1212         * return <code>false</code> in order to request that the resource be filtered
1213         * from the export.
1214         * <p>
1215         * Hooks may accept the following parameters:
1216         * </p>
1217         * <ul>
1218         * <li>
1219         * ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters - The details of the job being kicked off
1220         * </li>
1221         * <li>
1222         *org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be included in the file
1223         * </li>
1224         * </ul>
1225         * <p>
1226         * Hooks methods may return <code>false</code> to indicate that the resource should be
1227         * filtered out. Otherwise, hook methods should return <code>true</code>.
1228         * </p>
1229         *
1230         * @since 6.8.0
1231         */
1232        STORAGE_BULK_EXPORT_RESOURCE_INCLUSION(
1233                        boolean.class,
1234                        "ca.uhn.fhir.rest.api.server.bulk.BulkExportJobParameters",
1235                        "org.hl7.fhir.instance.model.api.IBaseResource"),
1236
1237        /**
1238         * <b>Storage Hook:</b>
1239         * Invoked when a set of resources are about to be deleted and expunged via url like {@code http://localhost/Patient?active=false&_expunge=true}.
1240         * <p>
1241         * Hooks may accept the following parameters:
1242         * </p>
1243         * <ul>
1244         * <li>
1245         * 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
1246         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1247         * pulled out of the servlet request. Note that the bean
1248         * properties are not all guaranteed to be populated, depending on how early during processing the
1249         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1250         * known, such as while processing searches</b>
1251         * </li>
1252         * <li>
1253         * 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
1254         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1255         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1256         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1257         * </li>
1258         * <li>
1259         * java.lang.String - Contains the url used to delete and expunge the resources
1260         * </li>
1261         * </ul>
1262         * <p>
1263         * Hooks should return <code>void</code>. They may choose to throw an exception however, in
1264         * which case the delete expunge will not occur.
1265         * </p>
1266         */
1267        STORAGE_PRE_DELETE_EXPUNGE(
1268                        void.class,
1269                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1270                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1271                        "java.lang.String"),
1272
1273        /**
1274         * <b>Storage Hook:</b>
1275         * Invoked when a batch of resource pids are about to be deleted and expunged via url like {@code http://localhost/Patient?active=false&_expunge=true}.
1276         * <p>
1277         * Hooks may accept the following parameters:
1278         * </p>
1279         * <ul>
1280         * <li>
1281         * java.lang.String - the name of the resource type being deleted
1282         * </li>
1283         * <li>
1284         * java.util.List - the list of Long pids of the resources about to be deleted
1285         * </li>
1286         * <li>
1287         * java.util.concurrent.atomic.AtomicLong - holds a running tally of all entities deleted so far.
1288         * If the pointcut callback deletes any entities, then this parameter should be incremented by the total number
1289         * of additional entities deleted.
1290         * </li>
1291         * <li>
1292         * 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
1293         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1294         * pulled out of the servlet request. Note that the bean
1295         * properties are not all guaranteed to be populated, depending on how early during processing the
1296         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1297         * known, such as while processing searches</b>
1298         * </li>
1299         * <li>
1300         * 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
1301         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1302         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1303         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1304         * </li>
1305         * <li>
1306         * java.lang.String - Contains the url used to delete and expunge the resources
1307         * </li>
1308         * </ul>
1309         * <p>
1310         * Hooks should return <code>void</code>. They may choose to throw an exception however, in
1311         * which case the delete expunge will not occur.
1312         * </p>
1313         */
1314        STORAGE_PRE_DELETE_EXPUNGE_PID_LIST(
1315                        void.class,
1316                        "java.lang.String",
1317                        "java.util.List",
1318                        "java.util.concurrent.atomic.AtomicLong",
1319                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1320                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1321
1322        /**
1323         * <b>Storage Hook:</b>
1324         * Invoked when one or more resources may be returned to the user, whether as a part of a READ,
1325         * a SEARCH, or even as the response to a CREATE/UPDATE, etc.
1326         * <p>
1327         * This hook is invoked when a resource has been loaded by the storage engine and
1328         * is being returned to the HTTP stack for response. This is not a guarantee that the
1329         * client will ultimately see it, since filters/headers/etc may affect what
1330         * is returned but if a resource is loaded it is likely to be used.
1331         * Note also that caching may affect whether this pointcut is invoked.
1332         * </p>
1333         * <p>
1334         * Hooks will have access to the contents of the resource being returned
1335         * and may choose to make modifications. These changes will be reflected in
1336         * returned resource but have no effect on storage.
1337         * </p>
1338         * Hooks may accept the following parameters:
1339         * <ul>
1340         * <li>
1341         * ca.uhn.fhir.rest.api.server.IPreResourceAccessDetails - Contains details about the
1342         * specific resources being returned.
1343         * </li>
1344         * <li>
1345         * 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
1346         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1347         * pulled out of the servlet request. Note that the bean
1348         * properties are not all guaranteed to be populated, depending on how early during processing the
1349         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1350         * known, such as while processing searches</b>
1351         * </li>
1352         * <li>
1353         * 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
1354         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1355         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1356         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1357         * </li>
1358         * </ul>
1359         * <p>
1360         * Hooks should return <code>void</code>.
1361         * </p>
1362         */
1363        STORAGE_PREACCESS_RESOURCES(
1364                        void.class,
1365                        "ca.uhn.fhir.rest.api.server.IPreResourceAccessDetails",
1366                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1367                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1368
1369        /**
1370         * <b>Storage Hook:</b>
1371         * Invoked when the storage engine is about to check for the existence of a pre-cached search
1372         * whose results match the given search parameters.
1373         * <p>
1374         * Hooks may accept the following parameters:
1375         * </p>
1376         * <ul>
1377         * <li>
1378         * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked
1379         * </li>
1380         * <li>
1381         * 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
1382         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1383         * pulled out of the servlet request. Note that the bean
1384         * properties are not all guaranteed to be populated, depending on how early during processing the
1385         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1386         * known, such as while processing searches</b>
1387         * </li>
1388         * <li>
1389         * 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
1390         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1391         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1392         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1393         * </li>
1394         * </ul>
1395         * <p>
1396         * Hooks may return <code>boolean</code>. If the hook method returns
1397         * <code>false</code>, the server will not attempt to check for a cached
1398         * search no matter what.
1399         * </p>
1400         */
1401        STORAGE_PRECHECK_FOR_CACHED_SEARCH(
1402                        boolean.class,
1403                        "ca.uhn.fhir.jpa.searchparam.SearchParameterMap",
1404                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1405                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1406
1407        /**
1408         * <b>Storage Hook:</b>
1409         * Invoked when a search is starting, prior to creating a record for the search.
1410         * <p>
1411         * Hooks may accept the following parameters:
1412         * </p>
1413         * <ul>
1414         * <li>
1415         * ca.uhn.fhir.rest.server.util.ICachedSearchDetails - Contains the details of the search that
1416         * is being created and initialized. Interceptors may use this parameter to modify aspects of the search
1417         * before it is stored and executed.
1418         * </li>
1419         * <li>
1420         * 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
1421         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1422         * pulled out of the servlet request. Note that the bean
1423         * properties are not all guaranteed to be populated, depending on how early during processing the
1424         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1425         * known, such as while processing searches</b>
1426         * </li>
1427         * <li>
1428         * 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
1429         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1430         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1431         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1432         * </li>
1433         * <li>
1434         * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked. This can be modified.
1435         * </li>
1436         * <li>
1437         * ca.uhn.fhir.interceptor.model.RequestPartitionId - The partition associated with the request (or {@literal null} if the server is not partitioned)
1438         * </li>
1439         * </ul>
1440         * <p>
1441         * Hooks should return <code>void</code>.
1442         * </p>
1443         */
1444        STORAGE_PRESEARCH_REGISTERED(
1445                        void.class,
1446                        "ca.uhn.fhir.rest.server.util.ICachedSearchDetails",
1447                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1448                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1449                        "ca.uhn.fhir.jpa.searchparam.SearchParameterMap",
1450                        "ca.uhn.fhir.interceptor.model.RequestPartitionId"),
1451
1452        /**
1453         * <b>Storage Hook:</b>
1454         * Invoked when one or more resources may be returned to the user, whether as a part of a READ,
1455         * a SEARCH, or even as the response to a CREATE/UPDATE, etc.
1456         * <p>
1457         * This hook is invoked when a resource has been loaded by the storage engine and
1458         * is being returned to the HTTP stack for response.
1459         * This is not a guarantee that the
1460         * client will ultimately see it, since filters/headers/etc may affect what
1461         * is returned but if a resource is loaded it is likely to be used.
1462         * Note also that caching may affect whether this pointcut is invoked.
1463         * </p>
1464         * <p>
1465         * Hooks will have access to the contents of the resource being returned
1466         * and may choose to make modifications. These changes will be reflected in
1467         * returned resource but have no effect on storage.
1468         * </p>
1469         * Hooks may accept the following parameters:
1470         * <ul>
1471         * <li>
1472         * ca.uhn.fhir.rest.api.server.IPreResourceShowDetails - Contains the resources that
1473         * will be shown to the user. This object may be manipulated in order to modify
1474         * the actual resources being shown to the user (e.g. for masking)
1475         * </li>
1476         * <li>
1477         * 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
1478         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1479         * pulled out of the servlet request. Note that the bean
1480         * properties are not all guaranteed to be populated, depending on how early during processing the
1481         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
1482         * known, such as while processing searches</b>
1483         * </li>
1484         * <li>
1485         * 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
1486         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1487         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1488         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1489         * </li>
1490         * </ul>
1491         * <p>
1492         * Hooks should return <code>void</code>.
1493         * </p>
1494         */
1495        STORAGE_PRESHOW_RESOURCES(
1496                        void.class,
1497                        "ca.uhn.fhir.rest.api.server.IPreResourceShowDetails",
1498                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1499                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1500
1501        /**
1502         * <b>Storage Hook:</b>
1503         * Invoked before a resource will be created, immediately before the resource
1504         * is persisted to the database.
1505         * <p>
1506         * Hooks will have access to the contents of the resource being created
1507         * and may choose to make modifications to it. These changes will be
1508         * reflected in permanent storage.
1509         * </p>
1510         * Hooks may accept the following parameters:
1511         * <ul>
1512         * <li>org.hl7.fhir.instance.model.api.IBaseResource</li>
1513         * <li>
1514         * 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
1515         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1516         * pulled out of the servlet request. Note that the bean
1517         * properties are not all guaranteed to be populated, depending on how early during processing the
1518         * exception occurred.
1519         * </li>
1520         * <li>
1521         * 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
1522         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1523         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1524         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1525         * </li>
1526         * <li>
1527         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1528         * </li>
1529         * </ul>
1530         * <p>
1531         * Hooks should return <code>void</code>.
1532         * </p>
1533         */
1534        STORAGE_PRESTORAGE_RESOURCE_CREATED(
1535                        void.class,
1536                        "org.hl7.fhir.instance.model.api.IBaseResource",
1537                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1538                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1539                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails",
1540                        "ca.uhn.fhir.interceptor.model.RequestPartitionId"),
1541
1542        /**
1543         * <b>Storage Hook:</b>
1544         * Invoked before client-assigned id is created.
1545         * <p>
1546         * Hooks will have access to the contents of the resource being created
1547         * so that client-assigned ids can be allowed/denied. These changes will
1548         * be reflected in permanent storage.
1549         * </p>
1550         * Hooks may accept the following parameters:
1551         * <ul>
1552         * <li>org.hl7.fhir.instance.model.api.IBaseResource</li>
1553         * <li>
1554         * 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
1555         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1556         * pulled out of the servlet request. Note that the bean
1557         * properties are not all guaranteed to be populated, depending on how early during processing the
1558         * exception occurred.
1559         * </li>
1560         * </ul>
1561         * <p>
1562         * Hooks should return <code>void</code>.
1563         * </p>
1564         */
1565        STORAGE_PRESTORAGE_CLIENT_ASSIGNED_ID(
1566                        void.class, "org.hl7.fhir.instance.model.api.IBaseResource", "ca.uhn.fhir.rest.api.server.RequestDetails"),
1567
1568        /**
1569         * <b>Storage Hook:</b>
1570         * Invoked before a resource will be updated, immediately before the resource
1571         * is persisted to the database.
1572         * <p>
1573         * Hooks will have access to the contents of the resource being updated
1574         * (both the previous and new contents) and may choose to make modifications
1575         * to the new contents of the resource. These changes will be reflected in
1576         * permanent storage.
1577         * </p>
1578         * <p>
1579         * <b>NO-OPS:</b> If the client has submitted an update that does not actually make any changes
1580         * (i.e. the resource they include in the PUT body is identical to the content that
1581         * was already stored) the server may choose to ignore the update and perform
1582         * a "NO-OP". In this case, this pointcut is still invoked, but {@link #STORAGE_PRECOMMIT_RESOURCE_UPDATED}
1583         * will not be. Hook methods for this pointcut may make changes to the new contents of the
1584         * resource being updated, and in this case the NO-OP will be cancelled and
1585         * {@link #STORAGE_PRECOMMIT_RESOURCE_UPDATED} will also be invoked.
1586         * </p>
1587         * Hooks may accept the following parameters:
1588         * <ul>
1589         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The previous contents of the resource being updated</li>
1590         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The new contents of the resource being updated</li>
1591         * <li>
1592         * 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
1593         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1594         * pulled out of the servlet request. Note that the bean
1595         * properties are not all guaranteed to be populated, depending on how early during processing the
1596         * exception occurred.
1597         * </li>
1598         * <li>
1599         * 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
1600         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1601         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1602         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1603         * </li>
1604         * <li>
1605         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1606         * </li>
1607         * </ul>
1608         * <p>
1609         * Hooks should return <code>void</code>.
1610         * </p>
1611         */
1612        STORAGE_PRESTORAGE_RESOURCE_UPDATED(
1613                        void.class,
1614                        "org.hl7.fhir.instance.model.api.IBaseResource",
1615                        "org.hl7.fhir.instance.model.api.IBaseResource",
1616                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1617                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1618                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
1619
1620        /**
1621         * <b>Storage Hook:</b>
1622         * Invoked before a resource will be deleted, immediately before the resource
1623         * is removed from the database.
1624         * <p>
1625         * Hooks will have access to the contents of the resource being deleted
1626         * and may choose to make modifications related to it. These changes will be
1627         * reflected in permanent storage.
1628         * </p>
1629         * Hooks may accept the following parameters:
1630         * <ul>
1631         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource being deleted</li>
1632         * <li>
1633         * 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
1634         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1635         * pulled out of the servlet request. Note that the bean
1636         * properties are not all guaranteed to be populated, depending on how early during processing the
1637         * exception occurred.
1638         * </li>
1639         * <li>
1640         * 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
1641         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1642         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1643         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1644         * </li>
1645         * <li>
1646         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1647         * </li>
1648         * </ul>
1649         * <p>
1650         * Hooks should return <code>void</code>.
1651         * </p>
1652         */
1653        STORAGE_PRESTORAGE_RESOURCE_DELETED(
1654                        void.class,
1655                        "org.hl7.fhir.instance.model.api.IBaseResource",
1656                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1657                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1658                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
1659
1660        /**
1661         * <b>Storage Hook:</b>
1662         * Invoked before a resource will be created, immediately before the transaction
1663         * is committed (after all validation and other business rules have successfully
1664         * completed, and any other database activity is complete.
1665         * <p>
1666         * Hooks will have access to the contents of the resource being created
1667         * but should generally not make any
1668         * changes as storage has already occurred. Changes will not be reflected
1669         * in storage, but may be reflected in the HTTP response.
1670         * </p>
1671         * Hooks may accept the following parameters:
1672         * <ul>
1673         * <li>org.hl7.fhir.instance.model.api.IBaseResource</li>
1674         * <li>
1675         * 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
1676         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1677         * pulled out of the servlet request. Note that the bean
1678         * properties are not all guaranteed to be populated, depending on how early during processing the
1679         * exception occurred.
1680         * </li>
1681         * <li>
1682         * 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
1683         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1684         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1685         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1686         * </li>
1687         * <li>
1688         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1689         * </li>
1690         * <li>
1691         * Boolean - Whether this pointcut invocation was deferred or not(since 5.4.0)
1692         * </li>
1693         * <li>
1694         * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED.
1695         * </li>
1696         * </ul>
1697         * <p>
1698         * Hooks should return <code>void</code>.
1699         * </p>
1700         */
1701        STORAGE_PRECOMMIT_RESOURCE_CREATED(
1702                        void.class,
1703                        "org.hl7.fhir.instance.model.api.IBaseResource",
1704                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1705                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1706                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails",
1707                        "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum"),
1708
1709        /**
1710         * <b>Storage Hook:</b>
1711         * Invoked before a resource will be updated, immediately before the transaction
1712         * is committed (after all validation and other business rules have successfully
1713         * completed, and any other database activity is complete.
1714         * <p>
1715         * Hooks will have access to the contents of the resource being updated
1716         * (both the previous and new contents) but should generally not make any
1717         * changes as storage has already occurred. Changes will not be reflected
1718         * in storage, but may be reflected in the HTTP response.
1719         * </p>
1720         * <p>
1721         * NO-OP note: See {@link #STORAGE_PRESTORAGE_RESOURCE_UPDATED} for a note on
1722         * no-op updates when no changes are detected.
1723         * </p>
1724         * Hooks may accept the following parameters:
1725         * <ul>
1726         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The previous contents of the resource</li>
1727         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The proposed new contents of the resource</li>
1728         * <li>
1729         * 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
1730         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1731         * pulled out of the servlet request. Note that the bean
1732         * properties are not all guaranteed to be populated, depending on how early during processing the
1733         * exception occurred.
1734         * </li>
1735         * <li>
1736         * 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
1737         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1738         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1739         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1740         * </li>
1741         * <li>
1742         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1743         * </li>
1744         * <li>
1745         * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED.
1746         * </li>
1747         * </ul>
1748         * <p>
1749         * Hooks should return <code>void</code>.
1750         * </p>
1751         */
1752        STORAGE_PRECOMMIT_RESOURCE_UPDATED(
1753                        void.class,
1754                        "org.hl7.fhir.instance.model.api.IBaseResource",
1755                        "org.hl7.fhir.instance.model.api.IBaseResource",
1756                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1757                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1758                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails",
1759                        "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum"),
1760
1761        /**
1762         * <b>Storage Hook:</b>
1763         * Invoked before a resource will be deleted
1764         * <p>
1765         * Hooks will have access to the contents of the resource being deleted
1766         * but should not make any changes as storage has already occurred
1767         * </p>
1768         * Hooks may accept the following parameters:
1769         * <ul>
1770         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource being deleted</li>
1771         * <li>
1772         * 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
1773         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1774         * pulled out of the servlet request. Note that the bean
1775         * properties are not all guaranteed to be populated, depending on how early during processing the
1776         * exception occurred.
1777         * </li>
1778         * <li>
1779         * 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
1780         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1781         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1782         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1783         * </li>
1784         * <li>
1785         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1786         * </li>
1787         * <li>
1788         * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED.
1789         * </li>
1790         * </ul>
1791         * <p>
1792         * Hooks should return <code>void</code>.
1793         * </p>
1794         */
1795        STORAGE_PRECOMMIT_RESOURCE_DELETED(
1796                        void.class,
1797                        "org.hl7.fhir.instance.model.api.IBaseResource",
1798                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1799                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1800                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails",
1801                        "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum"),
1802
1803        /**
1804         * <b>Storage Hook:</b>
1805         * Invoked before a FHIR transaction is processed, and allows interceptor code to
1806         * split the FHIR transaction into multiple sub-transactions which will be processed
1807         * individually. These sub-transactions will be executed in the order they are
1808         * returned by the interceptor.
1809         * <p>
1810         * The sub-transactions are processed in order, and processing stops at the first failure.
1811         * If any sub-transaction fails, any previous sub-transactions will not be rolled back.
1812         * This means that splitting a transaction with this pointcut can result in
1813         * FHIR transaction processing not actually fully respecting the atomicity specified
1814         * in the FHIR specification. Use with caution!
1815         * </p>
1816         * Hooks may accept the following parameters:
1817         * <ul>
1818         * <li>org.hl7.fhir.instance.model.api.IBaseBundle - The FHIR transaction Bundle</li>
1819         * <li>
1820         * 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
1821         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1822         * pulled out of the servlet request. Note that the bean
1823         * properties are not all guaranteed to be populated, depending on how early during processing the
1824         * exception occurred.
1825         * </li>
1826         * <li>
1827         * 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
1828         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1829         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1830         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1831         * </li>
1832         * </ul>
1833         * <p>
1834         * Hooks must return an instance of <code>ca.uhn.fhir.jpa.dao.TransactionPrePartitionResponse</code>.
1835         * </p>
1836         *
1837         * @since 8.6.0
1838         */
1839        STORAGE_TRANSACTION_PRE_PARTITION(
1840                        "ca.uhn.fhir.jpa.dao.TransactionPrePartitionResponse",
1841                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1842                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1843                        "org.hl7.fhir.instance.model.api.IBaseBundle"),
1844
1845        /**
1846         * <b>Storage Hook:</b>
1847         * Invoked when a FHIR transaction bundle is about to begin processing. Hooks may choose to
1848         * modify the bundle, and may affect processing by doing so.
1849         * <p>
1850         * Hooks will have access to the original bundle, as well as all the deferred interceptor broadcasts related to the
1851         * processing of the transaction bundle
1852         * </p>
1853         * Hooks may accept the following parameters:
1854         * <ul>
1855         * <li>org.hl7.fhir.instance.model.api.IBaseBundle - The Bundle being processed</li>
1856         * <li>
1857         * 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
1858         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1859         * pulled out of the servlet request.
1860         * </li>
1861         * <li>
1862         * 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
1863         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1864         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1865         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1866         * </li>
1867         * </ul>
1868         * <p>
1869         * Hooks should return <code>void</code>.
1870         * </p>
1871         *
1872         * @see #STORAGE_TRANSACTION_PROCESSED
1873         * @since 6.2.0
1874         */
1875        STORAGE_TRANSACTION_PROCESSING(
1876                        void.class,
1877                        "org.hl7.fhir.instance.model.api.IBaseBundle",
1878                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1879                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
1880
1881        /**
1882         * <b>Storage Hook:</b>
1883         * Invoked after all entries in a transaction bundle have been executed
1884         * <p>
1885         * Hooks will have access to the original bundle, as well as all the deferred interceptor broadcasts related to the
1886         * processing of the transaction bundle
1887         * </p>
1888         * Hooks may accept the following parameters:
1889         * <ul>
1890         * <li>org.hl7.fhir.instance.model.api.IBaseBundle - The Bundle that wsa processed</li>
1891         * <li>
1892         * ca.uhn.fhir.rest.api.server.storage.DeferredInterceptorBroadcasts- A collection of pointcut invocations and their parameters which were deferred.
1893         * </li>
1894         * <li>
1895         * 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
1896         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1897         * pulled out of the servlet request.
1898         * </li>
1899         * <li>
1900         * 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
1901         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1902         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1903         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1904         * </li>
1905         * <li>
1906         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1907         * </li>
1908         * </ul>
1909         * <p>
1910         * Hooks should return <code>void</code>.
1911         * </p>
1912         *
1913         * @see #STORAGE_TRANSACTION_PROCESSING
1914         */
1915        STORAGE_TRANSACTION_PROCESSED(
1916                        void.class,
1917                        "org.hl7.fhir.instance.model.api.IBaseBundle",
1918                        "ca.uhn.fhir.rest.api.server.storage.DeferredInterceptorBroadcasts",
1919                        "ca.uhn.fhir.rest.api.server.RequestDetails",
1920                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
1921                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
1922
1923        /**
1924         * <b>Storage Hook:</b>
1925         * Invoked during a FHIR transaction, immediately before processing all write operations (i.e. immediately
1926         * before a database transaction will be opened)
1927         * <p>
1928         * Hooks may accept the following parameters:
1929         * </p>
1930         * <ul>
1931         * <li>
1932         * ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails - Contains details about the transaction that is about to start
1933         * </li>
1934         * <li>
1935         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1936         * </li>
1937         * </ul>
1938         * <p>
1939         * Hooks should return <code>void</code>.
1940         * </p>
1941         */
1942        STORAGE_TRANSACTION_WRITE_OPERATIONS_PRE(
1943                        void.class,
1944                        "ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails",
1945                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
1946
1947        /**
1948         * <b>Storage Hook:</b>
1949         * Invoked during a FHIR transaction, immediately after processing all write operations (i.e. immediately
1950         * after the transaction has been committed or rolled back). This hook will always be called if
1951         * {@link #STORAGE_TRANSACTION_WRITE_OPERATIONS_PRE} has been called, regardless of whether the operation
1952         * succeeded or failed.
1953         * <p>
1954         * Hooks may accept the following parameters:
1955         * </p>
1956         * <ul>
1957         * <li>
1958         * ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails - Contains details about the transaction that is about to start
1959         * </li>
1960         * <li>
1961         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1962         * </li>
1963         * </ul>
1964         * <p>
1965         * Hooks should return <code>void</code>.
1966         * </p>
1967         */
1968        STORAGE_TRANSACTION_WRITE_OPERATIONS_POST(
1969                        void.class,
1970                        "ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails",
1971                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
1972
1973        /**
1974         * <b>Storage Hook:</b>
1975         * Invoked when a resource delete operation is about to fail due to referential integrity checks. Intended for use with {@literal ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor}.
1976         * <p>
1977         * Hooks will have access to the list of resources that have references to the resource being deleted.
1978         * </p>
1979         * Hooks may accept the following parameters:
1980         * <ul>
1981         * <li>ca.uhn.fhir.jpa.api.model.DeleteConflictList - The list of delete conflicts</li>
1982         * <li>
1983         * 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
1984         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1985         * pulled out of the servlet request. Note that the bean
1986         * properties are not all guaranteed to be populated, depending on how early during processing the
1987         * exception occurred.
1988         * </li>
1989         * <li>
1990         * 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
1991         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
1992         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
1993         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
1994         * </li>
1995         * <li>
1996         * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0)
1997         * </li>
1998         * </ul>
1999         * <p>
2000         * Hooks should return <code>ca.uhn.fhir.jpa.delete.DeleteConflictOutcome</code>.
2001         * If the interceptor returns a non-null result, the DeleteConflictOutcome can be
2002         * used to indicate a number of times to retry.
2003         * </p>
2004         */
2005        STORAGE_PRESTORAGE_DELETE_CONFLICTS(
2006                        // Return type
2007                        "ca.uhn.fhir.jpa.delete.DeleteConflictOutcome",
2008                        // Params
2009                        "ca.uhn.fhir.jpa.api.model.DeleteConflictList",
2010                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2011                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2012                        "ca.uhn.fhir.rest.api.server.storage.TransactionDetails"),
2013
2014        /**
2015         * <b>Storage Hook:</b>
2016         * Invoked before a resource is about to be expunged via the <code>$expunge</code> operation.
2017         * <p>
2018         * Hooks will be passed a reference to a counter containing the current number of records that have been deleted.
2019         * If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted.
2020         * </p>
2021         * <p>
2022         * Hooks may accept the following parameters:
2023         * </p>
2024         * <ul>
2025         * <li>java.util.concurrent.atomic.AtomicInteger - The counter holding the number of records deleted.</li>
2026         * <li>org.hl7.fhir.instance.model.api.IIdType - The ID of the resource that is about to be deleted</li>
2027         * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource that is about to be deleted</li>
2028         * <li>
2029         * 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
2030         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2031         * pulled out of the servlet request. Note that the bean
2032         * properties are not all guaranteed to be populated, depending on how early during processing the
2033         * exception occurred.
2034         * </li>
2035         * <li>
2036         * 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
2037         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2038         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2039         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2040         * </li>
2041         * </ul>
2042         * <p>
2043         * Hooks should return void.
2044         * </p>
2045         */
2046        STORAGE_PRESTORAGE_EXPUNGE_RESOURCE(
2047                        // Return type
2048                        void.class,
2049                        // Params
2050                        "java.util.concurrent.atomic.AtomicInteger",
2051                        "org.hl7.fhir.instance.model.api.IIdType",
2052                        "org.hl7.fhir.instance.model.api.IBaseResource",
2053                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2054                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2055
2056        /**
2057         * <b>Storage Hook:</b>
2058         * Invoked before an <code>$expunge</code> operation on all data (expungeEverything) is called.
2059         * <p>
2060         * Hooks will be passed a reference to a counter containing the current number of records that have been deleted.
2061         * If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted.
2062         * </p>
2063         * Hooks may accept the following parameters:
2064         * <ul>
2065         * <li>java.util.concurrent.atomic.AtomicInteger - The counter holding the number of records deleted.</li>
2066         * <li>
2067         * 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
2068         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2069         * pulled out of the servlet request. Note that the bean
2070         * properties are not all guaranteed to be populated, depending on how early during processing the
2071         * exception occurred.
2072         * </li>
2073         * <li>
2074         * 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
2075         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2076         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2077         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2078         * </li>
2079         * </ul>
2080         * <p>
2081         * Hooks should return void.
2082         * </p>
2083         */
2084        STORAGE_PRESTORAGE_EXPUNGE_EVERYTHING(
2085                        // Return type
2086                        void.class,
2087                        // Params
2088                        "java.util.concurrent.atomic.AtomicInteger",
2089                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2090                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2091
2092        /**
2093         * <b>Storage Hook:</b>
2094         * Invoked before FHIR <b>create</b> operation to request the identification of the partition ID to be associated
2095         * with the resource being created. This hook will only be called if partitioning is enabled in the JPA
2096         * server.
2097         * <p>
2098         * Hooks may accept the following parameters:
2099         * </p>
2100         * <ul>
2101         * <li>
2102         * org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be created and needs a tenant ID assigned.
2103         * </li>
2104         * <li>
2105         * 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
2106         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2107         * pulled out of the servlet request. Note that the bean
2108         * properties are not all guaranteed to be populated, depending on how early during processing the
2109         * exception occurred.
2110         * </li>
2111         * <li>
2112         * 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
2113         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2114         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2115         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2116         * </li>
2117         * </ul>
2118         * <p>
2119         * Hooks must return an instance of <code>ca.uhn.fhir.interceptor.model.RequestPartitionId</code>.
2120         * </p>
2121         *
2122         * @see #STORAGE_PARTITION_IDENTIFY_ANY For an alternative that is not read/write specific
2123         */
2124        STORAGE_PARTITION_IDENTIFY_CREATE(
2125                        // Return type
2126                        "ca.uhn.fhir.interceptor.model.RequestPartitionId",
2127                        // Params
2128                        "org.hl7.fhir.instance.model.api.IBaseResource",
2129                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2130                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2131
2132        /**
2133         * <b>Storage Hook:</b>
2134         * Invoked before any FHIR read/access/extended operation (e.g. <b>read/vread</b>, <b>search</b>, <b>history</b>,
2135         * <b>$reindex</b>, etc.) operation to request the identification of the partition ID to be associated with
2136         * the resource(s) being searched for, read, etc. Essentially any operations in the JPA server that are not
2137         * creating a resource will use this pointcut. Creates will use {@link #STORAGE_PARTITION_IDENTIFY_CREATE}.
2138         *
2139         * <p>
2140         * This hook will only be called if
2141         * partitioning is enabled in the JPA server.
2142         * </p>
2143         * <p>
2144         * Hooks may accept the following parameters:
2145         * </p>
2146         * <ul>
2147         * <li>
2148         * 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
2149         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2150         * pulled out of the servlet request. Note that the bean
2151         * properties are not all guaranteed to be populated, depending on how early during processing the
2152         * exception occurred.
2153         * </li>
2154         * <li>
2155         * 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
2156         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2157         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2158         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2159         * </li>
2160         * <li>ca.uhn.fhir.interceptor.model.ReadPartitionIdRequestDetails - Contains details about what is being read</li>
2161         * </ul>
2162         * <p>
2163         * Hooks must return an instance of <code>ca.uhn.fhir.interceptor.model.RequestPartitionId</code>.
2164         * </p>
2165         *
2166         * @see #STORAGE_PARTITION_IDENTIFY_ANY For an alternative that is not read/write specific
2167         */
2168        STORAGE_PARTITION_IDENTIFY_READ(
2169                        // Return type
2170                        "ca.uhn.fhir.interceptor.model.RequestPartitionId",
2171                        // Params
2172                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2173                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2174                        "ca.uhn.fhir.interceptor.model.ReadPartitionIdRequestDetails"),
2175
2176        /**
2177         * <b>Storage Hook:</b>
2178         * Invoked before FHIR operations to request the identification of the partition ID to be associated with the
2179         * request being made.
2180         * <p>
2181         * This hook is an alternative to {@link #STORAGE_PARTITION_IDENTIFY_READ} and {@link #STORAGE_PARTITION_IDENTIFY_CREATE}
2182         * and can be used in cases where a partition interceptor does not need knowledge of the specific resources being
2183         * accessed/read/written in order to determine the appropriate partition.
2184         * If registered, then neither STORAGE_PARTITION_IDENTIFY_READ, nor STORAGE_PARTITION_IDENTIFY_CREATE will be called.
2185         * </p>
2186         * <p>
2187         * This hook will only be called if
2188         * partitioning is enabled in the JPA server.
2189         * </p>
2190         * <p>
2191         * Hooks may accept the following parameters:
2192         * </p>
2193         * <ul>
2194         * <li>
2195         * 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
2196         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2197         * pulled out of the servlet request. Note that the bean
2198         * properties are not all guaranteed to be populated, depending on how early during processing the
2199         * exception occurred.
2200         * </li>
2201         * <li>
2202         * 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
2203         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2204         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2205         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2206         * </li>
2207         * </ul>
2208         * <p>
2209         * Hooks must return an instance of <code>ca.uhn.fhir.interceptor.model.RequestPartitionId</code>.
2210         * </p>
2211         *
2212         * @see #STORAGE_PARTITION_IDENTIFY_READ
2213         * @see #STORAGE_PARTITION_IDENTIFY_CREATE
2214         */
2215        STORAGE_PARTITION_IDENTIFY_ANY(
2216                        // Return type
2217                        "ca.uhn.fhir.interceptor.model.RequestPartitionId",
2218                        // Params
2219                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2220                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2221
2222        /**
2223         * <b>Storage Hook:</b>
2224         * Invoked when a partition has been created, typically meaning the <code>$partition-management-create-partition</code>
2225         * operation has been invoked.
2226         * <p>
2227         * This hook will only be called if
2228         * partitioning is enabled in the JPA server.
2229         * </p>
2230         * <p>
2231         * Hooks may accept the following parameters:
2232         * </p>
2233         * <ul>
2234         * <li>
2235         * ca.uhn.fhir.interceptor.model.RequestPartitionId - The partition ID that was selected
2236         * </li>
2237         * <li>
2238         * 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
2239         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2240         * pulled out of the servlet request. Note that the bean
2241         * properties are not all guaranteed to be populated, depending on how early during processing the
2242         * exception occurred.
2243         * </li>
2244         * <li>
2245         * 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
2246         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2247         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2248         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2249         * </li>
2250         * </ul>
2251         * <p>
2252         * Hooks must return void.
2253         * </p>
2254         */
2255        STORAGE_PARTITION_CREATED(
2256                        // Return type
2257                        void.class,
2258                        // Params
2259                        "ca.uhn.fhir.interceptor.model.RequestPartitionId",
2260                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2261                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2262
2263        /**
2264         * <b>Storage Hook:</b>
2265         * Invoked when a partition has been deleted, typically meaning the <code>$partition-management-delete-partition</code>
2266         * operation has been invoked.
2267         * <p>
2268         * This hook will only be called if
2269         * partitioning is enabled in the JPA server.
2270         * </p>
2271         * <p>
2272         * Hooks may accept the following parameters:
2273         * </p>
2274         * <ul>
2275         * <li>
2276         * ca.uhn.fhir.interceptor.model.RequestPartitionId - The ID of the partition that was deleted.
2277         * </li>
2278         * </ul>
2279         * <p>
2280         * Hooks must return void.
2281         * </p>
2282         */
2283        STORAGE_PARTITION_DELETED(
2284                        // Return type
2285                        void.class,
2286                        // Params
2287                        "ca.uhn.fhir.interceptor.model.RequestPartitionId"),
2288
2289        /**
2290         * <b>Storage Hook:</b>
2291         * Invoked before any partition aware FHIR operation, when the selected partition has been identified (ie. after the
2292         * {@link #STORAGE_PARTITION_IDENTIFY_CREATE} or {@link #STORAGE_PARTITION_IDENTIFY_READ} hook was called. This allows
2293         * a separate hook to register, and potentially make decisions about whether the request should be allowed to proceed.
2294         * <p>
2295         * This hook will only be called if
2296         * partitioning is enabled in the JPA server.
2297         * </p>
2298         * <p>
2299         * Hooks may accept the following parameters:
2300         * </p>
2301         * <ul>
2302         * <li>
2303         * ca.uhn.fhir.interceptor.model.RequestPartitionId - The partition ID that was selected
2304         * </li>
2305         * <li>
2306         * 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
2307         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2308         * pulled out of the servlet request. Note that the bean
2309         * properties are not all guaranteed to be populated, depending on how early during processing the
2310         * exception occurred.
2311         * </li>
2312         * <li>
2313         * 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
2314         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2315         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2316         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2317         * </li>
2318         * <li>
2319         * ca.uhn.fhir.context.RuntimeResourceDefinition - The resource type being accessed, or {@literal null} if no specific type is associated with the request.
2320         * </li>
2321         * </ul>
2322         * <p>
2323         * Hooks must return void.
2324         * </p>
2325         */
2326        STORAGE_PARTITION_SELECTED(
2327                        // Return type
2328                        void.class,
2329                        // Params
2330                        "ca.uhn.fhir.interceptor.model.RequestPartitionId",
2331                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2332                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2333                        "ca.uhn.fhir.context.RuntimeResourceDefinition"),
2334
2335        /**
2336         * <b>Storage Hook:</b>
2337         * Invoked when a transaction has been rolled back as a result of a {@link ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException},
2338         * meaning that a database constraint has been violated. This pointcut allows an interceptor to specify a resolution strategy
2339         * other than simply returning the error to the client. This interceptor will be fired after the database transaction rollback
2340         * has been completed.
2341         * <p>
2342         * Hooks may accept the following parameters:
2343         * </p>
2344         * <ul>
2345         * <li>
2346         * 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
2347         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2348         * pulled out of the servlet request. Note that the bean
2349         * properties are not all guaranteed to be populated, depending on how early during processing the
2350         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
2351         * known, such as while processing searches</b>
2352         * </li>
2353         * <li>
2354         * 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
2355         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2356         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2357         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2358         * </li>
2359         * </ul>
2360         * <p>
2361         * Hooks should return <code>ca.uhn.fhir.jpa.api.model.ResourceVersionConflictResolutionStrategy</code>. Hooks should not
2362         * throw any exception.
2363         * </p>
2364         */
2365        STORAGE_VERSION_CONFLICT(
2366                        "ca.uhn.fhir.jpa.api.model.ResourceVersionConflictResolutionStrategy",
2367                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2368                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
2369
2370        /**
2371         * <b>Validation Hook:</b>
2372         * This hook is called after validation has completed, regardless of whether the validation was successful or failed.
2373         * Typically this is used to modify validation results.
2374         * <p>
2375         * <b>Note on validation Pointcuts:</b> The HAPI FHIR interceptor framework is a part of the client and server frameworks and
2376         * not a part of the core FhirContext. Therefore this Pointcut is invoked by the
2377         * </p>
2378         * <p>
2379         * Hooks may accept the following parameters:
2380         * <ul>
2381         * <li>
2382         * org.hl7.fhir.instance.model.api.IBaseResource - The resource being validated, if a parsed version is available (null otherwise)
2383         * </li>
2384         * <li>
2385         * java.lang.String - The resource being validated, if a raw version is available (null otherwise)
2386         * </li>
2387         * <li>
2388         * ca.uhn.fhir.validation.ValidationResult - The outcome of the validation. Hooks methods should not modify this object, but they can return a new one.
2389         * </li>
2390         * </ul>
2391         * </p>
2392         * Hook methods may return an instance of {@link ca.uhn.fhir.validation.ValidationResult} if they wish to override the validation results, or they may return <code>null</code> or <code>void</code> otherwise.
2393         */
2394        VALIDATION_COMPLETED(
2395                        ValidationResult.class,
2396                        "org.hl7.fhir.instance.model.api.IBaseResource",
2397                        "java.lang.String",
2398                        "ca.uhn.fhir.validation.ValidationResult"),
2399
2400        /**
2401         * <b>MDM(EMPI) Hook:</b>
2402         * Invoked when a persisted resource (a resource that has just been stored in the
2403         * database via a create/update/patch/etc.) enters the MDM module. The purpose of the pointcut is to permit a pseudo
2404         * modification of the resource elements to influence the MDM linking process.  Any modifications to the resource are not persisted.
2405         * <p>
2406         * Hooks may accept the following parameters:
2407         * <ul>
2408         * <li>org.hl7.fhir.instance.model.api.IBaseResource - </li>
2409         * </ul>
2410         * </p>
2411         * <p>
2412         * Hooks should return <code>void</code>.
2413         * </p>
2414         */
2415        MDM_BEFORE_PERSISTED_RESOURCE_CHECKED(void.class, "org.hl7.fhir.instance.model.api.IBaseResource"),
2416
2417        /**
2418         * <b>MDM(EMPI) Hook:</b>
2419         * Invoked whenever a persisted resource (a resource that has just been stored in the
2420         * database via a create/update/patch/etc.) has been matched against related resources and MDM links have been updated.
2421         * <p>
2422         * Hooks may accept the following parameters:
2423         * <ul>
2424         * <li>ca.uhn.fhir.rest.server.messaging.ResourceOperationMessage - This parameter should not be modified as processing is complete when this hook is invoked.</li>
2425         * <li>ca.uhn.fhir.rest.server.TransactionLogMessages - This parameter is for informational messages provided by the MDM module during MDM processing.</li>
2426         * <li>ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent - Contains information about the change event, including target and golden resource IDs and the operation type.</li>
2427         * </ul>
2428         * </p>
2429         * <p>
2430         * Hooks should return <code>void</code>.
2431         * </p>
2432         */
2433        MDM_AFTER_PERSISTED_RESOURCE_CHECKED(
2434                        void.class,
2435                        "ca.uhn.fhir.rest.server.messaging.ResourceOperationMessage",
2436                        "ca.uhn.fhir.rest.server.TransactionLogMessages",
2437                        "ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent"),
2438
2439        /**
2440         * <b>MDM Create Link</b>
2441         * This hook is invoked after an MDM link is created,
2442         * and changes have been persisted to the database.
2443         * <p>
2444         * Hook may accept the following parameters:
2445         * </p>
2446         * <ul>
2447         * <li>
2448         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed, including details such as the
2449         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2450         * pulled out of the servlet request.
2451         * </li>
2452         * <li>
2453         * ca.uhn.fhir.mdm.api.MdmLinkChangeEvent - Contains information about the link event, including target and golden resource IDs and the operation type.
2454         * </li>
2455         * </ul>
2456         * <p>
2457         * Hooks should return <code>void</code>.
2458         * </p>
2459         */
2460        MDM_POST_CREATE_LINK(
2461                        void.class, "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent"),
2462
2463        /**
2464         * <b>MDM Update Link</b>
2465         * This hook is invoked after an MDM link is updated,
2466         * and changes have been persisted to the database.
2467         * <p>
2468         * Hook may accept the following parameters:
2469         * </p>
2470         * <ul>
2471         * <li>
2472         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed, including details such as the
2473         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2474         * pulled out of the servlet request.
2475         * </li>
2476         * <li>
2477         * ca.uhn.fhir.mdm.api.MdmLinkChangeEvent - Contains information about the link event, including target and golden resource IDs and the operation type.
2478         * </li>
2479         * </ul>
2480         * <p>
2481         * Hooks should return <code>void</code>.
2482         * </p>
2483         */
2484        MDM_POST_UPDATE_LINK(
2485                        void.class, "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent"),
2486
2487        /**
2488         * <b>MDM Merge Golden Resources</b>
2489         * This hook is invoked after 2 golden resources have been
2490         * merged together and results persisted.
2491         * <p>
2492         * Hook may accept the following parameters:
2493         * </p>
2494         * <ul>
2495         * <li>
2496         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed, including details such as the
2497         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2498         * pulled out of the servlet request.
2499         * </li>
2500         * <li>
2501         * ca.uhn.fhir.mdm.model.mdmevents.MdmMergeEvent - Contains information about the from and to resources.
2502         * </li>
2503         * <li>
2504         * ca.uhn.fhir.mdm.model.mdmevents.MdmTransactionContext - Contains information about the Transaction context, e.g. merge or link.
2505         * </li>
2506         * </ul>
2507         * <p>
2508         * Hooks should return <code>void</code>.
2509         * </p>
2510         */
2511        MDM_POST_MERGE_GOLDEN_RESOURCES(
2512                        void.class,
2513                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2514                        "ca.uhn.fhir.mdm.model.mdmevents.MdmMergeEvent",
2515                        "ca.uhn.fhir.mdm.model.MdmTransactionContext"),
2516
2517        /**
2518         * <b>MDM Link History Hook:</b>
2519         * This hook is invoked after link histories are queried,
2520         * but before the results are returned to the caller.
2521         * <p>
2522         * Hook may accept the following parameters:
2523         * </p>
2524         * <ul>
2525         * <li>
2526         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed.
2527         * </li>
2528         * <li>
2529         * ca.uhn.fhir.mdm.model.mdmevents.MdmHistoryEvent - An MDM History Event containing
2530         * information about the requested golden resource ids and/or source ids input, and
2531         * the returned link histories.
2532         * </li>
2533         * </ul>
2534         */
2535        MDM_POST_LINK_HISTORY(
2536                        void.class,
2537                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2538                        "ca.uhn.fhir.mdm.model.mdmevents.MdmHistoryEvent"),
2539
2540        /**
2541         * <b>MDM Not Duplicate/Unduplicate Hook:</b>
2542         * This hook is invoked after 2 golden resources with an existing link
2543         * of "POSSIBLE_DUPLICATE" get unlinked/unduplicated.
2544         * <p>
2545         * This hook accepts the following parameters:
2546         * </p>
2547         * <ul>
2548         * <li>
2549         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed.
2550         * </li>
2551         * <li>
2552         * ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent - the resulting final link
2553         * between the 2 golden resources; now a NO_MATCH link.
2554         * </li>
2555         * </ul>
2556         */
2557        MDM_POST_NOT_DUPLICATE(
2558                        void.class, "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.mdm.model.mdmevents.MdmLinkEvent"),
2559
2560        /**
2561         * <b>MDM Clear Hook:</b>
2562         * This hook is invoked when an mdm clear operation is requested.
2563         * <p>
2564         * This hook accepts the following parameters:
2565         * </p>
2566         * <ul>
2567         * <li>
2568         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed.
2569         * </li>
2570         * <li>
2571         * ca.uhn.fhir.mdm.model.mdmevents.MdmClearEvent - the event containing information on the clear command,
2572         * including the type filter (if any) and the batch size (if any).
2573         * </li>
2574         * </ul>
2575         */
2576        MDM_CLEAR(
2577                        void.class, "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.mdm.model.mdmevents.MdmClearEvent"),
2578
2579        /**
2580         * <b>MDM Submit Hook:</b>
2581         * This hook is invoked whenever when mdm submit operation is requested.
2582         * MDM submits can be invoked in multiple ways.
2583         * Some of which accept asynchronous calling, and some of which do not.
2584         * <p>
2585         * If the MDM Submit operation is asynchronous
2586         * (typically because the Prefer: respond-async header has been provided)
2587         * this hook will be invoked after the job is submitted, but before it has
2588         * necessarily been executed.
2589         * </p>
2590         * <p>
2591         * If the MDM Submit operation is synchronous,
2592         * this hook will be invoked immediately after the submit operation
2593         * has been executed, but before the call is returned to the caller.
2594         * </p>
2595         * <ul>
2596         * <li>
2597         * On Patient Type. Can be synchronous or asynchronous.
2598         * </li>
2599         * <li>
2600         * On Practitioner Type. Can be synchronous or asynchronous.
2601         * </li>
2602         * <li>
2603         * On specific patient instances. Is always synchronous.
2604         * </li>
2605         * <li>
2606         * On specific practitioner instances. Is always synchronous.
2607         * </li>
2608         * <li>
2609         * On the server (ie, not on any resource) with or without a resource filter.
2610         * Can be synchronous or asynchronous.
2611         * </li>
2612         * </ul>
2613         * <p>
2614         * In all cases, this hook will take the following parameters:
2615         * </p>
2616         * <ul>
2617         * <li>
2618         * ca.uhn.fhir.rest.api.server.RequestDetails - An object containing details about the request that is about to be processed.
2619         * </li>
2620         * <li>
2621         * ca.uhn.fhir.mdm.model.mdmevents.MdmSubmitEvent - An event with the Mdm Submit information
2622         * (urls specifying paths that will be searched for MDM submit, as well as
2623         * if this was an asynchronous request or not).
2624         * </li>
2625         * </ul>
2626         */
2627        MDM_SUBMIT(
2628                        void.class, "ca.uhn.fhir.rest.api.server.RequestDetails", "ca.uhn.fhir.mdm.model.mdmevents.MdmSubmitEvent"),
2629
2630        /**
2631         * <b>MDM_SUBMIT_PRE_MESSAGE_DELIVERY Hook:</b>
2632         * Invoked immediately before the delivery of a MESSAGE to the broker.
2633         * <p>
2634         * Hooks can make changes to the delivery payload.
2635         * Furthermore, modification can be made to the outgoing message,
2636         * for example adding headers or changing message key,
2637         * which will be used for the subsequent processing.
2638         * </p>
2639         * Hooks should accept the following parameters:
2640         * <ul>
2641         * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage</li>
2642         * </ul>
2643         */
2644        MDM_SUBMIT_PRE_MESSAGE_DELIVERY(void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage"),
2645
2646        /**
2647         * <b>JPA Hook:</b>
2648         * This hook is invoked during resource indexing and can be used to influence the
2649         * text extracted from a given resource for FullText indexing in support of the
2650         * <code>_content</code> Search Parameter.
2651         * By default, when FullText indexing is enabled HAPI FHIR extracts all string
2652         * content from resources for indexing in order to support the <code>_content</code>
2653         * Search Parameter. This means looking for all <code>string</code> datatypes
2654         * found within a given resource instance, and combining the strings.
2655         * <p>
2656         * Hooks may choose to replace the automatically extracted index text.
2657         * They may also declare that a given resource should not be indexed.
2658         * </p>
2659         * <p>
2660         * Note on selectively disabling indexing: If you return
2661         * <code>FullTextExtractionResponse.doNotIndex()</code> for both invocations of this
2662         * Pointcut for a given resource, this will flag to the indexing
2663         * service that no data should be written to the index for the resource. This is useful
2664         * if you want to selectively enable FullText indexing only for specific resource types,
2665         * or by some other property. Be careful of resource deletes in this scenario! If you
2666         * allow indexing for a given resource, but then invoke <code>doNotIndex()</code>
2667         * when the resource is being deleted then the existing FullText index record will
2668         * be left in place. This can lead to inefficient use of space, and potentially cause
2669         * slow/inefficient searches.
2670         * </p>
2671         * Hooks should accept the following parameters:
2672         * <ul>
2673         * <li>ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionRequest</li>
2674         * </ul>
2675         * <p>
2676         * Hooks may return either <code>null</code> (to indicate that the default indexing should
2677         * be used) or an instance of <code>ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionResponse</code>
2678         * if you wish to override the default indexing behaviour.
2679         * </p>
2680         *
2681         * @since 8.4.0
2682         * @see #JPA_INDEX_EXTRACT_FULLTEXT_TEXT
2683         */
2684        JPA_INDEX_EXTRACT_FULLTEXT_CONTENT(
2685                        "ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionResponse",
2686                        "ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionRequest"),
2687
2688        /**
2689         * <b>JPA Hook:</b>
2690         * This hook is invoked during resource indexing and can be used to influence the
2691         * text extracted from a given resource for FullText indexing in support of the
2692         * <code>_text</code> Search Parameter.
2693         * HAPI FHIR extracts all text in the narrative
2694         * (<code>Resource.text.div</code>) for indexing in order to support the <code>_text</code>
2695         * Search Parameter.
2696         * <p>
2697         * Hooks may choose to replace the automatically extracted index text.
2698         * They may also declare that a given resource should not be indexed.
2699         * </p>
2700         * <p>
2701         * Note on selectively disabling indexing: If you return
2702         * <code>FullTextExtractionResponse.doNotIndex()</code> for both invocations of this
2703         * Pointcut for a given resource, this will flag to the indexing
2704         * service that no data should be written to the index for the resource. This is useful
2705         * if you want to selectively enable FullText indexing only for specific resource types,
2706         * or by some other property. Be careful of resource deletes in this scenario! If you
2707         * allow indexing for a given resource, but then invoke <code>doNotIndex()</code>
2708         * when the resource is being deleted then the existing FullText index record will
2709         * be left in place. This can lead to inefficient use of space, and potentially cause
2710         * slow/inefficient searches.
2711         * </p>
2712         * Hooks should accept the following parameters:
2713         * <ul>
2714         * <li>ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionRequest</li>
2715         * </ul>
2716         * <p>
2717         * Hooks may return either <code>null</code> (to indicate that the default indexing should
2718         * be used) or an instance of <code>ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionResponse</code>
2719         * if you wish to override the default indexing behaviour.
2720         * </p>
2721         *
2722         * @since 8.4.0
2723         * @see #JPA_INDEX_EXTRACT_FULLTEXT_CONTENT
2724         */
2725        JPA_INDEX_EXTRACT_FULLTEXT_TEXT(
2726                        "ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionResponse",
2727                        "ca.uhn.fhir.jpa.searchparam.fulltext.FullTextExtractionRequest"),
2728
2729        /**
2730         * <b>JPA Hook:</b>
2731         * This hook is invoked when a cross-partition reference is about to be
2732         * stored in the database.
2733         * <p>
2734         * <b>This is an experimental API - It may change in the future, use with caution.</b>
2735         * </p>
2736         * <p>
2737         * Hooks may accept the following parameters:
2738         * </p>
2739         * <ul>
2740         * <li>
2741         * {@literal ca.uhn.fhir.jpa.searchparam.extractor.CrossPartitionReferenceDetails} - Contains details about the
2742         * cross partition reference.
2743         * </li>
2744         * </ul>
2745         * <p>
2746         * Hooks should return <code>void</code>.
2747         * </p>
2748         */
2749        JPA_RESOLVE_CROSS_PARTITION_REFERENCE(
2750                        "ca.uhn.fhir.jpa.model.cross.IResourceLookup",
2751                        "ca.uhn.fhir.jpa.searchparam.extractor.CrossPartitionReferenceDetails"),
2752
2753        /**
2754         * <b>Performance Tracing Hook:</b>
2755         * This hook is invoked when any informational messages generated by the
2756         * SearchCoordinator are created. It is typically used to provide logging
2757         * or capture details related to a specific request.
2758         * <p>
2759         * Note that this is a performance tracing hook. Use with caution in production
2760         * systems, since calling it may (or may not) carry a cost.
2761         * </p>
2762         * Hooks may accept the following parameters:
2763         * <ul>
2764         * <li>
2765         * 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
2766         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2767         * pulled out of the servlet request. Note that the bean
2768         * properties are not all guaranteed to be populated, depending on how early during processing the
2769         * exception occurred.
2770         * </li>
2771         * <li>
2772         * 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
2773         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2774         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2775         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2776         * </li>
2777         * <li>
2778         * ca.uhn.fhir.jpa.model.search.StorageProcessingMessage - Contains the message
2779         * </li>
2780         * </ul>
2781         * <p>
2782         * Hooks should return <code>void</code>.
2783         * </p>
2784         */
2785        JPA_PERFTRACE_INFO(
2786                        void.class,
2787                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2788                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2789                        "ca.uhn.fhir.jpa.model.search.StorageProcessingMessage"),
2790
2791        /**
2792         * <b>Performance Tracing Hook:</b>
2793         * This hook is invoked when any warning messages generated by the
2794         * SearchCoordinator are created. It is typically used to provide logging
2795         * or capture details related to a specific request.
2796         * <p>
2797         * Note that this is a performance tracing hook. Use with caution in production
2798         * systems, since calling it may (or may not) carry a cost.
2799         * </p>
2800         * Hooks may accept the following parameters:
2801         * <ul>
2802         * <li>
2803         * 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
2804         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2805         * pulled out of the servlet request. Note that the bean
2806         * properties are not all guaranteed to be populated, depending on how early during processing the
2807         * exception occurred.
2808         * </li>
2809         * <li>
2810         * 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
2811         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2812         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2813         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2814         * </li>
2815         * <li>
2816         * ca.uhn.fhir.jpa.model.search.StorageProcessingMessage - Contains the message
2817         * </li>
2818         * </ul>
2819         * <p>
2820         * Hooks should return <code>void</code>.
2821         * </p>
2822         */
2823        JPA_PERFTRACE_WARNING(
2824                        void.class,
2825                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2826                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2827                        "ca.uhn.fhir.jpa.model.search.StorageProcessingMessage"),
2828
2829        /**
2830         * <b>Performance Tracing Hook:</b>
2831         * This hook is invoked when a search has returned the very first result
2832         * from the database. The timing on this call can be a good indicator of how
2833         * performant a query is in general.
2834         * <p>
2835         * Note that this is a performance tracing hook. Use with caution in production
2836         * systems, since calling it may (or may not) carry a cost.
2837         * </p>
2838         * Hooks may accept the following parameters:
2839         * <ul>
2840         * <li>
2841         * 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
2842         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2843         * pulled out of the servlet request. Note that the bean
2844         * properties are not all guaranteed to be populated, depending on how early during processing the
2845         * exception occurred.
2846         * </li>
2847         * <li>
2848         * 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
2849         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2850         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2851         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2852         * </li>
2853         * <li>
2854         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
2855         * performed. Hooks should not modify this object.
2856         * </li>
2857         * </ul>
2858         * <p>
2859         * Hooks should return <code>void</code>.
2860         * </p>
2861         */
2862        JPA_PERFTRACE_SEARCH_FIRST_RESULT_LOADED(
2863                        void.class,
2864                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2865                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2866                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
2867
2868        /**
2869         * <b>Performance Tracing Hook:</b>
2870         * This hook is invoked when an individual search query SQL SELECT statement
2871         * has completed and no more results are available from that query. Note that this
2872         * doesn't necessarily mean that no more matching results exist in the database,
2873         * since HAPI FHIR JPA batch loads results in to the query cache in chunks in order
2874         * to provide predicable results without overloading memory or the database.
2875         * <p>
2876         * Note that this is a performance tracing hook. Use with caution in production
2877         * systems, since calling it may (or may not) carry a cost.
2878         * </p>
2879         * Hooks may accept the following parameters:
2880         * <ul>
2881         * <li>
2882         * 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
2883         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2884         * pulled out of the servlet request. Note that the bean
2885         * properties are not all guaranteed to be populated, depending on how early during processing the
2886         * exception occurred.
2887         * </li>
2888         * <li>
2889         * 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
2890         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2891         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2892         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2893         * </li>
2894         * <li>
2895         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
2896         * performed. Hooks should not modify this object.
2897         * </li>
2898         * </ul>
2899         * <p>
2900         * Hooks should return <code>void</code>.
2901         * </p>
2902         */
2903        JPA_PERFTRACE_SEARCH_SELECT_COMPLETE(
2904                        void.class,
2905                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2906                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2907                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
2908
2909        /**
2910         * <b>Performance Tracing Hook:</b>
2911         * This hook is invoked when a search has failed for any reason. When this pointcut
2912         * is invoked, the search has completed unsuccessfully and will not be continued.
2913         * <p>
2914         * Note that this is a performance tracing hook. Use with caution in production
2915         * systems, since calling it may (or may not) carry a cost.
2916         * </p>
2917         * Hooks may accept the following parameters:
2918         * <ul>
2919         * <li>
2920         * 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
2921         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2922         * pulled out of the servlet request. Note that the bean
2923         * properties are not all guaranteed to be populated, depending on how early during processing the
2924         * exception occurred.
2925         * </li>
2926         * <li>
2927         * 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
2928         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2929         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2930         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2931         * </li>
2932         * <li>
2933         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
2934         * performed. Hooks should not modify this object.
2935         * </li>
2936         * </ul>
2937         * <p>
2938         * Hooks should return <code>void</code>.
2939         * </p>
2940         */
2941        JPA_PERFTRACE_SEARCH_FAILED(
2942                        void.class,
2943                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2944                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2945                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
2946
2947        /**
2948         * <b>Performance Tracing Hook:</b>
2949         * This hook is invoked when a search has completed. When this pointcut
2950         * is invoked, a pass in the Search Coordinator has completed successfully, but
2951         * not all possible resources have been loaded yet so a future paging request
2952         * may trigger a new task that will load further resources.
2953         * <p>
2954         * Note that this is a performance tracing hook. Use with caution in production
2955         * systems, since calling it may (or may not) carry a cost.
2956         * </p>
2957         * Hooks may accept the following parameters:
2958         * <ul>
2959         * <li>
2960         * 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
2961         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2962         * pulled out of the servlet request. Note that the bean
2963         * properties are not all guaranteed to be populated, depending on how early during processing the
2964         * exception occurred.
2965         * </li>
2966         * <li>
2967         * 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
2968         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
2969         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
2970         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
2971         * </li>
2972         * <li>
2973         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
2974         * performed. Hooks should not modify this object.
2975         * </li>
2976         * </ul>
2977         * <p>
2978         * Hooks should return <code>void</code>.
2979         * </p>
2980         */
2981        JPA_PERFTRACE_SEARCH_PASS_COMPLETE(
2982                        void.class,
2983                        "ca.uhn.fhir.rest.api.server.RequestDetails",
2984                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
2985                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
2986
2987        /**
2988         * <b>Performance Tracing Hook:</b>
2989         * This hook is invoked when a query involving an external index (e.g. Elasticsearch) has completed. When this pointcut
2990         * is invoked, an initial list of resource IDs has been generated which will be used as part of a subsequent database query.
2991         * <p>
2992         * Note that this is a performance tracing hook. Use with caution in production
2993         * systems, since calling it may (or may not) carry a cost.
2994         * </p>
2995         * Hooks may accept the following parameters:
2996         * <ul>
2997         * <li>
2998         * 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
2999         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3000         * pulled out of the servlet request. Note that the bean
3001         * properties are not all guaranteed to be populated, depending on how early during processing the
3002         * exception occurred.
3003         * </li>
3004         * <li>
3005         * 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
3006         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3007         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
3008         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
3009         * </li>
3010         * <li>
3011         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
3012         * performed. Hooks should not modify this object.
3013         * </li>
3014         * </ul>
3015         * <p>
3016         * Hooks should return <code>void</code>.
3017         * </p>
3018         */
3019        JPA_PERFTRACE_INDEXSEARCH_QUERY_COMPLETE(
3020                        void.class,
3021                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3022                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
3023                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
3024
3025        /**
3026         * <b>Performance Tracing Hook:</b>
3027         * Invoked when the storage engine is about to reuse the results of
3028         * a previously cached search.
3029         * <p>
3030         * Note that this is a performance tracing hook. Use with caution in production
3031         * systems, since calling it may (or may not) carry a cost.
3032         * </p>
3033         * <p>
3034         * Hooks may accept the following parameters:
3035         * </p>
3036         * <ul>
3037         * <li>
3038         * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked
3039         * </li>
3040         * <li>
3041         * 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
3042         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3043         * pulled out of the servlet request. Note that the bean
3044         * properties are not all guaranteed to be populated, depending on how early during processing the
3045         * exception occurred. <b>Note that this parameter may be null in contexts where the request is not
3046         * known, such as while processing searches</b>
3047         * </li>
3048         * <li>
3049         * 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
3050         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3051         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
3052         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
3053         * </li>
3054         * </ul>
3055         * <p>
3056         * Hooks should return <code>void</code>.
3057         * </p>
3058         */
3059        JPA_PERFTRACE_SEARCH_REUSING_CACHED(
3060                        boolean.class,
3061                        "ca.uhn.fhir.jpa.searchparam.SearchParameterMap",
3062                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3063                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails"),
3064
3065        /**
3066         * <b>Performance Tracing Hook:</b>
3067         * This hook is invoked when a search has failed for any reason. When this pointcut
3068         * is invoked, a pass in the Search Coordinator has completed successfully, and all
3069         * possible results have been fetched and loaded into the query cache.
3070         * <p>
3071         * Note that this is a performance tracing hook. Use with caution in production
3072         * systems, since calling it may (or may not) carry a cost.
3073         * </p>
3074         * Hooks may accept the following parameters:
3075         * <ul>
3076         * <li>
3077         * 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
3078         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3079         * pulled out of the servlet request. Note that the bean
3080         * properties are not all guaranteed to be populated, depending on how early during processing the
3081         * exception occurred.
3082         * </li>
3083         * <li>
3084         * 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
3085         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3086         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
3087         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
3088         * </li>
3089         * <li>
3090         * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being
3091         * performed. Hooks should not modify this object.
3092         * </li>
3093         * </ul>
3094         * <p>
3095         * Hooks should return <code>void</code>.
3096         * </p>
3097         */
3098        JPA_PERFTRACE_SEARCH_COMPLETE(
3099                        void.class,
3100                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3101                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
3102                        "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails"),
3103
3104        /**
3105         * <b>Performance Tracing Hook:</b>
3106         * <p>
3107         * This hook is invoked when a search has found an individual ID.
3108         * </p>
3109         * <p>
3110         * THIS IS AN EXPERIMENTAL HOOK AND MAY BE REMOVED OR CHANGED WITHOUT WARNING.
3111         * </p>
3112         * <p>
3113         * Note that this is a performance tracing hook. Use with caution in production
3114         * systems, since calling it may (or may not) carry a cost.
3115         * </p>
3116         * <p>
3117         * Hooks may accept the following parameters:
3118         * </p>
3119         * <ul>
3120         * <li>
3121         * java.lang.Integer - The query ID
3122         * </li>
3123         * <li>
3124         * java.lang.Object - The ID
3125         * </li>
3126         * </ul>
3127         * <p>
3128         * Hooks should return <code>void</code>.
3129         * </p>
3130         */
3131        JPA_PERFTRACE_SEARCH_FOUND_ID(void.class, "java.lang.Integer", "java.lang.Object"),
3132
3133        /**
3134         * <b>Performance Tracing Hook:</b>
3135         * This hook is invoked when a query has executed, and includes the raw SQL
3136         * statements that were executed against the database.
3137         * <p>
3138         * Note that this is a performance tracing hook. Use with caution in production
3139         * systems, since calling it may (or may not) carry a cost.
3140         * </p>
3141         * <p>
3142         * Hooks may accept the following parameters:
3143         * </p>
3144         * <ul>
3145         * <li>
3146         * 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
3147         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3148         * pulled out of the servlet request. Note that the bean
3149         * properties are not all guaranteed to be populated, depending on how early during processing the
3150         * exception occurred.
3151         * </li>
3152         * <li>
3153         * 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
3154         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3155         * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will
3156         * only be populated when operating in a RestfulServer implementation. It is provided as a convenience.
3157         * </li>
3158         * <li>
3159         * ca.uhn.fhir.jpa.util.SqlQueryList - Contains details about the raw SQL queries.
3160         * </li>
3161         * </ul>
3162         * <p>
3163         * Hooks should return <code>void</code>.
3164         * </p>
3165         */
3166        JPA_PERFTRACE_RAW_SQL(
3167                        void.class,
3168                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3169                        "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails",
3170                        "ca.uhn.fhir.jpa.util.SqlQueryList"),
3171
3172        /**
3173         * <b> Deprecated but still supported.  Will eventually be removed.  <code>Please use Pointcut.STORAGE_BINARY_ASSIGN_BINARY_CONTENT_ID_PREFIX</code>  </b>
3174         * <b> Binary Blob Prefix Assigning Hook:</b>
3175         * <p>
3176         * Immediately before a binary blob is stored to its eventual data sink, this hook is called.
3177         * This hook allows implementers to provide a prefix to the binary blob's ID.
3178         * This is helpful in cases where you want to identify this blob for later retrieval outside of HAPI-FHIR. Note that allowable characters will depend on the specific storage sink being used.
3179         * <ul>
3180         * <li>
3181         * 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
3182         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3183         * pulled out of the servlet request. Note that the bean
3184         * properties are not all guaranteed to be populated.
3185         * </li>
3186         * <li>
3187         * org.hl7.fhir.instance.model.api.IBaseBinary - The binary resource that is about to be stored.
3188         * </li>
3189         * </ul>
3190         * <p>
3191         * Hooks should return <code>String</code>, which represents the full prefix to be applied to the blob.
3192         * </p>
3193         */
3194        @Deprecated(since = "7.2.0 - Use STORAGE_BINARY_ASSIGN_BINARY_CONTENT_ID_PREFIX instead.")
3195        STORAGE_BINARY_ASSIGN_BLOB_ID_PREFIX(
3196                        String.class,
3197                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3198                        "org.hl7.fhir.instance.model.api.IBaseResource"),
3199
3200        /**
3201         * <b> Binary Content Prefix Assigning Hook:</b>
3202         * <p>
3203         * Immediately before binary content is stored to its eventual data sink, this hook is called.
3204         * This hook allows implementers to provide a prefix to the binary content's ID.
3205         * This is helpful in cases where you want to identify this blob for later retrieval outside of HAPI-FHIR. Note that allowable characters will depend on the specific storage sink being used.
3206         * <ul>
3207         * <li>
3208         * 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
3209         * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been
3210         * pulled out of the servlet request. Note that the bean
3211         * properties are not all guaranteed to be populated.
3212         * </li>
3213         * <li>
3214         * org.hl7.fhir.instance.model.api.IBaseBinary - The binary resource that is about to be stored.
3215         * </li>
3216         * </ul>
3217         * <p>
3218         * Hooks should return <code>String</code>, which represents the full prefix to be applied to the blob.
3219         * </p>
3220         */
3221        STORAGE_BINARY_ASSIGN_BINARY_CONTENT_ID_PREFIX(
3222                        String.class,
3223                        "ca.uhn.fhir.rest.api.server.RequestDetails",
3224                        "org.hl7.fhir.instance.model.api.IBaseResource"),
3225
3226        /**
3227         * <b>Storage Hook:</b>
3228         * Invoked before a batch job is persisted to the database.
3229         * <p>
3230         * Hooks will have access to the content of the job being created
3231         * and may choose to make modifications to it. These changes will be
3232         * reflected in permanent storage.
3233         * </p>
3234         * Hooks may accept the following parameters:
3235         * <ul>
3236         * <li>
3237         * ca.uhn.fhir.batch2.model.JobInstance
3238         * </li>
3239         * <li>
3240         * ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that lead to the creation
3241         * of the jobInstance.
3242         * </li>
3243         * </ul>
3244         * <p>
3245         * Hooks should return <code>void</code>.
3246         * </p>
3247         */
3248        STORAGE_PRESTORAGE_BATCH_JOB_CREATE(
3249                        void.class, "ca.uhn.fhir.batch2.model.JobInstance", "ca.uhn.fhir.rest.api.server.RequestDetails"),
3250
3251        /**
3252         * <b>CDS Hooks Prefetch Hook:</b>
3253         * Invoked before a CDS Hooks prefetch request is made.
3254         * Hooks may accept the following parameters:
3255         * <ul>
3256         *     <li> "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson" - The prefetch query, template and resolution strategy used for the request.
3257         *              This parameter also contains a user data map <code>(String, Object)</code>, that allows data to be store between pointcut
3258         *              invocations of a prefetch request/response.</li>
3259         *     <li> "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson" - The CDS Hooks request that the prefetch is being made for</li>
3260         *  </ul>
3261         *
3262         * <p>
3263         * Hooks should return <code>void</code>.
3264         * </p>
3265         */
3266        CDS_HOOK_PREFETCH_REQUEST(
3267                        void.class,
3268                        "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson",
3269                        "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson"),
3270
3271        /**
3272         * <b>CDS Hooks Prefetch Hook:</b>
3273         * Invoked after CDS Hooks prefetch request is completed successfully.
3274         * Hooks may accept the following parameters:
3275         * <ul>
3276         *     <li> "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson" - The prefetch query and template and resolution strategy used for the request.
3277         *              This parameter also contains a user data map <code>(String, Object)</code>, that allows data to be store between pointcut
3278         *              invocations of a prefetch request/response.</li>
3279         *     <li> "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson" - The CDS Hooks request that the prefetch is being made for</li>
3280         *     <li> "org.hl7.fhir.instance.model.api.IBaseResource" - The resource that is returned by the prefetch
3281         *     request</li>
3282         *  </ul>
3283         *
3284         * <p>
3285         * Hooks should return <code>void</code>.
3286         * </p>
3287         */
3288        CDS_HOOK_PREFETCH_RESPONSE(
3289                        void.class,
3290                        "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson",
3291                        "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson",
3292                        "org.hl7.fhir.instance.model.api.IBaseResource"),
3293
3294        /**
3295         * <b>CDS Hooks Prefetch Hook:</b>
3296         * Invoked after a failed CDS Hooks prefetch request.
3297         * Hooks may accept the following parameters:
3298         * <ul>
3299         *     <li> "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson" - The prefetch query and template and resolution strategy used for the request.
3300         *                      This parameter also contains a user data map <code>(String, Object)</code>, that allows data to be store between pointcut
3301         *                      invocations of a prefetch request/response.</li>
3302         *     <li> "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson" - The CDS Hooks request that the prefetch is being made for</li>
3303         *     <li> "java.lang.Exception" - The exception that caused the failure of the prefetch request</li>
3304         *  </ul>
3305         *
3306         * <p>
3307         * Hooks should return <code>void</code>.
3308         * </p>
3309         */
3310        CDS_HOOK_PREFETCH_FAILED(
3311                        void.class,
3312                        "ca.uhn.hapi.fhir.cdshooks.api.json.prefetch.CdsHookPrefetchPointcutContextJson",
3313                        "ca.uhn.fhir.rest.api.server.cdshooks.CdsServiceRequestJson",
3314                        "java.lang.Exception"),
3315
3316        /**
3317         * <b>Batch2 Hook:</b>
3318         * <p>This is a filter hook that can be used around workchunk processing.
3319         * It is expected that implementers return an <code>IInterceptorFilterHook</code> that invokes the supplier
3320         * and includes the logic that should be executed:</p>
3321         * <ol>
3322         *     <li>Before a workchunk has been processed</li>
3323         *     <li>If an error occurs during processing</li>
3324         *     <li>After the workchunk has been processed</li>
3325         * </ol>
3326         * <p>Parameters:</p>
3327         * <ul>
3328         *     <li>ca.uhn.fhir.batch2.model.JobInstance - The job instance</li>
3329         *     <li>ca.uhn.fhir.batch2.model.WorkChunk - The work chunk</li>
3330         *  </ul>
3331         * <p>Hooks should return an {@link ca.uhn.fhir.interceptor.api.IBaseInterceptorBroadcaster.IInterceptorFilterHook}</p>
3332         * <p>For more details see <a href="http://hapifhir.io/hapi-fhir/docs/interceptors/filter_hook_interceptors.html">Filter Hook Interceptors</a></p>
3333         */
3334        BATCH2_CHUNK_PROCESS_FILTER(
3335                        IInterceptorFilterHook.class, "ca.uhn.fhir.batch2.model.JobInstance", "ca.uhn.fhir.batch2.model.WorkChunk"),
3336
3337        /**
3338         * <b>Provenance Agents Pointcut:</b>
3339         * This is a pointcut to retrieve data for populating the agent element of a Provenance resource that needs to be created
3340         * as a result of a request, such as a $merge or a $hapi.fhir.replace-references operation.
3341         * <p> Hooks should accept the following parameter:</p>
3342         * <ul>
3343         *     <li>ca.uhn.fhir.jpa.model.ProvenanceAgentPointcutParameters - an object containing the parameters for the hook, including:</li>
3344         *     <ul>
3345         *         <li>ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is being processed.</li>
3346         *         <li>List of ca.uhn.fhir.model.api.IProvenanceAgent - This is an output parameter; the hook should add the agent information to this list</li>
3347         *     </ul>
3348         * </ul>
3349         * Hooks should return <code>void</code> and use the parameter object to add the agent information.
3350         */
3351        PROVENANCE_AGENTS(void.class, "ca.uhn.fhir.jpa.model.IProvenanceAgentsPointcutParameter"),
3352
3353        /**
3354         * This pointcut is used only for unit tests. Do not use in production code as it may be changed or
3355         * removed at any time.
3356         */
3357        TEST_RB(
3358                        boolean.class,
3359                        new ExceptionHandlingSpec().addLogAndSwallow(IllegalStateException.class),
3360                        String.class.getName(),
3361                        String.class.getName()),
3362
3363        /**
3364         * This pointcut is used only for unit tests. Do not use in production code as it may be changed or
3365         * removed at any time.
3366         */
3367        TEST_FILTER(IInterceptorFilterHook.class, String.class.getName()),
3368
3369        /**
3370         * This pointcut is used only for unit tests. Do not use in production code as it may be changed or
3371         * removed at any time.
3372         */
3373        TEST_RO(BaseServerResponseException.class, String.class.getName(), String.class.getName());
3374
3375        private final List<String> myParameterTypes;
3376        private final Class<?> myReturnType;
3377        private final ExceptionHandlingSpec myExceptionHandlingSpec;
3378
3379        Pointcut(@Nonnull String theReturnType, String... theParameterTypes) {
3380                this(toReturnTypeClass(theReturnType), new ExceptionHandlingSpec(), theParameterTypes);
3381        }
3382
3383        Pointcut(
3384                        @Nonnull Class<?> theReturnType,
3385                        @Nonnull ExceptionHandlingSpec theExceptionHandlingSpec,
3386                        String... theParameterTypes) {
3387
3388                // This enum uses the lowercase-b boolean type to indicate boolean return pointcuts
3389                Validate.isTrue(!theReturnType.equals(Boolean.class), "Return type Boolean not allowed here, must be boolean");
3390
3391                myReturnType = theReturnType;
3392                myExceptionHandlingSpec = theExceptionHandlingSpec;
3393                myParameterTypes = Collections.unmodifiableList(Arrays.asList(theParameterTypes));
3394        }
3395
3396        Pointcut(@Nonnull Class<?> theReturnType, String... theParameterTypes) {
3397                this(theReturnType, new ExceptionHandlingSpec(), theParameterTypes);
3398        }
3399
3400        @Override
3401        public boolean isShouldLogAndSwallowException(@Nonnull Throwable theException) {
3402                for (Class<? extends Throwable> next : myExceptionHandlingSpec.myTypesToLogAndSwallow) {
3403                        if (next.isAssignableFrom(theException.getClass())) {
3404                                return true;
3405                        }
3406                }
3407                return false;
3408        }
3409
3410        @Override
3411        @Nonnull
3412        public Class<?> getReturnType() {
3413                return myReturnType;
3414        }
3415
3416        @Override
3417        public Class<?> getBooleanReturnTypeForEnum() {
3418                return boolean.class;
3419        }
3420
3421        @Override
3422        @Nonnull
3423        public List<String> getParameterTypes() {
3424                return myParameterTypes;
3425        }
3426
3427        private static class UnknownType {}
3428
3429        private static class ExceptionHandlingSpec {
3430
3431                private final Set<Class<? extends Throwable>> myTypesToLogAndSwallow = new HashSet<>();
3432
3433                ExceptionHandlingSpec addLogAndSwallow(@Nonnull Class<? extends Throwable> theType) {
3434                        myTypesToLogAndSwallow.add(theType);
3435                        return this;
3436                }
3437        }
3438
3439        private static Class<?> toReturnTypeClass(String theReturnType) {
3440                try {
3441                        return Class.forName(theReturnType);
3442                } catch (ClassNotFoundException theE) {
3443                        return UnknownType.class;
3444                }
3445        }
3446}