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