module documentation

InterceptorManager class for managing interceptors.

Class Interceptor Base class for interceptors. Interceptors are classes that can define methods decorated with @intercept to intercept requests at different phases (e.g. pre-processing, post-processing) and for different operations and resource types.
Class InterceptorHandlerInfo Data class to hold information about an interceptor handler method.
Class InterceptorManager Manager for interceptors. This class is responsible for registering interceptors and calling the appropriate interceptor handlers when a request is processed by the CSE. It maintains a registry of all interceptor handlers and their metadata, and uses this registry to find and call the appropriate handlers for each request.
Class Phase Enumeration of interception phases.
Function intercept Decorator to mark a method as an interceptor handler. The decorated method will be registered with the InterceptorManager when the interceptor class is instantiated.
Type Alias InterceptorFilter A tuple of (phase, operation, resource) to filter interceptor handlers. Each element can be a specific value or None to match all. This is used as a key for caching interceptor handler lookups in the InterceptorManager.
Variable interceptorManager The global interceptor manager instance. This is a singleton instance.
Variable interceptorPluginMapping Maps interceptor handler functions to their plugin names for management purposes.
def intercept(phase: Phase | list[Phase] | None = Phase.ALL, operation: Operation | list[Operation] | None = Operation.ALL, resource: ResourceTypes | list[ResourceTypes] | None = ResourceTypes.ALL, priority: int | None = 50) -> Callable:

Decorator to mark a method as an interceptor handler. The decorated method will be registered with the InterceptorManager when the interceptor class is instantiated.

Parameters
phase:Phase | list[Phase] | NoneThe phase at which to intercept (pre, post, or all).
operation:Operation | list[Operation] | NoneThe operation to intercept (create, retrieve, update, delete, notify, discovery, or all).
resource:ResourceTypes | list[ResourceTypes] | NoneThe resource type to intercept (e.g. container, contentInstance, etc. or all).
priority:int | NoneThe priority of the interceptor handler (lower numbers are executed first). Default is 50.
Returns
CallableA decorator function that marks the method as an interceptor handler with the specified metadata.
InterceptorFilter =

A tuple of (phase, operation, resource) to filter interceptor handlers. Each element can be a specific value or None to match all. This is used as a key for caching interceptor handler lookups in the InterceptorManager.

Value
tuple[Phase | None, Operation | None, ResourceTypes | None]
interceptorManager: InterceptorManager =

The global interceptor manager instance. This is a singleton instance.

interceptorPluginMapping: dict[Callable, str] =

Maps interceptor handler functions to their plugin names for management purposes.