public enum Pointcut extends Enum<Pointcut>
Hook.value()
Hook pointcuts are divided into several broad categories:
| Enum Constant and Description |
|---|
CLIENT_REQUEST
Client Hook:
This hook is called before an HTTP client request is sent
|
CLIENT_RESPONSE
Client Hook:
This hook is called after an HTTP client request has completed, prior to returning
the results to the calling code.
|
INTERCEPTOR_REGISTERED
Registry Hook:
This pointcut will be called once when a given interceptor is registered
|
JPA_PERFTRACE_INFO
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_RAW_SQL
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_SEARCH_COMPLETE
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_SEARCH_FAILED
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_SEARCH_FIRST_RESULT_LOADED
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_SEARCH_PASS_COMPLETE
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_SEARCH_REUSING_CACHED
Invoked when the storage engine is about to reuse the results of
a previously cached search.
|
JPA_PERFTRACE_SEARCH_SELECT_COMPLETE
Note that this is a performance tracing hook.
|
JPA_PERFTRACE_WARNING
Note that this is a performance tracing hook.
|
SERVER_HANDLE_EXCEPTION
Server Hook:
This hook is invoked upon any exception being thrown within the server's request processing code.
|
SERVER_INCOMING_REQUEST_POST_PROCESSED
Server Hook:
This method is called just before the actual implementing server method is invoked.
|
SERVER_INCOMING_REQUEST_PRE_HANDLED
Server Hook:
This hook is invoked before an incoming request is processed.
|
SERVER_INCOMING_REQUEST_PRE_PROCESSED
Server Hook:
This hook is called before any other processing takes place for each incoming request.
|
SERVER_OUTGOING_FAILURE_OPERATIONOUTCOME
Server Hook:
This method is called when an OperationOutcome is being returned in response to a failure.
|
SERVER_OUTGOING_GRAPHQL_RESPONSE
Server Hook:
This method is called after the server implementation method has been called, but before any attempt
to stream the response back to the client, specifically for GraphQL requests (as these do not fit
cleanly into the model provided by
SERVER_OUTGOING_RESPONSE). |
SERVER_OUTGOING_RESPONSE
Server Hook:
This method is called after the server implementation method has been called, but before any attempt
to stream the response back to the client.
|
SERVER_PRE_PROCESS_OUTGOING_EXCEPTION
Server Hook:
This method is called upon any exception being thrown within the server's request processing code.
|
SERVER_PROCESSING_COMPLETED
Server Hook:
This method is called after all processing is completed for a request, regardless of whether
the request completed successfully or not.
|
SERVER_PROCESSING_COMPLETED_NORMALLY
Server Hook:
This method is called after all processing is completed for a request, but only if the
request completes normally (i.e.
|
STORAGE_CASCADE_DELETE
Invoked when a resource is being deleted in a cascaded delete.
|
STORAGE_PREACCESS_RESOURCES
Invoked when one or more resources may be returned to the user, whether as a part of a READ,
a SEARCH, or even as the response to a CREATE/UPDATE, etc.
|
STORAGE_PRECHECK_FOR_CACHED_SEARCH
Invoked when the storage engine is about to check for the existence of a pre-cached search
whose results match the given search parameters.
|
STORAGE_PRECOMMIT_RESOURCE_CREATED
Invoked before a resource will be created, immediately before the transaction
is committed (after all validation and other business rules have successfully
completed, and any other database activity is complete.
|
STORAGE_PRECOMMIT_RESOURCE_DELETED
Invoked before a resource will be created
|
STORAGE_PRECOMMIT_RESOURCE_UPDATED
Invoked before a resource will be updated, immediately before the transaction
is committed (after all validation and other business rules have successfully
completed, and any other database activity is complete.
|
STORAGE_PRESEARCH_REGISTERED
Invoked when a search is starting, prior to creating a record for the search.
|
STORAGE_PRESHOW_RESOURCES
Invoked when one or more resources may be returned to the user, whether as a part of a READ,
a SEARCH, or even as the response to a CREATE/UPDATE, etc.
|
STORAGE_PRESTORAGE_DELETE_CONFLICTS
Invoked when a resource delete operation is about to fail due to referential integrity conflicts.
|
STORAGE_PRESTORAGE_EXPUNGE_EVERYTHING
Invoked before expungeEverything is called.
|
STORAGE_PRESTORAGE_EXPUNGE_RESOURCE
Invoked before a resource is about to be expunged via the
$expunge operation. |
STORAGE_PRESTORAGE_RESOURCE_CREATED
Invoked before a resource will be created, immediately before the resource
is persisted to the database.
|
STORAGE_PRESTORAGE_RESOURCE_DELETED
Invoked before a resource will be created, immediately before the resource
is persisted to the database.
|
STORAGE_PRESTORAGE_RESOURCE_UPDATED
Invoked before a resource will be updated, immediately before the resource
is persisted to the database.
|
SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED
Invoked immediately after an active subscription is "registered".
|
SUBSCRIPTION_AFTER_DELIVERY
Invoked immediately after the delivery of a subscription, and right before any channel-specific
hooks are invoked (e.g.
|
SUBSCRIPTION_AFTER_DELIVERY_FAILED
Invoked immediately after the attempted delivery of a subscription, if the delivery
failed.
|
SUBSCRIPTION_AFTER_PERSISTED_RESOURCE_CHECKED
Invoked whenever a persisted resource (a resource that has just been stored in the
database via a create/update/patch/etc.) has been checked for whether any subscriptions
were triggered as a result of the operation.
|
SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY
Invoked immediately after the delivery of a REST HOOK subscription.
|
SUBSCRIPTION_BEFORE_DELIVERY
Invoked immediately before the delivery of a subscription, and right before any channel-specific
hooks are invoked (e.g.
|
SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED
Invoked whenever a persisted resource (a resource that has just been stored in the
database via a create/update/patch/etc.) is about to be checked for whether any subscriptions
were triggered as a result of the operation.
|
SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY
Invoked immediately before the delivery of a REST HOOK subscription.
|
SUBSCRIPTION_RESOURCE_DID_NOT_MATCH_ANY_SUBSCRIPTIONS
Invoked whenever a persisted resource was checked against all active subscriptions, and did not
match any.
|
SUBSCRIPTION_RESOURCE_MATCHED
Invoked any time that a resource is matched by an individual subscription, and
is about to be queued for delivery.
|
SUBSCRIPTION_RESOURCE_MODIFIED
Invoked whenever a persisted resource has been modified and is being submitted to the
subscription processing pipeline.
|
TEST_RB
This pointcut is used only for unit tests.
|
TEST_RO
This pointcut is used only for unit tests.
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getParameterTypes() |
Class<?> |
getReturnType() |
boolean |
isShouldLogAndSwallowException(Throwable theException) |
static Pointcut |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Pointcut[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Pointcut INTERCEPTOR_REGISTERED
public static final Pointcut CLIENT_REQUEST
Hooks may accept the following parameters:
void.public static final Pointcut CLIENT_RESPONSE
Hooks may accept the following parameters:
void.public static final Pointcut SERVER_INCOMING_REQUEST_PRE_PROCESSED
Note that any exceptions thrown by this method will not be trapped by HAPI (they will be passed up to the server)
Hooks may accept the following parameters:
true or void if processing should continue normally.
This is generally the right thing to do. If your interceptor is providing a response rather than
letting HAPI handle the response normally, you must return false. In this case,
no further processing will occur and no further interceptors will be called.public static final Pointcut SERVER_HANDLE_EXCEPTION
Search and Read methods) as well as
any runtime exceptions thrown by the server itself. This also includes any AuthenticationExceptions
thrown.
Hooks may accept the following parameters:
Implementations of this method may choose to ignore/log/count/etc exceptions, and return true or
void. In
this case, processing will continue, and the server will automatically generate an OperationOutcome. Implementations may also choose to provide their own response to the client. In this case, they
should return false, to indicate that they have handled the request and processing should stop.
public static final Pointcut SERVER_INCOMING_REQUEST_POST_PROCESSED
Hooks may accept the following parameters:
Hook methods may return true or void if processing should continue normally.
This is generally the right thing to do.
If your interceptor is providing an HTTP response rather than letting HAPI handle the response normally, you
must return false. In this case, no further processing will occur and no further interceptors
will be called.
Hook methods may also throw AuthenticationException if they would like. This exception may be thrown
to indicate that the interceptor has detected an unauthorized access
attempt. If thrown, processing will stop and an HTTP 401 will be returned to the client.
public static final Pointcut SERVER_INCOMING_REQUEST_PRE_HANDLED
SERVER_INCOMING_REQUEST_POST_PROCESSED
are.
Hooks may accept the following parameters:
Hook methods must return void
Hook methods method may throw a subclass of BaseServerResponseException, and processing
will be aborted with an appropriate error returned to the client.
public static final Pointcut SERVER_PRE_PROCESS_OUTGOING_EXCEPTION
Search and Read methods) as well as
any runtime exceptions thrown by the server itself. This hook method is invoked for each interceptor (until one of them
returns a non-null response or the end of the list is reached), after which
SERVER_HANDLE_EXCEPTION is
called for each interceptor.
This may be used to add an OperationOutcome to a response, or to convert between exception types for any reason.
Implementations of this method may choose to ignore/log/count/etc exceptions, and return null. In
this case, processing will continue, and the server will automatically generate an OperationOutcome. Implementations may also choose to provide their own response to the client. In this case, they
should return a non-null, to indicate that they have handled the request and processing should stop.
Hooks may accept the following parameters:
BaseServerResponseException but will not necessarily be one (e.g. it could be a
NullPointerException in the case of a bug being triggered.
Hook methods may return a new exception to use for processing, or null if this interceptor is not trying to
modify the exception. For example, if this interceptor has nothing to do with exception processing, it
should always return null. If this interceptor adds an OperationOutcome to the exception, it
should return an exception.
public static final Pointcut SERVER_OUTGOING_RESPONSE
Hooks may accept the following parameters:
null for some responses.
Hook methods may return true or void if processing should continue normally.
This is generally the right thing to do. If your interceptor is providing a response rather than
letting HAPI handle the response normally, you must return false. In this case,
no further processing will occur and no further interceptors will be called.
Hook methods may also throw AuthenticationException to indicate that the interceptor
has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401
will be returned to the client.
public static final Pointcut SERVER_OUTGOING_GRAPHQL_RESPONSE
SERVER_OUTGOING_RESPONSE).
Hooks may accept the following parameters:
Hook methods may return true or void if processing should continue normally.
This is generally the right thing to do. If your interceptor is providing a response rather than
letting HAPI handle the response normally, you must return false. In this case,
no further processing will occur and no further interceptors will be called.
Hook methods may also throw AuthenticationException to indicate that the interceptor
has detected an unauthorized access attempt. If thrown, processing will stop and an HTTP 401
will be returned to the client.
public static final Pointcut SERVER_OUTGOING_FAILURE_OPERATIONOUTCOME
Hooks may accept the following parameters:
Hook methods must return void
public static final Pointcut SERVER_PROCESSING_COMPLETED_NORMALLY
Hooks may accept the following parameters:
This method must return void
This method should not throw any exceptions. Any exception that is thrown by this method will be logged, but otherwise not acted upon (i.e. even if a hook method throws an exception, processing will continue and other interceptors will be called). Therefore it is considered a bug to throw an exception from hook methods using this pointcut.
public static final Pointcut SERVER_PROCESSING_COMPLETED
SERVER_PROCESSING_COMPLETED_NORMALLY
in the case of successful operations.
Hooks may accept the following parameters:
This method must return void
This method should not throw any exceptions. Any exception that is thrown by this method will be logged, but otherwise not acted upon (i.e. even if a hook method throws an exception, processing will continue and other interceptors will be called). Therefore it is considered a bug to throw an exception from hook methods using this pointcut.
public static final Pointcut SUBSCRIPTION_RESOURCE_MODIFIED
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally. If the method
returns false, subscription processing will not proceed for the given resource;
public static final Pointcut SUBSCRIPTION_RESOURCE_MATCHED
Hooks may make changes to the delivery payload, or make changes to the canonical subscription such as adding headers, modifying the channel endpoint, etc.
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally. If the method
returns false, delivery will be aborted.
public static final Pointcut SUBSCRIPTION_RESOURCE_DID_NOT_MATCH_ANY_SUBSCRIPTIONS
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut SUBSCRIPTION_BEFORE_DELIVERY
SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY.
Hooks may make changes to the delivery payload, or make changes to the canonical subscription such as adding headers, modifying the channel endpoint, etc.
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally. If the method
returns false, processing will be aborted.
public static final Pointcut SUBSCRIPTION_AFTER_DELIVERY
SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut SUBSCRIPTION_AFTER_DELIVERY_FAILED
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally, meaning that
an exception will be thrown by the delivery mechanism. This typically means that the
message will be returned to the processing queue. If the method
returns false, processing will be aborted and no further action will be
taken for the delivery.
public static final Pointcut SUBSCRIPTION_AFTER_REST_HOOK_DELIVERY
When this hook is called, all processing is complete so this hook should not make any changes to the parameters.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut SUBSCRIPTION_BEFORE_REST_HOOK_DELIVERY
Hooks may make changes to the delivery payload, or make changes to the canonical subscription such as adding headers, modifying the channel endpoint, etc.
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally. If the method
returns false, processing will be aborted.
public static final Pointcut SUBSCRIPTION_BEFORE_PERSISTED_RESOURCE_CHECKED
Hooks may accept the following parameters:
Hooks may return void or may return a boolean. If the method returns
void or true, processing will continue normally. If the method
returns false, processing will be aborted.
public static final Pointcut SUBSCRIPTION_AFTER_PERSISTED_RESOURCE_CHECKED
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut SUBSCRIPTION_AFTER_ACTIVE_SUBSCRIPTION_REGISTERED
Hooks may make changes to the canonicalized subscription and this will have an effect on processing across this server. Note however that timing issues may occur, since the subscription is already technically live by the time this hook is called.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_CASCADE_DELETE
Hooks may accept the following parameters:
Hooks should return void. They may choose to throw an exception however, in
which case the delete should be rolled back.
public static final Pointcut STORAGE_PREACCESS_RESOURCES
This hook is invoked when a resource has been loaded by the storage engine and is being returned to the HTTP stack for response. This is not a guarantee that the client will ultimately see it, since filters/headers/etc may affect what is returned but if a resource is loaded it is likely to be used. Note also that caching may affect whether this pointcut is invoked.
Hooks will have access to the contents of the resource being returned and may choose to make modifications. These changes will be reflected in returned resource but have no effect on storage.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRECHECK_FOR_CACHED_SEARCH
Hooks may accept the following parameters:
Hooks may return boolean. If the hook method returns
false, the server will not attempt to check for a cached
search no matter what.
public static final Pointcut STORAGE_PRESEARCH_REGISTERED
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESHOW_RESOURCES
This hook is invoked when a resource has been loaded by the storage engine and is being returned to the HTTP stack for response. This is not a guarantee that the client will ultimately see it, since filters/headers/etc may affect what is returned but if a resource is loaded it is likely to be used. Note also that caching may affect whether this pointcut is invoked.
Hooks will have access to the contents of the resource being returned and may choose to make modifications. These changes will be reflected in returned resource but have no effect on storage.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESTORAGE_RESOURCE_CREATED
Hooks will have access to the contents of the resource being created and may choose to make modifications to it. These changes will be reflected in permanent storage.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESTORAGE_RESOURCE_UPDATED
Hooks will have access to the contents of the resource being updated (both the previous and new contents) and may choose to make modifications to the new contents of the resource. These changes will be reflected in permanent storage.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESTORAGE_RESOURCE_DELETED
Hooks will have access to the contents of the resource being created and may choose to make modifications to it. These changes will be reflected in permanent storage.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRECOMMIT_RESOURCE_CREATED
Hooks will have access to the contents of the resource being created but should generally not make any changes as storage has already occurred. Changes will not be reflected in storage, but may be reflected in the HTTP response.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRECOMMIT_RESOURCE_UPDATED
Hooks will have access to the contents of the resource being updated (both the previous and new contents) but should generally not make any changes as storage has already occurred. Changes will not be reflected in storage, but may be reflected in the HTTP response.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRECOMMIT_RESOURCE_DELETED
Hooks will have access to the contents of the resource being deleted but should not make any changes as storage has already occurred
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESTORAGE_DELETE_CONFLICTS
Hooks will have access to the list of resources that have references to the resource being deleted.
Hooks may accept the following parameters:
Hooks should return ca.uhn.fhir.jpa.delete.DeleteConflictOutcome.
If the interceptor returns a non-null result, the DeleteConflictOutcome can be
used to indicate a number of times to retry.
public static final Pointcut STORAGE_PRESTORAGE_EXPUNGE_RESOURCE
$expunge operation.
Hooks will be passed a reference to a counter containing the current number of records that have been deleted. If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut STORAGE_PRESTORAGE_EXPUNGE_EVERYTHING
Hooks will be passed a reference to a counter containing the current number of records that have been deleted. If the hook deletes any records, the hook is expected to increment this counter by the number of records deleted.
Hooks may accept the following parameters:Hooks should return void.
public static final Pointcut JPA_PERFTRACE_INFO
This hook is invoked when any informational messages generated by the SearchCoordinator are created. It is typically used to provide logging or capture details related to a specific request.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_WARNING
This hook is invoked when any warning messages generated by the SearchCoordinator are created. It is typically used to provide logging or capture details related to a specific request.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_FIRST_RESULT_LOADED
This hook is invoked when a search has returned the very first result from the database. The timing on this call can be a good indicator of how performant a query is in general.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_SELECT_COMPLETE
This hook is invoked when an individual search query SQL SELECT statement has completed and no more results are available from that query. Note that this doesn't necessarily mean that no more matching results exist in the database, since HAPI FHIR JPA batch loads results in to the query cache in chunks in order to provide predicable results without overloading memory or the database.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_FAILED
This hook is invoked when a search has failed for any reason. When this pointcut is invoked, the search has completed unsuccessfully and will not be continued.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_PASS_COMPLETE
This hook is invoked when a search has failed for any reason. When this pointcut is invoked, a pass in the Search Coordinator has completed successfully, but not all possible resources have been loaded yet so a future paging request may trigger a new task that will load further resources.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_REUSING_CACHED
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_SEARCH_COMPLETE
This hook is invoked when a search has failed for any reason. When this pointcut is invoked, a pass in the Search Coordinator has completed successfully, and all possible results have been fetched and loaded into the query cache.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut JPA_PERFTRACE_RAW_SQL
This hook is invoked when a query has executed, and includes the raw SQL statements that were executed against the database.
Hooks may accept the following parameters:
Hooks should return void.
public static final Pointcut TEST_RB
public static Pointcut[] values()
for (Pointcut c : Pointcut.values()) System.out.println(c);
public static Pointcut valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isShouldLogAndSwallowException(@Nonnull Throwable theException)
@Nonnull public Class<?> getReturnType()
@Nonnull public List<String> getParameterTypes()
Copyright © 2014–2019 University Health Network. All rights reserved.