Package io.camunda.migrator.config
Class InterceptorConfiguration
java.lang.Object
io.camunda.migrator.config.InterceptorConfiguration
Configuration class for managing interceptors from both Spring context and config data files.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.springframework.context.ApplicationContextprotected MigratorProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> voidapplyProperties(T target, Map<String, Object> sourceMap, boolean ignoreUnknownFields) Creates a composite list of variable interceptors from both Spring context and config data files.protected VariableInterceptorcreateInterceptorInstance(InterceptorProperty interceptorProperty) Creates a variable interceptor instance from the configuration.protected VariableInterceptorfindExistingInterceptor(List<VariableInterceptor> contextInterceptors, String className) Finds an existing interceptor in the context by class name.protected voidhandleInterceptorDisable(List<VariableInterceptor> contextInterceptors, InterceptorProperty interceptorConfig) Handles disabling any interceptor (built-in, programmatically, or declarative) by removing it from the context.protected voidprocessUnifiedInterceptorConfiguration(List<VariableInterceptor> contextInterceptors, List<InterceptorProperty> interceptorConfigs) Processes unified interceptor configuration that supports both custom interceptors and property-based configuration including the enabled property.protected voidregisterCustomInterceptor(List<VariableInterceptor> contextInterceptors, InterceptorProperty interceptorConfig) Registers a custom interceptor from configuration.
-
Field Details
-
context
@Autowired protected org.springframework.context.ApplicationContext context -
migratorProperties
-
-
Constructor Details
-
InterceptorConfiguration
public InterceptorConfiguration()
-
-
Method Details
-
configuredVariableInterceptors
Creates a composite list of variable interceptors from both Spring context and config data files.- Returns:
- List of configured variable interceptors
-
processUnifiedInterceptorConfiguration
protected void processUnifiedInterceptorConfiguration(List<VariableInterceptor> contextInterceptors, List<InterceptorProperty> interceptorConfigs) Processes unified interceptor configuration that supports both custom interceptors and property-based configuration including the enabled property.- Parameters:
contextInterceptors- List of interceptors discovered from Spring contextinterceptorConfigs- List of interceptor configurations from config files
-
findExistingInterceptor
protected VariableInterceptor findExistingInterceptor(List<VariableInterceptor> contextInterceptors, String className) Finds an existing interceptor in the context by class name.- Parameters:
contextInterceptors- List of interceptors in contextclassName- Class name to search for- Returns:
- The interceptor if found, null otherwise
-
handleInterceptorDisable
protected void handleInterceptorDisable(List<VariableInterceptor> contextInterceptors, InterceptorProperty interceptorConfig) Handles disabling any interceptor (built-in, programmatically, or declarative) by removing it from the context.- Parameters:
contextInterceptors- List of context interceptors to modifyinterceptorConfig- Configuration for the interceptor to disable
-
registerCustomInterceptor
protected void registerCustomInterceptor(List<VariableInterceptor> contextInterceptors, InterceptorProperty interceptorConfig) Registers a custom interceptor from configuration.- Parameters:
contextInterceptors- List of interceptors to add tointerceptorConfig- Configuration for the custom interceptor
-
createInterceptorInstance
protected VariableInterceptor createInterceptorInstance(InterceptorProperty interceptorProperty) throws Exception Creates a variable interceptor instance from the configuration.- Parameters:
interceptorProperty- Interceptor configuration- Returns:
- VariableInterceptor instance
- Throws:
Exception- if instantiation fails
-
applyProperties
-
byteArrayVariableValidator
-
dateVariableTransformer
-
fileVariableValidator
-
nullVariableTransformer
-
objectJavaVariableValidator
-
objectJsonVariableTransformer
-
objectXmlVariableTransformer
-
primitiveVariableTransformer
-
spinJsonVariableTransformer
-
spinXmlVariableTransformer
-