This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/unomi.git
The following commit(s) were added to refs/heads/master by this push:
new 4c182831f UNOMI-906: Fix javadoc tags and new lines. (#728)
4c182831f is described below
commit 4c182831fe0ebf80fbf67246f4f20a4acce65513
Author: Jérôme Blanchard <[email protected]>
AuthorDate: Tue Sep 2 14:07:52 2025 +0200
UNOMI-906: Fix javadoc tags and new lines. (#728)
* UNOMI-906: Fix javadoc tags and new lines.
* UNOMI-906: Restore missed commit content.
---
.../unomi/groovy/actions/ScriptMetadata.java | 64 ++++++++++------------
.../actions/services/GroovyActionsService.java | 9 ---
.../shell/migration/utils/MigrationUtils.java | 12 ++--
3 files changed, 36 insertions(+), 49 deletions(-)
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 57b44e3ae..4756d97cd 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
@@ -28,13 +28,10 @@ import java.util.Base64;
* 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.
- * </p>
- *
* <p>
* 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.
- * </p>
- *
+ *
* @since 2.7.0
*/
public final class ScriptMetadata {
@@ -43,10 +40,10 @@ public final class ScriptMetadata {
private final String contentHash;
private final long creationTime;
private final Class<? extends Script> compiledClass;
-
+
/**
* Constructs a new ScriptMetadata instance.
- *
+ *
* @param actionName the unique name/identifier of the action
* @param scriptContent the raw Groovy script content
* @param compiledClass the compiled Groovy script class
@@ -62,17 +59,17 @@ public final class ScriptMetadata {
if (compiledClass == null) {
throw new IllegalArgumentException("Compiled class cannot be
null");
}
-
+
this.actionName = actionName;
this.scriptContent = scriptContent;
this.contentHash = calculateHash(scriptContent);
this.creationTime = System.currentTimeMillis();
this.compiledClass = compiledClass;
}
-
+
/**
* Calculates SHA-256 hash of the given content.
- *
+ *
* @param content the content to hash
* @return Base64 encoded SHA-256 hash
* @throws RuntimeException if SHA-256 algorithm is not available
@@ -86,14 +83,13 @@ public final class ScriptMetadata {
throw new RuntimeException("SHA-256 algorithm not available", e);
}
}
-
+
/**
* Determines if the script content has changed compared to new content.
* <p>
* This method uses SHA-256 hash comparison for efficient change detection
* without storing or comparing the full script content.
- * </p>
- *
+ *
* @param newContent the new script content to compare against
* @return {@code true} if content has changed, {@code false} if unchanged
* @throws IllegalArgumentException if newContent is null
@@ -104,53 +100,53 @@ public final class ScriptMetadata {
}
return !contentHash.equals(calculateHash(newContent));
}
-
+
/**
* Returns the action name/identifier.
- *
+ *
* @return the action name, never null
*/
- public String getActionName() {
- return actionName;
+ public String getActionName() {
+ return actionName;
}
-
+
/**
* Returns the original script content.
- *
+ *
* @return the script content, never null
*/
- public String getScriptContent() {
- return scriptContent;
+ public String getScriptContent() {
+ return scriptContent;
}
-
+
/**
* Returns the SHA-256 hash of the script content.
- *
+ *
* @return Base64 encoded content hash, never null
*/
- public String getContentHash() {
- return contentHash;
+ public String getContentHash() {
+ return contentHash;
}
-
+
/**
* Returns the timestamp when this metadata was created.
- *
+ *
* @return creation timestamp in milliseconds since epoch
*/
- public long getCreationTime() {
- return creationTime;
+ public long getCreationTime() {
+ return creationTime;
}
-
+
/**
* Returns the compiled Groovy script class.
* <p>
* This class can be used to create new script instances for execution
* without requiring recompilation.
- * </p>
- *
+ *
+ *
* @return the compiled script class, never null
*/
- public Class<? extends Script> getCompiledClass() {
- return compiledClass;
+ public Class<? extends Script> 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 1b4bf14be..ed2c2f213 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,8 +27,6 @@ import org.apache.unomi.groovy.actions.ScriptMetadata;
* 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.
- * </p>
- *
* <p>
* Key features:
* <ul>
@@ -37,12 +35,9 @@ import org.apache.unomi.groovy.actions.ScriptMetadata;
* <li>Thread-safe compilation and execution</li>
* <li>Unified caching architecture for compiled scripts</li>
* </ul>
- * </p>
- *
* <p>
* Thread Safety: Implementations must be thread-safe as this service
* is accessed concurrently during script execution.
- * </p>
*
* @see GroovyAction
* @see ScriptMetadata
@@ -56,7 +51,6 @@ 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.
- * </p>
*
* @param actionName the unique identifier for the action
* @param groovyScript the Groovy script source code
@@ -70,7 +64,6 @@ public interface GroovyActionsService {
* <p>
* This method removes the action from both the cache and persistent
storage,
* and cleans up any registered action types in the definitions service.
- * </p>
*
* @param actionName the unique identifier of the action to remove
* @throws IllegalArgumentException if id is null
@@ -83,7 +76,6 @@ 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.
- * </p>
*
* @param actionName the unique identifier of the action
* @return the compiled script class, or {@code null} if not found in cache
@@ -97,7 +89,6 @@ public interface GroovyActionsService {
* The returned metadata includes content hash, compilation timestamp,
* and the compiled class reference. This is useful for monitoring
* tools and debugging.
- * </p>
*
* @param actionName the unique identifier of the action
* @return the script metadata, or {@code null} if not found
diff --git
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
index 53cc90a94..4f2fc21c8 100644
---
a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
+++
b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/utils/MigrationUtils.java
@@ -313,9 +313,9 @@ public class MigrationUtils {
/**
* Updates documents in an index based on a specified query.
- *
- * <p>This method sends a request to update documents that match the
provided query in the specified index. The update operation is
- * performed asynchronously, and the method waits for the task to complete
before returning.</p>
+ * <p>
+ * This method sends a request to update documents that match the provided
query in the specified index. The update operation is
+ * performed asynchronously, and the method waits for the task to complete
before returning.
*
* @param httpClient the CloseableHttpClient used to send the request to
the Elasticsearch server
* @param esAddress the address of the Elasticsearch server
@@ -332,10 +332,10 @@ public class MigrationUtils {
/**
* Deletes documents from an index based on a specified query.
- *
- * <p>This method sends a request to the Elasticsearch cluster to delete
documents
+ * <p>
+ * This method sends a request to the Elasticsearch cluster to delete
documents
* that match the provided query in the specified index. The deletion
operation is
- * performed asynchronously, and the method waits for the task to complete
before returning.</p>
+ * performed asynchronously, and the method waits for the task to complete
before returning.
*
* @param httpClient the CloseableHttpClient used to send the request to
the Elasticsearch server
* @param esAddress the address of the Elasticsearch server