diff --git a/distribution/src/main/feature/feature.xml b/distribution/src/main/feature/feature.xml index 390ab3fd4..2b654d1df 100644 --- a/distribution/src/main/feature/feature.xml +++ b/distribution/src/main/feature/feature.xml @@ -29,16 +29,17 @@ unomi-elasticsearch-core unomi-persistence-core unomi-services - unomi-rest-api - unomi-cxs-lists-extension - unomi-cxs-geonames-extension - unomi-cxs-privacy-extension - unomi-elasticsearch-conditions - unomi-plugins-advanced-conditions + unomi-cxs-privacy-extension-services unomi-plugins-base unomi-plugins-request unomi-plugins-mail unomi-plugins-optimization-test + unomi-rest-api + unomi-cxs-privacy-extension + unomi-elasticsearch-conditions + unomi-plugins-advanced-conditions + unomi-cxs-lists-extension + unomi-cxs-geonames-extension unomi-shell-dev-commands unomi-wab unomi-web-tracker @@ -55,16 +56,17 @@ unomi-elasticsearch-core unomi-persistence-core unomi-services - unomi-rest-api - unomi-cxs-lists-extension - unomi-cxs-geonames-extension - unomi-cxs-privacy-extension - unomi-elasticsearch-conditions - unomi-plugins-advanced-conditions + unomi-cxs-privacy-extension-services unomi-plugins-base unomi-plugins-request unomi-plugins-mail unomi-plugins-optimization-test + unomi-rest-api + unomi-cxs-privacy-extension + unomi-elasticsearch-conditions + unomi-plugins-advanced-conditions + unomi-cxs-lists-extension + unomi-cxs-geonames-extension unomi-shell-dev-commands unomi-wab unomi-web-tracker @@ -82,16 +84,17 @@ unomi-opensearch-core unomi-persistence-core unomi-services - unomi-rest-api - unomi-cxs-lists-extension - unomi-cxs-geonames-extension - unomi-cxs-privacy-extension - unomi-opensearch-conditions - unomi-plugins-advanced-conditions + unomi-cxs-privacy-extension-services unomi-plugins-base unomi-plugins-request unomi-plugins-mail unomi-plugins-optimization-test + unomi-rest-api + unomi-cxs-privacy-extension + unomi-opensearch-conditions + unomi-plugins-advanced-conditions + unomi-cxs-lists-extension + unomi-cxs-geonames-extension unomi-shell-dev-commands unomi-wab unomi-web-tracker @@ -108,16 +111,17 @@ unomi-opensearch-core unomi-persistence-core unomi-services - unomi-rest-api - unomi-cxs-lists-extension - unomi-cxs-geonames-extension - unomi-cxs-privacy-extension - unomi-opensearch-conditions - unomi-plugins-advanced-conditions + unomi-cxs-privacy-extension-services unomi-plugins-base unomi-plugins-request unomi-plugins-mail unomi-plugins-optimization-test + unomi-rest-api + unomi-cxs-privacy-extension + unomi-opensearch-conditions + unomi-plugins-advanced-conditions + unomi-cxs-lists-extension + unomi-cxs-geonames-extension unomi-shell-dev-commands unomi-wab unomi-web-tracker diff --git a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java index f8f3803b0..4b8535d27 100644 --- a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java +++ b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java @@ -17,7 +17,6 @@ package org.apache.unomi.groovy.actions; import groovy.lang.Script; - import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.nio.charset.StandardCharsets; @@ -29,9 +28,12 @@ * This class encapsulates all metadata associated with a compiled Groovy script, * including content hash for efficient change detection and the compiled class * for direct execution without recompilation. + *

+ * *

* Thread Safety: This class is immutable and thread-safe. All fields are final * and the class provides no methods to modify its state after construction. + *

* * @since 2.7.0 */ @@ -90,6 +92,7 @@ private String calculateHash(String content) { *

* This method uses SHA-256 hash comparison for efficient change detection * without storing or comparing the full script content. + *

* * @param newContent the new script content to compare against * @return {@code true} if content has changed, {@code false} if unchanged @@ -143,10 +146,11 @@ public long getCreationTime() { *

* This class can be used to create new script instances for execution * without requiring recompilation. + *

* * @return the compiled script class, never null */ public Class getCompiledClass() { return compiledClass; } -} \ No newline at end of file +} diff --git a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java index 4f74528bb..ab15fbc47 100644 --- a/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java +++ b/extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/services/GroovyActionsService.java @@ -27,17 +27,23 @@ * This service provides functionality to load, compile, cache, and execute * Groovy scripts as actions within the Apache Unomi framework. It implements * optimized compilation and caching strategies to achieve high performance. + *

+ * *

* Key features: + *

* + * *

* Thread Safety: Implementations must be thread-safe as this service * is accessed concurrently during script execution. + *

+ * * @see GroovyAction * @see ScriptMetadata * @since 2.7.0 @@ -50,6 +56,8 @@ public interface GroovyActionsService { * This method compiles the script, validates it has the required * annotations, persists it, and updates the internal cache. * If the script content hasn't changed, recompilation is skipped. + *

+ * * @param actionName the unique identifier for the action * @param groovyScript the Groovy script source code * @throws IllegalArgumentException if actionName or groovyScript is null @@ -62,6 +70,8 @@ public interface GroovyActionsService { *

* This method removes the action from both the cache and persistent storage, * and cleans up any registered action types in the definitions service. + *

+ * * @param actionName the unique identifier of the action to remove * @throws IllegalArgumentException if id is null */ @@ -73,6 +83,8 @@ public interface GroovyActionsService { * This is the preferred method for script execution as it returns * pre-compiled classes without any compilation overhead. Returns * {@code null} if the script is not found in the cache. + *

+ * * @param actionName the unique identifier of the action * @return the compiled script class, or {@code null} if not found in cache * @throws IllegalArgumentException if id is null @@ -85,6 +97,8 @@ public interface GroovyActionsService { * The returned metadata includes content hash, compilation timestamp, * and the compiled class reference. This is useful for monitoring * tools and debugging. + *

+ * * @param actionName the unique identifier of the action * @return the script metadata, or {@code null} if not found * @throws IllegalArgumentException if actionName is null diff --git a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java index 1c656d1de..122488c03 100644 --- a/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java +++ b/extensions/lists-extension/services/src/main/java/org/apache/unomi/services/UserListServiceImpl.java @@ -59,7 +59,9 @@ public PartialList getListMetadatas(Query query) { if (query.isForceRefresh()) { persistenceService.refreshIndex(UserList.class); } - definitionsService.resolveConditionType(query.getCondition()); + if (query.getCondition() != null) { + definitionsService.getConditionValidationService().validate(query.getCondition()); + } PartialList userLists = persistenceService.query(query.getCondition(), query.getSortby(), UserList.class, query.getOffset(), query.getLimit()); List metadata = new LinkedList<>(); for (UserList definition : userLists.getList()) {