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