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