Joaquín Reñé
2025-10-07 146a0fb8b0e90f9196e569152f649baf60d6cc8f
securis/src/main/java/net/curisit/securis/FreeLicenseGenerator.java
....@@ -1,3 +1,6 @@
1
+/*
2
+ * Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
3
+ */
14 package net.curisit.securis;
25
36 import java.util.Date;
....@@ -9,10 +12,31 @@
912 import net.curisit.securis.beans.SignedLicenseBean;
1013 import net.curisit.securis.utils.JsonUtils;
1114
15
+/**
16
+* FreeLicenseGenerator
17
+* <p>
18
+* Helper to generate a signed FREE license (no expiration) for a given app and code.
19
+*
20
+* @author JRA
21
+ * Last reviewed by JRA on Oct 5, 2025.
22
+*/
1223 public class FreeLicenseGenerator {
1324
25
+ /** Constant license type code for FREE licenses. */
1426 public static final String FREE_LICENSE_TYPE = "FREE";
1527
28
+ /**
29
+ * generateLicense
30
+ * <p>
31
+ * Build and sign a FREE license using the default generator. Uses a <code>Date(-1)</code>
32
+ * sentinel as "no expiration".
33
+ *
34
+ * @param appName application name
35
+ * @param licCode license code
36
+ * @param metadata additional metadata to embed
37
+ * @return signed license bean wrapper
38
+ * @throws SeCurisException on generation/signature errors
39
+ */
1640 public static SignedLicenseBean generateLicense(String appName, String licCode, Map<String, Object> metadata) throws SeCurisException {
1741 SignedLicenseBean sl = null;
1842 RequestBean rb = new RequestBean();
....@@ -24,6 +48,13 @@
2448 return sl;
2549 }
2650
51
+
52
+ /**
53
+ * Demo main
54
+ *
55
+ * @param args
56
+ * @throws SeCurisException
57
+ */
2758 public static void main(String[] args) throws SeCurisException {
2859 Map<String, Object> metadata = new HashMap<>();
2960 metadata.put("max_docs", 2000);