sergehuber commented on code in PR #720:
URL: https://github.com/apache/unomi/pull/720#discussion_r2216018173


##########
extensions/groovy-actions/services/src/main/java/org/apache/unomi/groovy/actions/ScriptMetadata.java:
##########
@@ -0,0 +1,156 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.unomi.groovy.actions;
+
+import groovy.lang.Script;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+
+/**
+ * Metadata container for compiled Groovy scripts with hash-based change 
detection.
+ * <p>
+ * 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 {
+    private final String actionName;
+    private final String scriptContent;
+    private final String contentHash;
+    private final long lastModified;

Review Comment:
   This was a good catch, I have also corrected it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to