001package ca.uhn.fhir.interceptor.api; 002 003/*- 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2022 Smile CDR, Inc. 008 * %% 009 * Licensed under the Apache License, Version 2.0 (the "License"); 010 * you may not use this file except in compliance with the License. 011 * You may obtain a copy of the License at 012 * 013 * http://www.apache.org/licenses/LICENSE-2.0 014 * 015 * Unless required by applicable law or agreed to in writing, software 016 * distributed under the License is distributed on an "AS IS" BASIS, 017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 018 * See the License for the specific language governing permissions and 019 * limitations under the License. 020 * #L% 021 */ 022 023import ca.uhn.fhir.model.base.resource.BaseOperationOutcome; 024import ca.uhn.fhir.rest.annotation.Read; 025import ca.uhn.fhir.rest.annotation.Search; 026import ca.uhn.fhir.rest.server.exceptions.AuthenticationException; 027import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException; 028import ca.uhn.fhir.validation.ValidationResult; 029import org.hl7.fhir.instance.model.api.IBaseConformance; 030 031import javax.annotation.Nonnull; 032import java.io.Writer; 033import java.util.Arrays; 034import java.util.Collections; 035import java.util.HashSet; 036import java.util.List; 037import java.util.Set; 038 039/** 040 * Value for {@link Hook#value()} 041 * <p> 042 * Hook pointcuts are divided into several broad categories: 043 * <ul> 044 * <li>INTERCEPTOR_xxx: Hooks on the interceptor infrastructure itself</li> 045 * <li>CLIENT_xxx: Hooks on the HAPI FHIR Client framework</li> 046 * <li>SERVER_xxx: Hooks on the HAPI FHIR Server framework</li> 047 * <li>SUBSCRIPTION_xxx: Hooks on the HAPI FHIR Subscription framework</li> 048 * <li>STORAGE_xxx: Hooks on the storage engine</li> 049 * <li>VALIDATION_xxx: Hooks on the HAPI FHIR Validation framework</li> 050 * <li>JPA_PERFTRACE_xxx: Performance tracing hooks on the JPA server</li> 051 * </ul> 052 * </p> 053 */ 054public enum Pointcut implements IPointcut { 055 056 /** 057 * <b>Interceptor Framework Hook:</b> 058 * This pointcut will be called once when a given interceptor is registered 059 */ 060 INTERCEPTOR_REGISTERED(void.class), 061 062 /** 063 * <b>Client Hook:</b> 064 * This hook is called before an HTTP client request is sent 065 * <p> 066 * Hooks may accept the following parameters: 067 * <ul> 068 * <li> 069 * ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request 070 * </li> 071 * <li> 072 * ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request 073 * </li> 074 * </ul> 075 * </p> 076 * Hook methods must return <code>void</code>. 077 */ 078 CLIENT_REQUEST(void.class, 079 "ca.uhn.fhir.rest.client.api.IHttpRequest", 080 "ca.uhn.fhir.rest.client.api.IRestfulClient" 081 ), 082 083 /** 084 * <b>Client Hook:</b> 085 * This hook is called after an HTTP client request has completed, prior to returning 086 * the results to the calling code. Hook methods may modify the response. 087 * <p> 088 * Hooks may accept the following parameters: 089 * <ul> 090 * <li> 091 * ca.uhn.fhir.rest.client.api.IHttpRequest - The details of the request 092 * </li> 093 * <li> 094 * ca.uhn.fhir.rest.client.api.IHttpResponse - The details of the response 095 * </li> 096 * <li> 097 * ca.uhn.fhir.rest.client.api.IRestfulClient - The client object making the request 098 * </li> 099 * </ul> 100 * </p> 101 * Hook methods must return <code>void</code>. 102 */ 103 CLIENT_RESPONSE(void.class, 104 "ca.uhn.fhir.rest.client.api.IHttpRequest", 105 "ca.uhn.fhir.rest.client.api.IHttpResponse", 106 "ca.uhn.fhir.rest.client.api.IRestfulClient" 107 ), 108 109 /** 110 * <b>Server Hook:</b> 111 * This hook is called when a server CapabilityStatement is generated for returning to a client. 112 * <p> 113 * This pointcut will not necessarily be invoked for every client request to the `/metadata` endpoint. 114 * If caching of the generated CapabilityStatement is enabled, a new CapabilityStatement will be 115 * generated periodically and this pointcut will be invoked at that time. 116 * </p> 117 * <p> 118 * Hooks may accept the following parameters: 119 * <ul> 120 * <li> 121 * org.hl7.fhir.instance.model.api.IBaseConformance - The <code>CapabilityStatement</code> resource that will 122 * be returned to the client by the server. Interceptors may make changes to this resource. The parameter 123 * must be of type <code>IBaseConformance</code>, so it is the responsibility of the interceptor hook method 124 * code to cast to the appropriate version. 125 * </li> 126 * <li> 127 * ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to 128 * be processed 129 * </li> 130 * <li> 131 * ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that 132 * is about to be processed. This parameter is identical to the RequestDetails parameter above but will only 133 * be populated when operating in a RestfulServer implementation. It is provided as a convenience. 134 * </li> 135 * </ul> 136 * </p> 137 * Hook methods may an instance of a new <code>CapabilityStatement</code> resource which will replace the 138 * one that was supplied to the interceptor, or <code>void</code> to use the original one. If the interceptor 139 * chooses to modify the <code>CapabilityStatement</code> that was supplied to the interceptor, it is fine 140 * for your hook method to return <code>void</code> or <code>null</code>. 141 */ 142 SERVER_CAPABILITY_STATEMENT_GENERATED(IBaseConformance.class, 143 "org.hl7.fhir.instance.model.api.IBaseConformance", 144 "ca.uhn.fhir.rest.api.server.RequestDetails", 145 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 146 ), 147 148 /** 149 * <b>Server Hook:</b> 150 * This hook is called before any other processing takes place for each incoming request. It may be used to provide 151 * alternate handling for some requests, or to screen requests before they are handled, etc. 152 * <p> 153 * Note that any exceptions thrown by this method will not be trapped by HAPI (they will be passed up to the server) 154 * </p> 155 * <p> 156 * Hooks may accept the following parameters: 157 * <ul> 158 * <li> 159 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 160 * </li> 161 * <li> 162 * javax.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment 163 * </li> 164 * </ul> 165 * </p> 166 * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally. 167 * This is generally the right thing to do. If your interceptor is providing a response rather than 168 * letting HAPI handle the response normally, you must return <code>false</code>. In this case, 169 * no further processing will occur and no further interceptors will be called. 170 */ 171 SERVER_INCOMING_REQUEST_PRE_PROCESSED(boolean.class, 172 "javax.servlet.http.HttpServletRequest", 173 "javax.servlet.http.HttpServletResponse" 174 ), 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 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 202 * </li> 203 * <li> 204 * javax.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(boolean.class, 220 "ca.uhn.fhir.rest.api.server.RequestDetails", 221 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 222 "javax.servlet.http.HttpServletRequest", 223 "javax.servlet.http.HttpServletResponse", 224 "ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException" 225 ), 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 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 248 * </li> 249 * <li> 250 * javax.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(boolean.class, 268 "ca.uhn.fhir.rest.api.server.RequestDetails", 269 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 270 "javax.servlet.http.HttpServletRequest", 271 "javax.servlet.http.HttpServletResponse" 272 ), 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 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 295 * </li> 296 * <li> 297 * javax.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(boolean.class, 313 "ca.uhn.fhir.rest.api.server.RequestDetails", 314 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 315 "javax.servlet.http.HttpServletRequest", 316 "javax.servlet.http.HttpServletResponse" 317 ), 318 319 320 /** 321 * <b>Server Hook:</b> 322 * This hook is invoked before an incoming request is processed. Note that this method is called 323 * after the server has begun preparing the response to the incoming client request. 324 * As such, it is not able to supply a response to the incoming request in the way that 325 * SERVER_INCOMING_REQUEST_PRE_PROCESSED and 326 * {@link #SERVER_INCOMING_REQUEST_POST_PROCESSED} 327 * are. 328 * <p> 329 * Hooks may accept the following parameters: 330 * <ul> 331 * <li> 332 * 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 333 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 334 * pulled out of the servlet request. Note that the bean 335 * properties are not all guaranteed to be populated, depending on how early during processing the 336 * exception occurred. 337 * </li> 338 * <li> 339 * 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 340 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 341 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 342 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 343 * </li> 344 * <li> 345 * ca.uhn.fhir.rest.api.RestOperationTypeEnum - The type of operation that the FHIR server has determined that the client is trying to invoke 346 * </li> 347 * <li> 348 * ca.uhn.fhir.rest.server.interceptor.IServerInterceptor.ActionRequestDetails - This parameter is provided for legacy reasons only and will be removed in the future. Do not use. 349 * </li> 350 * </ul> 351 * </p> 352 * <p> 353 * Hook methods must return <code>void</code> 354 * </p> 355 * <p> 356 * Hook methods method may throw a subclass of {@link BaseServerResponseException}, and processing 357 * will be aborted with an appropriate error returned to the client. 358 * </p> 359 */ 360 SERVER_INCOMING_REQUEST_PRE_HANDLED(void.class, 361 "ca.uhn.fhir.rest.api.server.RequestDetails", 362 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 363 "ca.uhn.fhir.rest.api.RestOperationTypeEnum", 364 "ca.uhn.fhir.rest.server.interceptor.IServerInterceptor$ActionRequestDetails" 365 ), 366 367 /** 368 * <b>Server Hook:</b> 369 * This method is called upon any exception being thrown within the server's request processing code. This includes 370 * any exceptions thrown within resource provider methods (e.g. {@link Search} and {@link Read} methods) as well as 371 * any runtime exceptions thrown by the server itself. This hook method is invoked for each interceptor (until one of them 372 * returns a non-<code>null</code> response or the end of the list is reached), after which 373 * {@link #SERVER_HANDLE_EXCEPTION} is 374 * called for each interceptor. 375 * <p> 376 * This may be used to add an OperationOutcome to a response, or to convert between exception types for any reason. 377 * </p> 378 * <p> 379 * Implementations of this method may choose to ignore/log/count/etc exceptions, and return <code>null</code>. In 380 * this case, processing will continue, and the server will automatically generate an {@link BaseOperationOutcome 381 * OperationOutcome}. Implementations may also choose to provide their own response to the client. In this case, they 382 * should return a non-<code>null</code>, to indicate that they have handled the request and processing should stop. 383 * </p> 384 * <p> 385 * Hooks may accept the following parameters: 386 * <ul> 387 * <li> 388 * 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 389 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 390 * pulled out of the servlet request. Note that the bean 391 * properties are not all guaranteed to be populated, depending on how early during processing the 392 * exception occurred. 393 * </li> 394 * <li> 395 * 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 396 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 397 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 398 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 399 * </li> 400 * <li> 401 * java.lang.Throwable - The exception that was thrown. This will often be an instance of 402 * {@link BaseServerResponseException} but will not necessarily be one (e.g. it could be a 403 * {@link NullPointerException} in the case of a bug being triggered. 404 * </li> 405 * <li> 406 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 407 * </li> 408 * <li> 409 * javax.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment 410 * </li> 411 * </ul> 412 * <p> 413 * Hook methods may return a new exception to use for processing, or <code>null</code> if this interceptor is not trying to 414 * modify the exception. For example, if this interceptor has nothing to do with exception processing, it 415 * should always return <code>null</code>. If this interceptor adds an OperationOutcome to the exception, it 416 * should return an exception. 417 * </p> 418 */ 419 SERVER_PRE_PROCESS_OUTGOING_EXCEPTION(BaseServerResponseException.class, 420 "ca.uhn.fhir.rest.api.server.RequestDetails", 421 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 422 "java.lang.Throwable", 423 "javax.servlet.http.HttpServletRequest", 424 "javax.servlet.http.HttpServletResponse" 425 ), 426 427 /** 428 * <b>Server Hook:</b> 429 * This method is called after the server implementation method has been called, but before any attempt 430 * to stream the response back to the client. Interceptors may examine or modify the response before it 431 * is returned, or even prevent the response. 432 * <p> 433 * Hooks may accept the following parameters: 434 * <ul> 435 * <li> 436 * 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 437 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 438 * pulled out of the servlet request. 439 * </li> 440 * <li> 441 * 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 442 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 443 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 444 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 445 * </li> 446 * <li> 447 * org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be returned. This parameter may be <code>null</code> for some responses. 448 * </li> 449 * <li> 450 * 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. 451 * </li> 452 * <li> 453 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 454 * </li> 455 * <li> 456 * javax.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment 457 * </li> 458 * </ul> 459 * </p> 460 * <p> 461 * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally. 462 * This is generally the right thing to do. If your interceptor is providing a response rather than 463 * letting HAPI handle the response normally, you must return <code>false</code>. In this case, 464 * no further processing will occur and no further interceptors will be called. 465 * </p> 466 * <p> 467 * Hook methods may also throw {@link AuthenticationException} to indicate that the interceptor 468 * has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 469 * will be returned to the client. 470 */ 471 SERVER_OUTGOING_RESPONSE(boolean.class, 472 "ca.uhn.fhir.rest.api.server.RequestDetails", 473 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 474 "org.hl7.fhir.instance.model.api.IBaseResource", 475 "ca.uhn.fhir.rest.api.server.ResponseDetails", 476 "javax.servlet.http.HttpServletRequest", 477 "javax.servlet.http.HttpServletResponse" 478 ), 479 480 481 /** 482 * <b>Server Hook:</b> 483 * This method is called when a stream writer is generated that will be used to stream a non-binary response to 484 * a client. Hooks may return a wrapped writer which adds additional functionality as needed. 485 * 486 * <p> 487 * Hooks may accept the following parameters: 488 * <ul> 489 * <li> 490 * java.io.Writer - The response writing Writer. Typically a hook will wrap this writer and layer additional functionality 491 * into the wrapping writer. 492 * </li> 493 * <li> 494 * 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 495 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 496 * pulled out of the servlet request. 497 * </li> 498 * <li> 499 * 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 500 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 501 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 502 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 503 * </li> 504 * </ul> 505 * </p> 506 * <p> 507 * Hook methods should return a {@link Writer} instance that will be used to stream the response. Hook methods 508 * should not throw any exception. 509 * </p> 510 * 511 * @since 5.0.0 512 */ 513 SERVER_OUTGOING_WRITER_CREATED(Writer.class, 514 "java.io.Writer", 515 "ca.uhn.fhir.rest.api.server.RequestDetails", 516 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 517 ), 518 519 520 /** 521 * <b>Server Hook:</b> 522 * This method is called after the server implementation method has been called, but before any attempt 523 * to stream the response back to the client, specifically for GraphQL requests (as these do not fit 524 * cleanly into the model provided by {@link #SERVER_OUTGOING_RESPONSE}). 525 * <p> 526 * Hooks may accept the following parameters: 527 * <ul> 528 * <li> 529 * 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 530 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 531 * pulled out of the servlet request. 532 * </li> 533 * <li> 534 * 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 535 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 536 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 537 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 538 * </li> 539 * <li> 540 * java.lang.String - The GraphQL query 541 * </li> 542 * <li> 543 * java.lang.String - The GraphQL response 544 * </li> 545 * <li> 546 * javax.servlet.http.HttpServletRequest - The servlet request, when running in a servlet environment 547 * </li> 548 * <li> 549 * javax.servlet.http.HttpServletResponse - The servlet response, when running in a servlet environment 550 * </li> 551 * </ul> 552 * </p> 553 * <p> 554 * Hook methods may return <code>true</code> or <code>void</code> if processing should continue normally. 555 * This is generally the right thing to do. If your interceptor is providing a response rather than 556 * letting HAPI handle the response normally, you must return <code>false</code>. In this case, 557 * no further processing will occur and no further interceptors will be called. 558 * </p> 559 * <p> 560 * Hook methods may also throw {@link AuthenticationException} to indicate that the interceptor 561 * has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401 562 * will be returned to the client. 563 */ 564 SERVER_OUTGOING_GRAPHQL_RESPONSE(boolean.class, 565 "ca.uhn.fhir.rest.api.server.RequestDetails", 566 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 567 "java.lang.String", 568 "java.lang.String", 569 "javax.servlet.http.HttpServletRequest", 570 "javax.servlet.http.HttpServletResponse" 571 ), 572 573 574 /** 575 * <b>Server Hook:</b> 576 * This method is called when an OperationOutcome is being returned in response to a failure. 577 * Hook methods may use this hook to modify the OperationOutcome being returned. 578 * <p> 579 * Hooks may accept the following parameters: 580 * <ul> 581 * <li> 582 * 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 583 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 584 * pulled out of the servlet request. Note that the bean 585 * properties are not all guaranteed to be populated, depending on how early during processing the 586 * exception occurred. 587 * </li> 588 * <li> 589 * 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 590 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 591 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 592 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 593 * </li> 594 * <li> 595 * org.hl7.fhir.instance.model.api.IBaseOperationOutcome - The OperationOutcome resource that will be 596 * returned. 597 * </ul> 598 * <p> 599 * Hook methods must return <code>void</code> 600 * </p> 601 */ 602 SERVER_OUTGOING_FAILURE_OPERATIONOUTCOME( 603 void.class, 604 "ca.uhn.fhir.rest.api.server.RequestDetails", 605 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 606 "org.hl7.fhir.instance.model.api.IBaseOperationOutcome" 607 ), 608 609 610 /** 611 * <b>Server Hook:</b> 612 * This method is called after all processing is completed for a request, but only if the 613 * request completes normally (i.e. no exception is thrown). 614 * <p> 615 * Hooks may accept the following parameters: 616 * <ul> 617 * <li> 618 * 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 619 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 620 * pulled out of the servlet request. 621 * </li> 622 * <li> 623 * 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 624 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 625 * pulled out of the request. This will be null if the server is not deployed to a RestfulServer environment. 626 * </li> 627 * </ul> 628 * </p> 629 * <p> 630 * This method must return <code>void</code> 631 * </p> 632 * <p> 633 * This method should not throw any exceptions. Any exception that is thrown by this 634 * method will be logged, but otherwise not acted upon (i.e. even if a hook method 635 * throws an exception, processing will continue and other interceptors will be 636 * called). Therefore it is considered a bug to throw an exception from hook methods using this 637 * pointcut. 638 * </p> 639 */ 640 SERVER_PROCESSING_COMPLETED_NORMALLY( 641 void.class, 642 new ExceptionHandlingSpec() 643 .addLogAndSwallow(Throwable.class), 644 "ca.uhn.fhir.rest.api.server.RequestDetails", 645 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 646 ), 647 648 /** 649 * <b>Server Hook:</b> 650 * This method is called after all processing is completed for a request, regardless of whether 651 * the request completed successfully or not. It is called after {@link #SERVER_PROCESSING_COMPLETED_NORMALLY} 652 * in the case of successful operations. 653 * <p> 654 * Hooks may accept the following parameters: 655 * <ul> 656 * <li> 657 * 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 658 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 659 * pulled out of the servlet request. 660 * </li> 661 * <li> 662 * 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 663 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 664 * pulled out of the request. This will be null if the server is not deployed to a RestfulServer environment. 665 * </li> 666 * </ul> 667 * </p> 668 * <p> 669 * This method must return <code>void</code> 670 * </p> 671 * <p> 672 * This method should not throw any exceptions. Any exception that is thrown by this 673 * method will be logged, but otherwise not acted upon (i.e. even if a hook method 674 * throws an exception, processing will continue and other interceptors will be 675 * called). Therefore it is considered a bug to throw an exception from hook methods using this 676 * pointcut. 677 * </p> 678 */ 679 SERVER_PROCESSING_COMPLETED( 680 void.class, 681 new ExceptionHandlingSpec() 682 .addLogAndSwallow(Throwable.class), 683 "ca.uhn.fhir.rest.api.server.RequestDetails", 684 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 685 ), 686 687 /** 688 * <b>Subscription Hook:</b> 689 * Invoked whenever a persisted resource has been modified and is being submitted to the 690 * subscription processing pipeline. This method is called before the resource is placed 691 * on any queues for processing and executes synchronously during the resource modification 692 * operation itself, so it should return quickly. 693 * <p> 694 * Hooks may accept the following parameters: 695 * <ul> 696 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks may modify this parameter. This will affect the checking process.</li> 697 * </ul> 698 * </p> 699 * <p> 700 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 701 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 702 * returns <code>false</code>, subscription processing will not proceed for the given resource; 703 * </p> 704 */ 705 SUBSCRIPTION_RESOURCE_MODIFIED(boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"), 706 707 708 /** 709 * <b>Subscription Hook:</b> 710 * Invoked any time that a resource is matched by an individual subscription, and 711 * is about to be queued for delivery. 712 * <p> 713 * Hooks may make changes to the delivery payload, or make changes to the 714 * canonical subscription such as adding headers, modifying the channel 715 * endpoint, etc. 716 * </p> 717 * Hooks may accept the following parameters: 718 * <ul> 719 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 720 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 721 * <li>ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult</li> 722 * </ul> 723 * <p> 724 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 725 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 726 * returns <code>false</code>, delivery will be aborted. 727 * </p> 728 */ 729 SUBSCRIPTION_RESOURCE_MATCHED(boolean.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage", "ca.uhn.fhir.jpa.searchparam.matcher.InMemoryMatchResult"), 730 731 /** 732 * <b>Subscription Hook:</b> 733 * Invoked whenever a persisted resource was checked against all active subscriptions, and did not 734 * match any. 735 * <p> 736 * Hooks may accept the following parameters: 737 * <ul> 738 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks should not modify this parameter as changes will not have any effect.</li> 739 * </ul> 740 * </p> 741 * <p> 742 * Hooks should return <code>void</code>. 743 * </p> 744 */ 745 SUBSCRIPTION_RESOURCE_DID_NOT_MATCH_ANY_SUBSCRIPTIONS(void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"), 746 747 /** 748 * <b>Subscription Hook:</b> 749 * Invoked immediately before the delivery of a subscription, and right before any channel-specific 750 * hooks are invoked (e.g. {@link #SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY}. 751 * <p> 752 * Hooks may make changes to the delivery payload, or make changes to the 753 * canonical subscription such as adding headers, modifying the channel 754 * endpoint, etc. 755 * </p> 756 * Hooks may accept the following parameters: 757 * <ul> 758 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 759 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 760 * </ul> 761 * <p> 762 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 763 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 764 * returns <code>false</code>, processing will be aborted. 765 * </p> 766 */ 767 SUBSCRIPTION_BEFORE_DELIVERY(boolean.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"), 768 769 /** 770 * <b>Subscription Hook:</b> 771 * Invoked immediately after the delivery of a subscription, and right before any channel-specific 772 * hooks are invoked (e.g. {@link #SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY}. 773 * <p> 774 * Hooks may accept the following parameters: 775 * </p> 776 * <ul> 777 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 778 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 779 * </ul> 780 * <p> 781 * Hooks should return <code>void</code>. 782 * </p> 783 */ 784 SUBSCRIPTION_AFTER_DELIVERY(void.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"), 785 786 787 /** 788 * <b>Subscription Hook:</b> 789 * Invoked immediately after the attempted delivery of a subscription, if the delivery 790 * failed. 791 * <p> 792 * Hooks may accept the following parameters: 793 * </p> 794 * <ul> 795 * <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> 796 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage - the message that triggered the exception</li> 797 * <li>java.lang.Exception</li> 798 * </ul> 799 * <p> 800 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 801 * <code>void</code> or <code>true</code>, processing will continue normally, meaning that 802 * an exception will be thrown by the delivery mechanism. This typically means that the 803 * message will be returned to the processing queue. If the method 804 * returns <code>false</code>, processing will be aborted and no further action will be 805 * taken for the delivery. 806 * </p> 807 */ 808 SUBSCRIPTION_AFTER_DELIVERY_FAILED(boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage", "java.lang.Exception"), 809 810 /** 811 * <b>Subscription Hook:</b> 812 * Invoked immediately after the delivery of a REST HOOK subscription. 813 * <p> 814 * When this hook is called, all processing is complete so this hook should not 815 * make any changes to the parameters. 816 * </p> 817 * Hooks may accept the following parameters: 818 * <ul> 819 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 820 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 821 * </ul> 822 * <p> 823 * Hooks should return <code>void</code>. 824 * </p> 825 */ 826 SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY(void.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"), 827 828 /** 829 * <b>Subscription Hook:</b> 830 * Invoked immediately before the delivery of a REST HOOK subscription. 831 * <p> 832 * Hooks may make changes to the delivery payload, or make changes to the 833 * canonical subscription such as adding headers, modifying the channel 834 * endpoint, etc. 835 * </p> 836 * Hooks may accept the following parameters: 837 * <ul> 838 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 839 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 840 * </ul> 841 * <p> 842 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 843 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 844 * returns <code>false</code>, processing will be aborted. 845 * </p> 846 */ 847 SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY(boolean.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"), 848 849 /** 850 * <b>Subscription Hook:</b> 851 * Invoked immediately after the delivery of MESSAGE subscription. 852 * <p> 853 * When this hook is called, all processing is complete so this hook should not 854 * make any changes to the parameters. 855 * </p> 856 * Hooks may accept the following parameters: 857 * <ul> 858 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 859 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 860 * </ul> 861 * <p> 862 * Hooks should return <code>void</code>. 863 * </p> 864 */ 865 SUBSCRIPTION_AFTER_MESSAGE_DELIVERY(void.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage"), 866 867 /** 868 * <b>Subscription Hook:</b> 869 * Invoked immediately before the delivery of a MESSAGE subscription. 870 * <p> 871 * Hooks may make changes to the delivery payload, or make changes to the 872 * canonical subscription such as adding headers, modifying the channel 873 * endpoint, etc. 874 * Furthermore, you may modify the outgoing message wrapper, for example adding headers via ResourceModifiedJsonMessage field. 875 * 876 * </p> 877 * Hooks may accept the following parameters: 878 * <ul> 879 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 880 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage</li> 881 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage</li> 882 * 883 * </ul> 884 * <p> 885 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 886 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 887 * returns <code>false</code>, processing will be aborted. 888 * </p> 889 */ 890 SUBSCRIPTION_BEFORE_MESSAGE_DELIVERY(boolean.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription", "ca.uhn.fhir.jpa.subscription.model.ResourceDeliveryMessage", "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedJsonMessage"), 891 892 893 /** 894 * <b>Subscription Hook:</b> 895 * Invoked whenever a persisted resource (a resource that has just been stored in the 896 * database via a create/update/patch/etc.) is about to be checked for whether any subscriptions 897 * were triggered as a result of the operation. 898 * <p> 899 * Hooks may accept the following parameters: 900 * <ul> 901 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - Hooks may modify this parameter. This will affect the checking process.</li> 902 * </ul> 903 * </p> 904 * <p> 905 * Hooks may return <code>void</code> or may return a <code>boolean</code>. If the method returns 906 * <code>void</code> or <code>true</code>, processing will continue normally. If the method 907 * returns <code>false</code>, processing will be aborted. 908 * </p> 909 */ 910 SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED(boolean.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"), 911 912 913 /** 914 * <b>Subscription Hook:</b> 915 * Invoked whenever a persisted resource (a resource that has just been stored in the 916 * database via a create/update/patch/etc.) has been checked for whether any subscriptions 917 * were triggered as a result of the operation. 918 * <p> 919 * Hooks may accept the following parameters: 920 * <ul> 921 * <li>ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage - This parameter should not be modified as processing is complete when this hook is invoked.</li> 922 * </ul> 923 * </p> 924 * <p> 925 * Hooks should return <code>void</code>. 926 * </p> 927 */ 928 SUBSCRIPTION_AFTER_PERSISTED_RESOURCE_CHECKED(void.class, "ca.uhn.fhir.jpa.subscription.model.ResourceModifiedMessage"), 929 930 931 /** 932 * <b>Subscription Hook:</b> 933 * Invoked immediately after an active subscription is "registered". In HAPI FHIR, when 934 * a subscription 935 * <p> 936 * Hooks may make changes to the canonicalized subscription and this will have an effect 937 * on processing across this server. Note however that timing issues may occur, since the 938 * subscription is already technically live by the time this hook is called. 939 * </p> 940 * Hooks may accept the following parameters: 941 * <ul> 942 * <li>ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription</li> 943 * </ul> 944 * <p> 945 * Hooks should return <code>void</code>. 946 * </p> 947 */ 948 SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED(void.class, "ca.uhn.fhir.jpa.subscription.model.CanonicalSubscription"), 949 950 /** 951 * <b>Subscription Hook:</b> 952 * Invoked immediately after an active subscription is "registered". In HAPI FHIR, when 953 * a subscription 954 * <p> 955 * Hooks may make changes to the canonicalized subscription and this will have an effect 956 * on processing across this server. Note however that timing issues may occur, since the 957 * subscription is already technically live by the time this hook is called. 958 * </p> 959 * No parameters are currently supported. 960 * <p> 961 * Hooks should return <code>void</code>. 962 * </p> 963 */ 964 SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_UNREGISTERED(void.class), 965 966 /** 967 * <b>Storage Hook:</b> 968 * Invoked when a resource is being deleted in a cascaded delete. This means that 969 * some other resource is being deleted, but per use request or other 970 * policy, the given resource (the one supplied as a parameter to this hook) 971 * is also being deleted. 972 * <p> 973 * Hooks may accept the following parameters: 974 * </p> 975 * <ul> 976 * <li> 977 * 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 978 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 979 * pulled out of the servlet request. Note that the bean 980 * properties are not all guaranteed to be populated, depending on how early during processing the 981 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 982 * known, such as while processing searches</b> 983 * </li> 984 * <li> 985 * 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 986 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 987 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 988 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 989 * </li> 990 * <li> 991 * ca.uhn.fhir.jpa.util.DeleteConflictList - Contains the details about the delete conflicts that are 992 * being resolved via deletion. The source resource is the resource that will be deleted, and 993 * is a cascade because the target resource is already being deleted. 994 * </li> 995 * <li> 996 * org.hl7.fhir.instance.model.api.IBaseResource - The actual resource that is about to be deleted via a cascading delete 997 * </li> 998 * </ul> 999 * <p> 1000 * Hooks should return <code>void</code>. They may choose to throw an exception however, in 1001 * which case the delete should be rolled back. 1002 * </p> 1003 */ 1004 STORAGE_CASCADE_DELETE( 1005 void.class, 1006 "ca.uhn.fhir.rest.api.server.RequestDetails", 1007 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1008 "ca.uhn.fhir.jpa.api.model.DeleteConflictList", 1009 "org.hl7.fhir.instance.model.api.IBaseResource" 1010 ), 1011 1012 1013 /** 1014 * <b>Storage Hook:</b> 1015 * Invoked when a Bulk Export job is being kicked off. Hook methods may modify 1016 * the request, or raise an exception to prevent it from being initiated. 1017 * <p> 1018 * Hooks may accept the following parameters: 1019 * </p> 1020 * <ul> 1021 * <li> 1022 * ca.uhn.fhir.jpa.bulk.export.api.BulkDataExportOptions - The details of the job being kicked off 1023 * </li> 1024 * <li> 1025 * 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 1026 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1027 * pulled out of the servlet request. Note that the bean 1028 * properties are not all guaranteed to be populated, depending on how early during processing the 1029 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1030 * known, such as while processing searches</b> 1031 * </li> 1032 * <li> 1033 * 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 1034 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1035 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1036 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1037 * </li> 1038 * </ul> 1039 * <p> 1040 * Hooks should return <code>void</code>, and can throw exceptions. 1041 * </p> 1042 */ 1043 STORAGE_INITIATE_BULK_EXPORT( 1044 void.class, 1045 "ca.uhn.fhir.rest.api.server.bulk.BulkDataExportOptions", 1046 "ca.uhn.fhir.rest.api.server.RequestDetails", 1047 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1048 ), 1049 /** 1050 * <b>Storage Hook:</b> 1051 * Invoked when a set of resources are about to be deleted and expunged via url like http://localhost/Patient?active=false&_expunge=true 1052 * <p> 1053 * Hooks may accept the following parameters: 1054 * </p> 1055 * <ul> 1056 * <li> 1057 * 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 1058 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1059 * pulled out of the servlet request. Note that the bean 1060 * properties are not all guaranteed to be populated, depending on how early during processing the 1061 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1062 * known, such as while processing searches</b> 1063 * </li> 1064 * <li> 1065 * 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 1066 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1067 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1068 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1069 * </li> 1070 * <li> 1071 * java.lang.String - Contains the url used to delete and expunge the resources 1072 * </li> 1073 * </ul> 1074 * <p> 1075 * Hooks should return <code>void</code>. They may choose to throw an exception however, in 1076 * which case the delete expunge will not occur. 1077 * </p> 1078 */ 1079 1080 STORAGE_PRE_DELETE_EXPUNGE( 1081 void.class, 1082 "ca.uhn.fhir.rest.api.server.RequestDetails", 1083 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1084 "java.lang.String" 1085 ), 1086 1087 /** 1088 * <b>Storage Hook:</b> 1089 * Invoked when a batch of resource pids are about to be deleted and expunged via url like http://localhost/Patient?active=false&_expunge=true 1090 * <p> 1091 * Hooks may accept the following parameters: 1092 * </p> 1093 * <ul> 1094 * <li> 1095 * java.lang.String - the name of the resource type being deleted 1096 * </li> 1097 * <li> 1098 * java.util.List - the list of Long pids of the resources about to be deleted 1099 * </li> 1100 * <li> 1101 * java.util.concurrent.atomic.AtomicLong - holds a running tally of all entities deleted so far. 1102 * If the pointcut callback deletes any entities, then this parameter should be incremented by the total number 1103 * of additional entities deleted. 1104 * </li> 1105 * <li> 1106 * 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 1107 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1108 * pulled out of the servlet request. Note that the bean 1109 * properties are not all guaranteed to be populated, depending on how early during processing the 1110 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1111 * known, such as while processing searches</b> 1112 * </li> 1113 * <li> 1114 * ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the 1115 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1116 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1117 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1118 * </li> 1119 * <li> 1120 * java.lang.String - Contains the url used to delete and expunge the resources 1121 * </li> 1122 * </ul> 1123 * <p> 1124 * Hooks should return <code>void</code>. They may choose to throw an exception however, in 1125 * which case the delete expunge will not occur. 1126 * </p> 1127 */ 1128 1129 STORAGE_PRE_DELETE_EXPUNGE_PID_LIST( 1130 void.class, 1131 "java.lang.String", 1132 "java.util.List", 1133 "java.util.concurrent.atomic.AtomicLong", 1134 "ca.uhn.fhir.rest.api.server.RequestDetails", 1135 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1136 ), 1137 1138 /** 1139 * <b>Storage Hook:</b> 1140 * Invoked when one or more resources may be returned to the user, whether as a part of a READ, 1141 * a SEARCH, or even as the response to a CREATE/UPDATE, etc. 1142 * <p> 1143 * This hook is invoked when a resource has been loaded by the storage engine and 1144 * is being returned to the HTTP stack for response. This is not a guarantee that the 1145 * client will ultimately see it, since filters/headers/etc may affect what 1146 * is returned but if a resource is loaded it is likely to be used. 1147 * Note also that caching may affect whether this pointcut is invoked. 1148 * </p> 1149 * <p> 1150 * Hooks will have access to the contents of the resource being returned 1151 * and may choose to make modifications. These changes will be reflected in 1152 * returned resource but have no effect on storage. 1153 * </p> 1154 * Hooks may accept the following parameters: 1155 * <ul> 1156 * <li> 1157 * ca.uhn.fhir.rest.api.server.IPreResourceAccessDetails - Contains details about the 1158 * specific resources being returned. 1159 * </li> 1160 * <li> 1161 * 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 1162 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1163 * pulled out of the servlet request. Note that the bean 1164 * properties are not all guaranteed to be populated, depending on how early during processing the 1165 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1166 * known, such as while processing searches</b> 1167 * </li> 1168 * <li> 1169 * 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 1170 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1171 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1172 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1173 * </li> 1174 * </ul> 1175 * <p> 1176 * Hooks should return <code>void</code>. 1177 * </p> 1178 */ 1179 STORAGE_PREACCESS_RESOURCES(void.class, 1180 "ca.uhn.fhir.rest.api.server.IPreResourceAccessDetails", 1181 "ca.uhn.fhir.rest.api.server.RequestDetails", 1182 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1183 ), 1184 1185 /** 1186 * <b>Storage Hook:</b> 1187 * Invoked when the storage engine is about to check for the existence of a pre-cached search 1188 * whose results match the given search parameters. 1189 * <p> 1190 * Hooks may accept the following parameters: 1191 * </p> 1192 * <ul> 1193 * <li> 1194 * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked 1195 * </li> 1196 * <li> 1197 * 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 1198 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1199 * pulled out of the servlet request. Note that the bean 1200 * properties are not all guaranteed to be populated, depending on how early during processing the 1201 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1202 * known, such as while processing searches</b> 1203 * </li> 1204 * <li> 1205 * 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 1206 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1207 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1208 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1209 * </li> 1210 * </ul> 1211 * <p> 1212 * Hooks may return <code>boolean</code>. If the hook method returns 1213 * <code>false</code>, the server will not attempt to check for a cached 1214 * search no matter what. 1215 * </p> 1216 */ 1217 STORAGE_PRECHECK_FOR_CACHED_SEARCH(boolean.class, 1218 "ca.uhn.fhir.jpa.searchparam.SearchParameterMap", 1219 "ca.uhn.fhir.rest.api.server.RequestDetails", 1220 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1221 ), 1222 1223 /** 1224 * <b>Storage Hook:</b> 1225 * Invoked when a search is starting, prior to creating a record for the search. 1226 * <p> 1227 * Hooks may accept the following parameters: 1228 * </p> 1229 * <ul> 1230 * <li> 1231 * ca.uhn.fhir.rest.server.util.ICachedSearchDetails - Contains the details of the search that 1232 * is being created and initialized 1233 * </li> 1234 * <li> 1235 * 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 1236 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1237 * pulled out of the servlet request. Note that the bean 1238 * properties are not all guaranteed to be populated, depending on how early during processing the 1239 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1240 * known, such as while processing searches</b> 1241 * </li> 1242 * <li> 1243 * 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 1244 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1245 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1246 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1247 * </li> 1248 * <li> 1249 * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked. This can be modified. 1250 * </li> 1251 * </ul> 1252 * <p> 1253 * Hooks should return <code>void</code>. 1254 * </p> 1255 */ 1256 STORAGE_PRESEARCH_REGISTERED(void.class, 1257 "ca.uhn.fhir.rest.server.util.ICachedSearchDetails", 1258 "ca.uhn.fhir.rest.api.server.RequestDetails", 1259 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1260 "ca.uhn.fhir.jpa.searchparam.SearchParameterMap" 1261 ), 1262 1263 /** 1264 * <b>Storage Hook:</b> 1265 * Invoked when one or more resources may be returned to the user, whether as a part of a READ, 1266 * a SEARCH, or even as the response to a CREATE/UPDATE, etc. 1267 * <p> 1268 * This hook is invoked when a resource has been loaded by the storage engine and 1269 * is being returned to the HTTP stack for response. 1270 * This is not a guarantee that the 1271 * client will ultimately see it, since filters/headers/etc may affect what 1272 * is returned but if a resource is loaded it is likely to be used. 1273 * Note also that caching may affect whether this pointcut is invoked. 1274 * </p> 1275 * <p> 1276 * Hooks will have access to the contents of the resource being returned 1277 * and may choose to make modifications. These changes will be reflected in 1278 * returned resource but have no effect on storage. 1279 * </p> 1280 * Hooks may accept the following parameters: 1281 * <ul> 1282 * <li> 1283 * ca.uhn.fhir.rest.api.server.IPreResourceShowDetails - Contains the resources that 1284 * will be shown to the user. This object may be manipulated in order to modify 1285 * the actual resources being shown to the user (e.g. for masking) 1286 * </li> 1287 * <li> 1288 * 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 1289 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1290 * pulled out of the servlet request. Note that the bean 1291 * properties are not all guaranteed to be populated, depending on how early during processing the 1292 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1293 * known, such as while processing searches</b> 1294 * </li> 1295 * <li> 1296 * 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 1297 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1298 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1299 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1300 * </li> 1301 * </ul> 1302 * <p> 1303 * Hooks should return <code>void</code>. 1304 * </p> 1305 */ 1306 STORAGE_PRESHOW_RESOURCES(void.class, 1307 "ca.uhn.fhir.rest.api.server.IPreResourceShowDetails", 1308 "ca.uhn.fhir.rest.api.server.RequestDetails", 1309 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1310 ), 1311 1312 /** 1313 * <b>Storage Hook:</b> 1314 * Invoked before a resource will be created, immediately before the resource 1315 * is persisted to the database. 1316 * <p> 1317 * Hooks will have access to the contents of the resource being created 1318 * and may choose to make modifications to it. These changes will be 1319 * reflected in permanent storage. 1320 * </p> 1321 * Hooks may accept the following parameters: 1322 * <ul> 1323 * <li>org.hl7.fhir.instance.model.api.IBaseResource</li> 1324 * <li> 1325 * 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 1326 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1327 * pulled out of the servlet request. Note that the bean 1328 * properties are not all guaranteed to be populated, depending on how early during processing the 1329 * exception occurred. 1330 * </li> 1331 * <li> 1332 * 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 1333 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1334 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1335 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1336 * </li> 1337 * <li> 1338 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1339 * </li> 1340 * </ul> 1341 * <p> 1342 * Hooks should return <code>void</code>. 1343 * </p> 1344 */ 1345 STORAGE_PRESTORAGE_RESOURCE_CREATED(void.class, 1346 "org.hl7.fhir.instance.model.api.IBaseResource", 1347 "ca.uhn.fhir.rest.api.server.RequestDetails", 1348 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1349 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails", 1350 "ca.uhn.fhir.interceptor.model.RequestPartitionId" 1351 ), 1352 1353 /** 1354 * <b>Storage Hook:</b> 1355 * Invoked before client-assigned id is created. 1356 * <p> 1357 * Hooks will have access to the contents of the resource being created 1358 * so that client-assigned ids can be allowed/denied. These changes will 1359 * be reflected in permanent storage. 1360 * </p> 1361 * Hooks may accept the following parameters: 1362 * <ul> 1363 * <li>org.hl7.fhir.instance.model.api.IBaseResource</li> 1364 * <li> 1365 * 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 1366 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1367 * pulled out of the servlet request. Note that the bean 1368 * properties are not all guaranteed to be populated, depending on how early during processing the 1369 * exception occurred. 1370 * </li> 1371 * </ul> 1372 * <p> 1373 * Hooks should return <code>void</code>. 1374 * </p> 1375 */ 1376 STORAGE_PRESTORAGE_CLIENT_ASSIGNED_ID(void.class, 1377 "org.hl7.fhir.instance.model.api.IBaseResource", 1378 "ca.uhn.fhir.rest.api.server.RequestDetails" 1379 ), 1380 1381 /** 1382 * <b>Storage Hook:</b> 1383 * Invoked before a resource will be updated, immediately before the resource 1384 * is persisted to the database. 1385 * <p> 1386 * Hooks will have access to the contents of the resource being updated 1387 * (both the previous and new contents) and may choose to make modifications 1388 * to the new contents of the resource. These changes will be reflected in 1389 * permanent storage. 1390 * </p> 1391 * Hooks may accept the following parameters: 1392 * <ul> 1393 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The previous contents of the resource being updated</li> 1394 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The new contents of the resource being updated</li> 1395 * <li> 1396 * 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 1397 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1398 * pulled out of the servlet request. Note that the bean 1399 * properties are not all guaranteed to be populated, depending on how early during processing the 1400 * exception occurred. 1401 * </li> 1402 * <li> 1403 * 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 1404 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1405 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1406 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1407 * </li> 1408 * <li> 1409 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1410 * </li> 1411 * </ul> 1412 * <p> 1413 * Hooks should return <code>void</code>. 1414 * </p> 1415 */ 1416 STORAGE_PRESTORAGE_RESOURCE_UPDATED(void.class, 1417 "org.hl7.fhir.instance.model.api.IBaseResource", 1418 "org.hl7.fhir.instance.model.api.IBaseResource", 1419 "ca.uhn.fhir.rest.api.server.RequestDetails", 1420 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1421 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1422 ), 1423 1424 /** 1425 * <b>Storage Hook:</b> 1426 * Invoked before a resource will be created, immediately before the resource 1427 * is persisted to the database. 1428 * <p> 1429 * Hooks will have access to the contents of the resource being created 1430 * and may choose to make modifications to it. These changes will be 1431 * reflected in permanent storage. 1432 * </p> 1433 * Hooks may accept the following parameters: 1434 * <ul> 1435 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource being deleted</li> 1436 * <li> 1437 * ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the 1438 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1439 * pulled out of the servlet request. Note that the bean 1440 * properties are not all guaranteed to be populated, depending on how early during processing the 1441 * exception occurred. 1442 * </li> 1443 * <li> 1444 * 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 1445 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1446 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1447 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1448 * </li> 1449 * <li> 1450 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1451 * </li> 1452 * </ul> 1453 * <p> 1454 * Hooks should return <code>void</code>. 1455 * </p> 1456 */ 1457 STORAGE_PRESTORAGE_RESOURCE_DELETED(void.class, 1458 "org.hl7.fhir.instance.model.api.IBaseResource", 1459 "ca.uhn.fhir.rest.api.server.RequestDetails", 1460 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1461 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1462 ), 1463 1464 1465 /** 1466 * <b>Storage Hook:</b> 1467 * Invoked before a resource will be created, immediately before the transaction 1468 * is committed (after all validation and other business rules have successfully 1469 * completed, and any other database activity is complete. 1470 * <p> 1471 * Hooks will have access to the contents of the resource being created 1472 * but should generally not make any 1473 * changes as storage has already occurred. Changes will not be reflected 1474 * in storage, but may be reflected in the HTTP response. 1475 * </p> 1476 * Hooks may accept the following parameters: 1477 * <ul> 1478 * <li>org.hl7.fhir.instance.model.api.IBaseResource</li> 1479 * <li> 1480 * 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 1481 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1482 * pulled out of the servlet request. Note that the bean 1483 * properties are not all guaranteed to be populated, depending on how early during processing the 1484 * exception occurred. 1485 * </li> 1486 * <li> 1487 * 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 1488 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1489 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1490 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1491 * </li> 1492 * <li> 1493 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1494 * </li> 1495 * <li> 1496 * Boolean - Whether this pointcut invocation was deferred or not(since 5.4.0) 1497 * </li> 1498 * <li> 1499 * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED. 1500 * </li> 1501 * </ul> 1502 * <p> 1503 * Hooks should return <code>void</code>. 1504 * </p> 1505 */ 1506 STORAGE_PRECOMMIT_RESOURCE_CREATED(void.class, 1507 "org.hl7.fhir.instance.model.api.IBaseResource", 1508 "ca.uhn.fhir.rest.api.server.RequestDetails", 1509 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1510 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails", 1511 "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum" 1512 ), 1513 1514 /** 1515 * <b>Storage Hook:</b> 1516 * Invoked before a resource will be updated, immediately before the transaction 1517 * is committed (after all validation and other business rules have successfully 1518 * completed, and any other database activity is complete. 1519 * <p> 1520 * Hooks will have access to the contents of the resource being updated 1521 * (both the previous and new contents) but should generally not make any 1522 * changes as storage has already occurred. Changes will not be reflected 1523 * in storage, but may be reflected in the HTTP response. 1524 * </p> 1525 * Hooks may accept the following parameters: 1526 * <ul> 1527 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The previous contents of the resource</li> 1528 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The proposed new contents of the resource</li> 1529 * <li> 1530 * 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 1531 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1532 * pulled out of the servlet request. Note that the bean 1533 * properties are not all guaranteed to be populated, depending on how early during processing the 1534 * exception occurred. 1535 * </li> 1536 * <li> 1537 * 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 1538 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1539 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1540 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1541 * </li> 1542 * <li> 1543 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1544 * </li> 1545 * <li> 1546 * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED. 1547 * </li> 1548 * </ul> 1549 * <p> 1550 * Hooks should return <code>void</code>. 1551 * </p> 1552 */ 1553 STORAGE_PRECOMMIT_RESOURCE_UPDATED(void.class, 1554 "org.hl7.fhir.instance.model.api.IBaseResource", 1555 "org.hl7.fhir.instance.model.api.IBaseResource", 1556 "ca.uhn.fhir.rest.api.server.RequestDetails", 1557 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1558 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails", 1559 "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum" 1560 ), 1561 1562 1563 /** 1564 * <b>Storage Hook:</b> 1565 * Invoked before a resource will be deleted 1566 * <p> 1567 * Hooks will have access to the contents of the resource being deleted 1568 * but should not make any changes as storage has already occurred 1569 * </p> 1570 * Hooks may accept the following parameters: 1571 * <ul> 1572 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource being deleted</li> 1573 * <li> 1574 * 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 1575 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1576 * pulled out of the servlet request. Note that the bean 1577 * properties are not all guaranteed to be populated, depending on how early during processing the 1578 * exception occurred. 1579 * </li> 1580 * <li> 1581 * 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 1582 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1583 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1584 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1585 * </li> 1586 * <li> 1587 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1588 * </li> 1589 * <li> 1590 * ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum - The timing at which the invocation of the interceptor took place. Options are ACTIVE and DEFERRED. 1591 * </li> 1592 * </ul> 1593 * <p> 1594 * Hooks should return <code>void</code>. 1595 * </p> 1596 */ 1597 STORAGE_PRECOMMIT_RESOURCE_DELETED(void.class, 1598 "org.hl7.fhir.instance.model.api.IBaseResource", 1599 "ca.uhn.fhir.rest.api.server.RequestDetails", 1600 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1601 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails", 1602 "ca.uhn.fhir.rest.api.InterceptorInvocationTimingEnum" 1603 ), 1604 1605 /** 1606 * <b>Storage Hook:</b> 1607 * Invoked after all entries in a transaction bundle have been executed 1608 * <p> 1609 * Hooks will have access to the original bundle, as well as all the deferred interceptor broadcasts related to the 1610 * processing of the transaction bundle 1611 * </p> 1612 * Hooks may accept the following parameters: 1613 * <ul> 1614 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource being deleted</li> 1615 * <li> 1616 * 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 1617 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1618 * pulled out of the servlet request. Note that the bean 1619 * properties are not all guaranteed to be populated, depending on how early during processing the 1620 * exception occurred. 1621 * </li> 1622 * <li> 1623 * 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 1624 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1625 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1626 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1627 * </li> 1628 * <li> 1629 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1630 * </li> 1631 * <li> 1632 * ca.uhn.fhir.rest.api.server.storage.DeferredInterceptorBroadcasts- A collection of pointcut invocations and their parameters which were deferred. 1633 * </li> 1634 * </ul> 1635 * <p> 1636 * Hooks should return <code>void</code>. 1637 * </p> 1638 */ 1639 STORAGE_TRANSACTION_PROCESSED(void.class, 1640 "org.hl7.fhir.instance.model.api.IBaseBundle", 1641 "ca.uhn.fhir.rest.api.server.storage.DeferredInterceptorBroadcasts", 1642 "ca.uhn.fhir.rest.api.server.RequestDetails", 1643 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1644 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1645 ), 1646 1647 1648 /** 1649 * <b>Storage Hook:</b> 1650 * Invoked during a FHIR transaction, immediately before processing all write operations (i.e. immediately 1651 * before a database transaction will be opened) 1652 * <p> 1653 * Hooks may accept the following parameters: 1654 * </p> 1655 * <ul> 1656 * <li> 1657 * ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails - Contains details about the transaction that is about to start 1658 * </li> 1659 * <li> 1660 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1661 * </li> 1662 * </ul> 1663 * <p> 1664 * Hooks should return <code>void</code>. 1665 * </p> 1666 */ 1667 STORAGE_TRANSACTION_WRITE_OPERATIONS_PRE(void.class, 1668 "ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails", 1669 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1670 ), 1671 1672 /** 1673 * <b>Storage Hook:</b> 1674 * Invoked during a FHIR transaction, immediately after processing all write operations (i.e. immediately 1675 * after the transaction has been committed or rolled back). This hook will always be called if 1676 * {@link #STORAGE_TRANSACTION_WRITE_OPERATIONS_PRE} has been called, regardless of whether the operation 1677 * succeeded or failed. 1678 * <p> 1679 * Hooks may accept the following parameters: 1680 * </p> 1681 * <ul> 1682 * <li> 1683 * ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails - Contains details about the transaction that is about to start 1684 * </li> 1685 * <li> 1686 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1687 * </li> 1688 * </ul> 1689 * <p> 1690 * Hooks should return <code>void</code>. 1691 * </p> 1692 */ 1693 STORAGE_TRANSACTION_WRITE_OPERATIONS_POST(void.class, 1694 "ca.uhn.fhir.interceptor.model.TransactionWriteOperationsDetails", 1695 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1696 ), 1697 1698 /** 1699 * <b>Storage Hook:</b> 1700 * 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}. 1701 * <p> 1702 * Hooks will have access to the list of resources that have references to the resource being deleted. 1703 * </p> 1704 * Hooks may accept the following parameters: 1705 * <ul> 1706 * <li>ca.uhn.fhir.jpa.api.model.DeleteConflictList - The list of delete conflicts</li> 1707 * <li> 1708 * 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 1709 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1710 * pulled out of the servlet request. Note that the bean 1711 * properties are not all guaranteed to be populated, depending on how early during processing the 1712 * exception occurred. 1713 * </li> 1714 * <li> 1715 * 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 1716 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1717 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1718 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1719 * </li> 1720 * <li> 1721 * ca.uhn.fhir.rest.api.server.storage.TransactionDetails - The outer transaction details object (since 5.0.0) 1722 * </li> 1723 * </ul> 1724 * <p> 1725 * Hooks should return <code>ca.uhn.fhir.jpa.delete.DeleteConflictOutcome</code>. 1726 * If the interceptor returns a non-null result, the DeleteConflictOutcome can be 1727 * used to indicate a number of times to retry. 1728 * </p> 1729 */ 1730 STORAGE_PRESTORAGE_DELETE_CONFLICTS( 1731 // Return type 1732 "ca.uhn.fhir.jpa.delete.DeleteConflictOutcome", 1733 // Params 1734 "ca.uhn.fhir.jpa.api.model.DeleteConflictList", 1735 "ca.uhn.fhir.rest.api.server.RequestDetails", 1736 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1737 "ca.uhn.fhir.rest.api.server.storage.TransactionDetails" 1738 ), 1739 1740 /** 1741 * <b>Storage Hook:</b> 1742 * Invoked before a resource is about to be expunged via the <code>$expunge</code> operation. 1743 * <p> 1744 * Hooks will be passed a reference to a counter containing the current number of records that have been deleted. 1745 * If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted. 1746 * </p> 1747 * <p> 1748 * Hooks may accept the following parameters: 1749 * </p> 1750 * <ul> 1751 * <li>java.util.concurrent.atomic.AtomicInteger - The counter holding the number of records deleted.</li> 1752 * <li>org.hl7.fhir.instance.model.api.IIdType - The ID of the resource that is about to be deleted</li> 1753 * <li>org.hl7.fhir.instance.model.api.IBaseResource - The resource that is about to be deleted</li> 1754 * <li> 1755 * 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 1756 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1757 * pulled out of the servlet request. Note that the bean 1758 * properties are not all guaranteed to be populated, depending on how early during processing the 1759 * exception occurred. 1760 * </li> 1761 * <li> 1762 * 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 1763 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1764 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1765 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1766 * </li> 1767 * </ul> 1768 * <p> 1769 * Hooks should return void. 1770 * </p> 1771 */ 1772 STORAGE_PRESTORAGE_EXPUNGE_RESOURCE( 1773 // Return type 1774 void.class, 1775 // Params 1776 "java.util.concurrent.atomic.AtomicInteger", 1777 "org.hl7.fhir.instance.model.api.IIdType", 1778 "org.hl7.fhir.instance.model.api.IBaseResource", 1779 "ca.uhn.fhir.rest.api.server.RequestDetails", 1780 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1781 ), 1782 1783 /** 1784 * <b>Storage Hook:</b> 1785 * Invoked before an <code>$expunge</code> operation on all data (expungeEverything) is called. 1786 * <p> 1787 * Hooks will be passed a reference to a counter containing the current number of records that have been deleted. 1788 * If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted. 1789 * </p> 1790 * Hooks may accept the following parameters: 1791 * <ul> 1792 * <li>java.util.concurrent.atomic.AtomicInteger - The counter holding the number of records deleted.</li> 1793 * <li> 1794 * 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 1795 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1796 * pulled out of the servlet request. Note that the bean 1797 * properties are not all guaranteed to be populated, depending on how early during processing the 1798 * exception occurred. 1799 * </li> 1800 * <li> 1801 * 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 1802 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1803 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1804 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1805 * </li> 1806 * </ul> 1807 * <p> 1808 * Hooks should return void. 1809 * </p> 1810 */ 1811 STORAGE_PRESTORAGE_EXPUNGE_EVERYTHING( 1812 // Return type 1813 void.class, 1814 // Params 1815 "java.util.concurrent.atomic.AtomicInteger", 1816 "ca.uhn.fhir.rest.api.server.RequestDetails", 1817 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1818 ), 1819 1820 /** 1821 * <b>Storage Hook:</b> 1822 * Invoked before FHIR <b>create</b> operation to request the identification of the partition ID to be associated 1823 * with the resource being created. This hook will only be called if partitioning is enabled in the JPA 1824 * server. 1825 * <p> 1826 * Hooks may accept the following parameters: 1827 * </p> 1828 * <ul> 1829 * <li> 1830 * org.hl7.fhir.instance.model.api.IBaseResource - The resource that will be created and needs a tenant ID assigned. 1831 * </li> 1832 * <li> 1833 * 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 1834 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1835 * pulled out of the servlet request. Note that the bean 1836 * properties are not all guaranteed to be populated, depending on how early during processing the 1837 * exception occurred. 1838 * </li> 1839 * <li> 1840 * 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 1841 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1842 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1843 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1844 * </li> 1845 * </ul> 1846 * <p> 1847 * Hooks must return an instance of <code>ca.uhn.fhir.interceptor.model.RequestPartitionId</code>. 1848 * </p> 1849 */ 1850 STORAGE_PARTITION_IDENTIFY_CREATE( 1851 // Return type 1852 "ca.uhn.fhir.interceptor.model.RequestPartitionId", 1853 // Params 1854 "org.hl7.fhir.instance.model.api.IBaseResource", 1855 "ca.uhn.fhir.rest.api.server.RequestDetails", 1856 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1857 ), 1858 1859 /** 1860 * <b>Storage Hook:</b> 1861 * Invoked before FHIR read/access operation (e.g. <b>read/vread</b>, <b>search</b>, <b>history</b>, etc.) operation to request the 1862 * identification of the partition ID to be associated with the resource(s) being searched for, read, etc. 1863 * <p> 1864 * This hook will only be called if 1865 * partitioning is enabled in the JPA server. 1866 * </p> 1867 * <p> 1868 * Hooks may accept the following parameters: 1869 * </p> 1870 * <ul> 1871 * <li> 1872 * 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 1873 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1874 * pulled out of the servlet request. Note that the bean 1875 * properties are not all guaranteed to be populated, depending on how early during processing the 1876 * exception occurred. 1877 * </li> 1878 * <li> 1879 * 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 1880 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1881 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1882 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1883 * </li> 1884 * <li>ca.uhn.fhir.interceptor.model.ReadPartitionIdRequestDetails - Contains details about what is being read</li> 1885 * </ul> 1886 * <p> 1887 * Hooks must return an instance of <code>ca.uhn.fhir.interceptor.model.RequestPartitionId</code>. 1888 * </p> 1889 */ 1890 STORAGE_PARTITION_IDENTIFY_READ( 1891 // Return type 1892 "ca.uhn.fhir.interceptor.model.RequestPartitionId", 1893 // Params 1894 "ca.uhn.fhir.rest.api.server.RequestDetails", 1895 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1896 "ca.uhn.fhir.interceptor.model.ReadPartitionIdRequestDetails" 1897 ), 1898 1899 /** 1900 * <b>Storage Hook:</b> 1901 * Invoked before any partition aware FHIR operation, when the selected partition has been identified (ie. after the 1902 * {@link #STORAGE_PARTITION_IDENTIFY_CREATE} or {@link #STORAGE_PARTITION_IDENTIFY_READ} hook was called. This allows 1903 * a separate hook to register, and potentially make decisions about whether the request should be allowed to proceed. 1904 * <p> 1905 * This hook will only be called if 1906 * partitioning is enabled in the JPA server. 1907 * </p> 1908 * <p> 1909 * Hooks may accept the following parameters: 1910 * </p> 1911 * <ul> 1912 * <li> 1913 * ca.uhn.fhir.interceptor.model.RequestPartitionId - The partition ID that was selected 1914 * </li> 1915 * <li> 1916 * 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 1917 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1918 * pulled out of the servlet request. Note that the bean 1919 * properties are not all guaranteed to be populated, depending on how early during processing the 1920 * exception occurred. 1921 * </li> 1922 * <li> 1923 * 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 1924 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1925 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1926 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1927 * </li> 1928 * <li> 1929 * ca.uhn.fhir.context.RuntimeResourceDefinition - the resource type being accessed 1930 * </li> 1931 * </ul> 1932 * <p> 1933 * Hooks must return void. 1934 * </p> 1935 */ 1936 STORAGE_PARTITION_SELECTED( 1937 // Return type 1938 void.class, 1939 // Params 1940 "ca.uhn.fhir.interceptor.model.RequestPartitionId", 1941 "ca.uhn.fhir.rest.api.server.RequestDetails", 1942 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 1943 "ca.uhn.fhir.context.RuntimeResourceDefinition" 1944 ), 1945 1946 /** 1947 * <b>Storage Hook:</b> 1948 * Invoked when a transaction has been rolled back as a result of a {@link ca.uhn.fhir.rest.server.exceptions.ResourceVersionConflictException}, 1949 * meaning that a database constraint has been violated. This pointcut allows an interceptor to specify a resolution strategy 1950 * other than simply returning the error to the client. This interceptor will be fired after the database transaction rollback 1951 * has been completed. 1952 * <p> 1953 * Hooks may accept the following parameters: 1954 * </p> 1955 * <ul> 1956 * <li> 1957 * 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 1958 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1959 * pulled out of the servlet request. Note that the bean 1960 * properties are not all guaranteed to be populated, depending on how early during processing the 1961 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 1962 * known, such as while processing searches</b> 1963 * </li> 1964 * <li> 1965 * 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 1966 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 1967 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 1968 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 1969 * </li> 1970 * </ul> 1971 * <p> 1972 * Hooks should return <code>ca.uhn.fhir.jpa.api.model.ResourceVersionConflictResolutionStrategy</code>. Hooks should not 1973 * throw any exception. 1974 * </p> 1975 */ 1976 STORAGE_VERSION_CONFLICT( 1977 "ca.uhn.fhir.jpa.api.model.ResourceVersionConflictResolutionStrategy", 1978 "ca.uhn.fhir.rest.api.server.RequestDetails", 1979 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 1980 ), 1981 1982 /** 1983 * <b>Validation Hook:</b> 1984 * This hook is called after validation has completed, regardless of whether the validation was successful or failed. 1985 * Typically this is used to modify validation results. 1986 * <p> 1987 * <b>Note on validation Pointcuts:</b> The HAPI FHIR interceptor framework is a part of the client and server frameworks and 1988 * not a part of the core FhirContext. Therefore this Pointcut is invoked by the 1989 * </p> 1990 * <p> 1991 * Hooks may accept the following parameters: 1992 * <ul> 1993 * <li> 1994 * org.hl7.fhir.instance.model.api.IBaseResource - The resource being validated, if a parsed version is available (null otherwise) 1995 * </li> 1996 * <li> 1997 * java.lang.String - The resource being validated, if a raw version is available (null otherwise) 1998 * </li> 1999 * <li> 2000 * ca.uhn.fhir.validation.ValidationResult - The outcome of the validation. Hooks methods should not modify this object, but they can return a new one. 2001 * </li> 2002 * </ul> 2003 * </p> 2004 * 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. 2005 */ 2006 VALIDATION_COMPLETED(ValidationResult.class, 2007 "org.hl7.fhir.instance.model.api.IBaseResource", 2008 "java.lang.String", 2009 "ca.uhn.fhir.validation.ValidationResult" 2010 ), 2011 2012 /** 2013 * <b>MDM(EMPI) Hook:</b> 2014 * Invoked when a persisted resource (a resource that has just been stored in the 2015 * database via a create/update/patch/etc.) enters the MDM module. The purpose of the pointcut is to permit a pseudo 2016 * modification of the resource elements to influence the MDM linking process. Any modifications to the resource are not persisted. 2017 * <p> 2018 * Hooks may accept the following parameters: 2019 * <ul> 2020 * <li>org.hl7.fhir.instance.model.api.IBaseResource - </li> 2021 * </ul> 2022 * </p> 2023 * <p> 2024 * Hooks should return <code>void</code>. 2025 * </p> 2026 */ 2027 MDM_BEFORE_PERSISTED_RESOURCE_CHECKED(void.class, 2028 "org.hl7.fhir.instance.model.api.IBaseResource"), 2029 2030 /** 2031 * <b>MDM(EMPI) Hook:</b> 2032 * Invoked whenever a persisted resource (a resource that has just been stored in the 2033 * database via a create/update/patch/etc.) has been matched against related resources and MDM links have been updated. 2034 * <p> 2035 * Hooks may accept the following parameters: 2036 * <ul> 2037 * <li>ca.uhn.fhir.rest.server.messaging.ResourceOperationMessage - This parameter should not be modified as processing is complete when this hook is invoked.</li> 2038 * <li>ca.uhn.fhir.rest.server.TransactionLogMessages - This parameter is for informational messages provided by the MDM module during MDM processing.</li> 2039 * <li>ca.uhn.fhir.mdm.api.MdmLinkChangeEvent - Contains information about the change event, including target and golden resource IDs and the operation type.</li> 2040 * </ul> 2041 * </p> 2042 * <p> 2043 * Hooks should return <code>void</code>. 2044 * </p> 2045 */ 2046 MDM_AFTER_PERSISTED_RESOURCE_CHECKED(void.class, 2047 "ca.uhn.fhir.rest.server.messaging.ResourceOperationMessage", 2048 "ca.uhn.fhir.rest.server.TransactionLogMessages", 2049 "ca.uhn.fhir.mdm.api.MdmLinkEvent"), 2050 2051 /** 2052 * <b>Performance Tracing Hook:</b> 2053 * This hook is invoked when any informational messages generated by the 2054 * SearchCoordinator are created. It is typically used to provide logging 2055 * or capture details related to a specific request. 2056 * <p> 2057 * Note that this is a performance tracing hook. Use with caution in production 2058 * systems, since calling it may (or may not) carry a cost. 2059 * </p> 2060 * Hooks may accept the following parameters: 2061 * <ul> 2062 * <li> 2063 * ca.uhn.fhir.rest.api.server.RequestDetails - A bean containing details about the request that is about to be processed, including details such as the 2064 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2065 * pulled out of the servlet request. Note that the bean 2066 * properties are not all guaranteed to be populated, depending on how early during processing the 2067 * exception occurred. 2068 * </li> 2069 * <li> 2070 * ca.uhn.fhir.rest.server.servlet.ServletRequestDetails - A bean containing details about the request that is about to be processed, including details such as the 2071 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2072 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2073 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2074 * </li> 2075 * <li> 2076 * ca.uhn.fhir.jpa.model.search.StorageProcessingMessage - Contains the message 2077 * </li> 2078 * </ul> 2079 * <p> 2080 * Hooks should return <code>void</code>. 2081 * </p> 2082 */ 2083 JPA_PERFTRACE_INFO(void.class, 2084 "ca.uhn.fhir.rest.api.server.RequestDetails", 2085 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2086 "ca.uhn.fhir.jpa.model.search.StorageProcessingMessage" 2087 ), 2088 2089 /** 2090 * <b>Performance Tracing Hook:</b> 2091 * This hook is invoked when any warning messages generated by the 2092 * SearchCoordinator are created. It is typically used to provide logging 2093 * or capture details related to a specific request. 2094 * <p> 2095 * Note that this is a performance tracing hook. Use with caution in production 2096 * systems, since calling it may (or may not) carry a cost. 2097 * </p> 2098 * Hooks may accept the following parameters: 2099 * <ul> 2100 * <li> 2101 * 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 2102 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2103 * pulled out of the servlet request. Note that the bean 2104 * properties are not all guaranteed to be populated, depending on how early during processing the 2105 * exception occurred. 2106 * </li> 2107 * <li> 2108 * 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 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. This parameter is identical to the RequestDetails parameter above but will 2111 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2112 * </li> 2113 * <li> 2114 * ca.uhn.fhir.jpa.model.search.StorageProcessingMessage - Contains the message 2115 * </li> 2116 * </ul> 2117 * <p> 2118 * Hooks should return <code>void</code>. 2119 * </p> 2120 */ 2121 JPA_PERFTRACE_WARNING(void.class, 2122 "ca.uhn.fhir.rest.api.server.RequestDetails", 2123 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2124 "ca.uhn.fhir.jpa.model.search.StorageProcessingMessage" 2125 ), 2126 2127 /** 2128 * <b>Performance Tracing Hook:</b> 2129 * This hook is invoked when a search has returned the very first result 2130 * from the database. The timing on this call can be a good indicator of how 2131 * performant a query is in general. 2132 * <p> 2133 * Note that this is a performance tracing hook. Use with caution in production 2134 * systems, since calling it may (or may not) carry a cost. 2135 * </p> 2136 * Hooks may accept the following parameters: 2137 * <ul> 2138 * <li> 2139 * 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 2140 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2141 * pulled out of the servlet request. Note that the bean 2142 * properties are not all guaranteed to be populated, depending on how early during processing the 2143 * exception occurred. 2144 * </li> 2145 * <li> 2146 * 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 2147 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2148 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2149 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2150 * </li> 2151 * <li> 2152 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2153 * performed. Hooks should not modify this object. 2154 * </li> 2155 * </ul> 2156 * <p> 2157 * Hooks should return <code>void</code>. 2158 * </p> 2159 */ 2160 JPA_PERFTRACE_SEARCH_FIRST_RESULT_LOADED(void.class, 2161 "ca.uhn.fhir.rest.api.server.RequestDetails", 2162 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2163 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2164 ), 2165 2166 /** 2167 * <b>Performance Tracing Hook:</b> 2168 * This hook is invoked when an individual search query SQL SELECT statement 2169 * has completed and no more results are available from that query. Note that this 2170 * doesn't necessarily mean that no more matching results exist in the database, 2171 * since HAPI FHIR JPA batch loads results in to the query cache in chunks in order 2172 * to provide predicable results without overloading memory or the database. 2173 * <p> 2174 * Note that this is a performance tracing hook. Use with caution in production 2175 * systems, since calling it may (or may not) carry a cost. 2176 * </p> 2177 * Hooks may accept the following parameters: 2178 * <ul> 2179 * <li> 2180 * 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 2181 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2182 * pulled out of the servlet request. Note that the bean 2183 * properties are not all guaranteed to be populated, depending on how early during processing the 2184 * exception occurred. 2185 * </li> 2186 * <li> 2187 * 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 2188 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2189 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2190 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2191 * </li> 2192 * <li> 2193 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2194 * performed. Hooks should not modify this object. 2195 * </li> 2196 * </ul> 2197 * <p> 2198 * Hooks should return <code>void</code>. 2199 * </p> 2200 */ 2201 JPA_PERFTRACE_SEARCH_SELECT_COMPLETE(void.class, 2202 "ca.uhn.fhir.rest.api.server.RequestDetails", 2203 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2204 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2205 ), 2206 2207 2208 /** 2209 * <b>Performance Tracing Hook:</b> 2210 * This hook is invoked when a search has failed for any reason. When this pointcut 2211 * is invoked, the search has completed unsuccessfully and will not be continued. 2212 * <p> 2213 * Note that this is a performance tracing hook. Use with caution in production 2214 * systems, since calling it may (or may not) carry a cost. 2215 * </p> 2216 * Hooks may accept the following parameters: 2217 * <ul> 2218 * <li> 2219 * 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 2220 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2221 * pulled out of the servlet request. Note that the bean 2222 * properties are not all guaranteed to be populated, depending on how early during processing the 2223 * exception occurred. 2224 * </li> 2225 * <li> 2226 * 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 2227 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2228 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2229 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2230 * </li> 2231 * <li> 2232 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2233 * performed. Hooks should not modify this object. 2234 * </li> 2235 * </ul> 2236 * <p> 2237 * Hooks should return <code>void</code>. 2238 * </p> 2239 */ 2240 JPA_PERFTRACE_SEARCH_FAILED(void.class, 2241 "ca.uhn.fhir.rest.api.server.RequestDetails", 2242 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2243 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2244 ), 2245 2246 /** 2247 * <b>Performance Tracing Hook:</b> 2248 * This hook is invoked when a search has completed. When this pointcut 2249 * is invoked, a pass in the Search Coordinator has completed successfully, but 2250 * not all possible resources have been loaded yet so a future paging request 2251 * may trigger a new task that will load further resources. 2252 * <p> 2253 * Note that this is a performance tracing hook. Use with caution in production 2254 * systems, since calling it may (or may not) carry a cost. 2255 * </p> 2256 * Hooks may accept the following parameters: 2257 * <ul> 2258 * <li> 2259 * 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 2260 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2261 * pulled out of the servlet request. Note that the bean 2262 * properties are not all guaranteed to be populated, depending on how early during processing the 2263 * exception occurred. 2264 * </li> 2265 * <li> 2266 * 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 2267 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2268 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2269 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2270 * </li> 2271 * <li> 2272 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2273 * performed. Hooks should not modify this object. 2274 * </li> 2275 * </ul> 2276 * <p> 2277 * Hooks should return <code>void</code>. 2278 * </p> 2279 */ 2280 JPA_PERFTRACE_SEARCH_PASS_COMPLETE(void.class, 2281 "ca.uhn.fhir.rest.api.server.RequestDetails", 2282 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2283 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2284 ), 2285 2286 /** 2287 * <b>Performance Tracing Hook:</b> 2288 * This hook is invoked when a query involving an external index (e.g. Elasticsearch) has completed. When this pointcut 2289 * is invoked, an initial list of resource IDs has been generated which will be used as part of a subsequent database query. 2290 * <p> 2291 * Note that this is a performance tracing hook. Use with caution in production 2292 * systems, since calling it may (or may not) carry a cost. 2293 * </p> 2294 * Hooks may accept the following parameters: 2295 * <ul> 2296 * <li> 2297 * 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 2298 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2299 * pulled out of the servlet request. Note that the bean 2300 * properties are not all guaranteed to be populated, depending on how early during processing the 2301 * exception occurred. 2302 * </li> 2303 * <li> 2304 * 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 2305 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2306 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2307 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2308 * </li> 2309 * <li> 2310 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2311 * performed. Hooks should not modify this object. 2312 * </li> 2313 * </ul> 2314 * <p> 2315 * Hooks should return <code>void</code>. 2316 * </p> 2317 */ 2318 JPA_PERFTRACE_INDEXSEARCH_QUERY_COMPLETE(void.class, 2319 "ca.uhn.fhir.rest.api.server.RequestDetails", 2320 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2321 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2322 ), 2323 2324 /** 2325 * <b>Performance Tracing Hook:</b> 2326 * Invoked when the storage engine is about to reuse the results of 2327 * a previously cached search. 2328 * <p> 2329 * Note that this is a performance tracing hook. Use with caution in production 2330 * systems, since calling it may (or may not) carry a cost. 2331 * </p> 2332 * <p> 2333 * Hooks may accept the following parameters: 2334 * </p> 2335 * <ul> 2336 * <li> 2337 * ca.uhn.fhir.jpa.searchparam.SearchParameterMap - Contains the details of the search being checked 2338 * </li> 2339 * <li> 2340 * 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 2341 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2342 * pulled out of the servlet request. Note that the bean 2343 * properties are not all guaranteed to be populated, depending on how early during processing the 2344 * exception occurred. <b>Note that this parameter may be null in contexts where the request is not 2345 * known, such as while processing searches</b> 2346 * </li> 2347 * <li> 2348 * 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 2349 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2350 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2351 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2352 * </li> 2353 * </ul> 2354 * <p> 2355 * Hooks should return <code>void</code>. 2356 * </p> 2357 */ 2358 JPA_PERFTRACE_SEARCH_REUSING_CACHED(boolean.class, 2359 "ca.uhn.fhir.jpa.searchparam.SearchParameterMap", 2360 "ca.uhn.fhir.rest.api.server.RequestDetails", 2361 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails" 2362 ), 2363 2364 /** 2365 * <b>Performance Tracing Hook:</b> 2366 * This hook is invoked when a search has failed for any reason. When this pointcut 2367 * is invoked, a pass in the Search Coordinator has completed successfully, and all 2368 * possible results have been fetched and loaded into the query cache. 2369 * <p> 2370 * Note that this is a performance tracing hook. Use with caution in production 2371 * systems, since calling it may (or may not) carry a cost. 2372 * </p> 2373 * Hooks may accept the following parameters: 2374 * <ul> 2375 * <li> 2376 * 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 2377 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2378 * pulled out of the servlet request. Note that the bean 2379 * properties are not all guaranteed to be populated, depending on how early during processing the 2380 * exception occurred. 2381 * </li> 2382 * <li> 2383 * 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 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. This parameter is identical to the RequestDetails parameter above but will 2386 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2387 * </li> 2388 * <li> 2389 * ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails - Contains details about the search being 2390 * performed. Hooks should not modify this object. 2391 * </li> 2392 * </ul> 2393 * <p> 2394 * Hooks should return <code>void</code>. 2395 * </p> 2396 */ 2397 JPA_PERFTRACE_SEARCH_COMPLETE(void.class, 2398 "ca.uhn.fhir.rest.api.server.RequestDetails", 2399 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2400 "ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails" 2401 ), 2402 2403 2404 /** 2405 * <b>Performance Tracing Hook:</b> 2406 * <p> 2407 * This hook is invoked when a search has found an individual ID. 2408 * </p> 2409 * <p> 2410 * THIS IS AN EXPERIMENTAL HOOK AND MAY BE REMOVED OR CHANGED WITHOUT WARNING. 2411 * </p> 2412 * <p> 2413 * Note that this is a performance tracing hook. Use with caution in production 2414 * systems, since calling it may (or may not) carry a cost. 2415 * </p> 2416 * <p> 2417 * Hooks may accept the following parameters: 2418 * </p> 2419 * <ul> 2420 * <li> 2421 * java.lang.Integer - The query ID 2422 * </li> 2423 * <li> 2424 * java.lang.Object - The ID 2425 * </li> 2426 * </ul> 2427 * <p> 2428 * Hooks should return <code>void</code>. 2429 * </p> 2430 */ 2431 JPA_PERFTRACE_SEARCH_FOUND_ID(void.class, 2432 "java.lang.Integer", 2433 "java.lang.Object" 2434 ), 2435 2436 2437 /** 2438 * <b>Performance Tracing Hook:</b> 2439 * This hook is invoked when a query has executed, and includes the raw SQL 2440 * statements that were executed against the database. 2441 * <p> 2442 * Note that this is a performance tracing hook. Use with caution in production 2443 * systems, since calling it may (or may not) carry a cost. 2444 * </p> 2445 * <p> 2446 * Hooks may accept the following parameters: 2447 * </p> 2448 * <ul> 2449 * <li> 2450 * 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 2451 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2452 * pulled out of the servlet request. Note that the bean 2453 * properties are not all guaranteed to be populated, depending on how early during processing the 2454 * exception occurred. 2455 * </li> 2456 * <li> 2457 * 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 2458 * resource type and logical ID (if any) and other FHIR-specific aspects of the request which have been 2459 * pulled out of the servlet request. This parameter is identical to the RequestDetails parameter above but will 2460 * only be populated when operating in a RestfulServer implementation. It is provided as a convenience. 2461 * </li> 2462 * <li> 2463 * ca.uhn.fhir.jpa.util.SqlQueryList - Contains details about the raw SQL queries. 2464 * </li> 2465 * </ul> 2466 * <p> 2467 * Hooks should return <code>void</code>. 2468 * </p> 2469 */ 2470 JPA_PERFTRACE_RAW_SQL(void.class, 2471 "ca.uhn.fhir.rest.api.server.RequestDetails", 2472 "ca.uhn.fhir.rest.server.servlet.ServletRequestDetails", 2473 "ca.uhn.fhir.jpa.util.SqlQueryList" 2474 ), 2475 2476 /** 2477 * This pointcut is used only for unit tests. Do not use in production code as it may be changed or 2478 * removed at any time. 2479 */ 2480 TEST_RB( 2481 boolean.class, 2482 new ExceptionHandlingSpec().addLogAndSwallow(IllegalStateException.class), 2483 String.class.getName(), 2484 String.class.getName()), 2485 2486 /** 2487 * This pointcut is used only for unit tests. Do not use in production code as it may be changed or 2488 * removed at any time. 2489 */ 2490 TEST_RO(BaseServerResponseException.class, String.class.getName(), String.class.getName()); 2491 2492 private final List<String> myParameterTypes; 2493 private final Class<?> myReturnType; 2494 private final ExceptionHandlingSpec myExceptionHandlingSpec; 2495 2496 Pointcut(@Nonnull String theReturnType, String... theParameterTypes) { 2497 this(toReturnTypeClass(theReturnType), new ExceptionHandlingSpec(), theParameterTypes); 2498 } 2499 2500 Pointcut(@Nonnull Class<?> theReturnType, @Nonnull ExceptionHandlingSpec theExceptionHandlingSpec, String... theParameterTypes) { 2501 myReturnType = theReturnType; 2502 myExceptionHandlingSpec = theExceptionHandlingSpec; 2503 myParameterTypes = Collections.unmodifiableList(Arrays.asList(theParameterTypes)); 2504 } 2505 2506 Pointcut(@Nonnull Class<?> theReturnType, String... theParameterTypes) { 2507 this(theReturnType, new ExceptionHandlingSpec(), theParameterTypes); 2508 } 2509 2510 @Override 2511 public boolean isShouldLogAndSwallowException(@Nonnull Throwable theException) { 2512 for (Class<? extends Throwable> next : myExceptionHandlingSpec.myTypesToLogAndSwallow) { 2513 if (next.isAssignableFrom(theException.getClass())) { 2514 return true; 2515 } 2516 } 2517 return false; 2518 } 2519 2520 @Override 2521 @Nonnull 2522 public Class<?> getReturnType() { 2523 return myReturnType; 2524 } 2525 2526 @Override 2527 @Nonnull 2528 public List<String> getParameterTypes() { 2529 return myParameterTypes; 2530 } 2531 2532 private static class UnknownType { 2533 } 2534 2535 private static class ExceptionHandlingSpec { 2536 2537 private final Set<Class<? extends Throwable>> myTypesToLogAndSwallow = new HashSet<>(); 2538 2539 ExceptionHandlingSpec addLogAndSwallow(@Nonnull Class<? extends Throwable> theType) { 2540 myTypesToLogAndSwallow.add(theType); 2541 return this; 2542 } 2543 2544 } 2545 2546 private static Class<?> toReturnTypeClass(String theReturnType) { 2547 try { 2548 return Class.forName(theReturnType); 2549 } catch (ClassNotFoundException theE) { 2550 return UnknownType.class; 2551 } 2552 } 2553 2554}