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