From d7a7c981b4c0ff93f53198ad953be82aa5e71893 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 5 Feb 2024 14:39:44 +0100 Subject: [PATCH 01/19] fix openjdk 17 --- docker/cygnus-ngsi/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docker/cygnus-ngsi/Dockerfile b/docker/cygnus-ngsi/Dockerfile index 577c3b853..647f5012e 100644 --- a/docker/cygnus-ngsi/Dockerfile +++ b/docker/cygnus-ngsi/Dockerfile @@ -272,11 +272,12 @@ RUN \ # Debian 12 comes with Java 17 but we have found some problems with it (see https://github.com/telefonicaid/fiware-cygnus/issues/2297) # so we "downgrade" to Java 11 apt-get -y install curl git python3 && \ - curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ - curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb && \ - curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb && \ - curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb && \ - apt-get -y install ./openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ + # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ + # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb && \ + # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb && \ + # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb && \ + # apt-get -y install ./openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ + apt-get -y install openjdk-17-jdk openjdk-17-jdk-headless openjdk-17-jre openjdk-17-jre-headless && \ apt-get -y install maven && \ # Add Cygnus user adduser ${CYGNUS_USER} && \ From e216ff5f8fb9095eab46ecb73fef88f930ff070f Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Mon, 5 Feb 2024 14:53:27 +0100 Subject: [PATCH 02/19] fix jdk 17 --- docker/cygnus-ngsi/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/cygnus-ngsi/Dockerfile b/docker/cygnus-ngsi/Dockerfile index 647f5012e..69c1fcb4b 100644 --- a/docker/cygnus-ngsi/Dockerfile +++ b/docker/cygnus-ngsi/Dockerfile @@ -256,7 +256,7 @@ ENV FLUME_HOME "/opt/apache-flume" ENV FLUME_TGZ "apache-flume-${FLUME_VER}-bin.tar.gz" ENV FLUME_URL "https://archive.apache.org/dist/flume/${FLUME_VER}/${FLUME_TGZ}" -ENV JAVA_VERSION "1.11.0" +ENV JAVA_VERSION "1.17.0" COPY / ${CYGNUS_HOME} From 0309d3092264975512bad12c40b208410139e1c5 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 09:36:52 +0100 Subject: [PATCH 03/19] fix errors to upgrade to jdk 17 --- CHANGES_NEXT_RELEASE | 3 ++- .../management/NameMappingsHandlers.java | 9 +++++++-- .../management/SubscriptionsHandlers.java | 15 +++++++++++--- cygnus-ngsi/pom.xml | 2 +- .../iot/cygnus/handlers/NGSIRestHandler.java | 7 +++++-- .../NGSINameMappingsInterceptor.java | 7 ++++++- .../iot/cygnus/sinks/NGSIKafkaSink.java | 7 ++++++- .../telefonica/iot/cygnus/sinks/NGSISink.java | 7 ++++++- .../iot/cygnus/utils/NGSIUtilsForTests.java | 20 +++++++++++++++---- docker/cygnus-ngsi/Dockerfile | 7 ------- 10 files changed, 61 insertions(+), 23 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 8b1378917..6c5945a82 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1 +1,2 @@ - +- [cygnus-common][cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 +- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.1 to 1.17 in Dockerfile (#2297,#2304) diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/NameMappingsHandlers.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/NameMappingsHandlers.java index 2dfdfbcdb..433e38748 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/NameMappingsHandlers.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/NameMappingsHandlers.java @@ -28,13 +28,16 @@ import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; +import java.util.regex.Pattern; +import com.google.gson.GsonBuilder; /** * * @author frb */ public final class NameMappingsHandlers { - + private static final CygnusLogger LOGGER = new CygnusLogger(NameMappingsHandlers.class); /** @@ -69,7 +72,9 @@ private static NameMappings parseNameMappings(String jsonStr) { } // if // Parse the Json string - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); try { nameMappings = gson.fromJson(jsonStr, NameMappings.class); diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/SubscriptionsHandlers.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/SubscriptionsHandlers.java index 6ca598026..cd5156793 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/SubscriptionsHandlers.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/SubscriptionsHandlers.java @@ -18,6 +18,7 @@ package com.telefonica.iot.cygnus.management; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonSyntaxException; import com.telefonica.iot.cygnus.backends.http.JsonResponse; import com.telefonica.iot.cygnus.backends.orion.OrionBackendImpl; @@ -26,8 +27,10 @@ import com.telefonica.iot.cygnus.containers.OrionEndpoint; import com.telefonica.iot.cygnus.log.CygnusLogger; import com.telefonica.iot.cygnus.utils.CommonConstants; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import java.io.BufferedReader; import java.io.IOException; +import java.util.regex.Pattern; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.simple.JSONObject; @@ -117,7 +120,9 @@ public static void get(HttpServletRequest request, HttpServletResponse response) // Get the endpoint string and parse it String endpointStr = readPayload(request); - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); OrionEndpoint endpoint; try { @@ -276,7 +281,9 @@ public static void post(HttpServletRequest request, HttpServletResponse response private static void postV1(String payload, String fiwareService, String fiwareServicePath, HttpServletResponse response) throws IOException { // Parse the payload - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); CygnusSubscriptionV1 cygnusSubscriptionv1; try { @@ -341,7 +348,9 @@ private static void postV1(String payload, String fiwareService, String fiwareSe private static void postV2(String payload, String fiwareService, String fiwareServicePath, HttpServletResponse response) throws IOException { // Parse the payload - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); CygnusSubscriptionV2 cygnusSubscriptionv2; try { diff --git a/cygnus-ngsi/pom.xml b/cygnus-ngsi/pom.xml index e9180d9a9..ff59622ad 100644 --- a/cygnus-ngsi/pom.xml +++ b/cygnus-ngsi/pom.xml @@ -20,7 +20,7 @@ org.mockito mockito-core - 5.5.0 + 5.10.0 test diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java index defd98c49..fc88794d7 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java @@ -35,8 +35,9 @@ import java.util.List; import java.util.Locale; import java.util.Map; - +import java.util.regex.Pattern; import com.telefonica.iot.cygnus.utils.NotifyContextRequestNGSIv2Deserializer; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import org.apache.flume.Context; import org.apache.flume.Event; import org.apache.flume.source.http.HTTPBadRequestException; @@ -329,7 +330,9 @@ public List getEvents(javax.servlet.http.HttpServletRequest request) thro // Parse the original data into a NotifyContextRequest object NotifyContextRequest ncr = null; NotifyContextRequestNGSIv2 notifyContextRequestNGSIv2 = null; - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); try { if (ngsiVersion != null) { diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/interceptors/NGSINameMappingsInterceptor.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/interceptors/NGSINameMappingsInterceptor.java index 2d1366864..3262c7178 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/interceptors/NGSINameMappingsInterceptor.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/interceptors/NGSINameMappingsInterceptor.java @@ -18,6 +18,7 @@ package com.telefonica.iot.cygnus.interceptors; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonIOException; import com.google.gson.JsonSyntaxException; import com.telefonica.iot.cygnus.containers.NameMappings; @@ -31,6 +32,7 @@ import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.JsonUtils; import com.telefonica.iot.cygnus.utils.NGSIConstants; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import java.io.File; import java.util.ArrayList; import java.util.List; @@ -42,6 +44,7 @@ import org.apache.logging.log4j.ThreadContext; import java.util.UUID; +import java.util.regex.Pattern; /** * @@ -272,7 +275,9 @@ protected void loadNameMappings(String jsonStr) { } // if // Parse the Json string - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); try { nameMappings = gson.fromJson(jsonStr, NameMappings.class); diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIKafkaSink.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIKafkaSink.java index d54771eae..333925b43 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIKafkaSink.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIKafkaSink.java @@ -18,6 +18,7 @@ package com.telefonica.iot.cygnus.sinks; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.telefonica.iot.cygnus.backends.kafka.KafkaBackendImpl; import com.telefonica.iot.cygnus.containers.NotifyContextRequest.ContextElement; import com.telefonica.iot.cygnus.errors.CygnusBadConfiguration; @@ -29,7 +30,9 @@ import com.telefonica.iot.cygnus.log.CygnusLogger; import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.NGSICharsets; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import java.util.ArrayList; +import java.util.regex.Pattern; import org.I0Itec.zkclient.ZkClient; import org.apache.flume.Context; import org.apache.kafka.clients.producer.ProducerRecord; @@ -325,7 +328,9 @@ private String buildMessage(ContextElement contextElement, String fiwareService, String message = "{\"headers\":[{\"fiware-service\":\"" + fiwareService + "\"}," + "{\"fiware-servicePath\":\"" + fiwareServicePath + "\"}," + "{\"timestamp\":" + recvTimeTs + "}" + "],\"body\":"; - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); String contextElementResponseStr = gson.toJson(contextElement); message += contextElementResponseStr + "}"; return message; diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java index 27651f56b..f0e59b823 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSISink.java @@ -19,6 +19,7 @@ package com.telefonica.iot.cygnus.sinks; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.telefonica.iot.cygnus.containers.NotifyContextRequest.ContextAttribute; import com.telefonica.iot.cygnus.containers.NotifyContextRequest.ContextElement; import com.telefonica.iot.cygnus.errors.CygnusBadConfiguration; @@ -45,9 +46,11 @@ import java.util.Map; import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.NGSIConstants; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; +import java.util.regex.Pattern; import org.apache.flume.Channel; import org.apache.flume.Context; import org.apache.flume.Event; @@ -537,7 +540,9 @@ private Status processNewBatches() { } else { // Event comes from file... original and mapped context elements must be re-created String[] contextElementsStr = (new String(event.getBody())).split(CommonConstants.CONCATENATOR); - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); ContextElement originalCE = null; ContextElement mappedCE = null; diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java index e6e89a9d5..0f6b0b00f 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java @@ -25,6 +25,9 @@ import com.telefonica.iot.cygnus.containers.NameMappings; import com.telefonica.iot.cygnus.containers.NotifyContextRequest; import com.telefonica.iot.cygnus.interceptors.NGSIEvent; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; +import java.util.regex.Pattern; +import com.google.gson.GsonBuilder; /** * @@ -122,7 +125,10 @@ public static Context createContextForArcGis(String url, String username, * @throws java.lang.Exception */ public static NotifyContextRequest createJsonNotifyContextRequest(String jsonStr) throws Exception { - Gson gson = new Gson(); + // Parse the Json string + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NotifyContextRequest.class); } // createJsonNotifyContextRequest @@ -133,7 +139,9 @@ public static NotifyContextRequest createJsonNotifyContextRequest(String jsonStr * @throws java.lang.Exception */ public static NotifyContextRequest.StatusCode createJsonStatusCode(String jsonStr) throws Exception { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NotifyContextRequest.StatusCode.class); } // createJsonStatusCode @@ -166,7 +174,9 @@ public static NGSIEvent createNGSIEvent(String originalCEStr, String mappedCEStr * @throws java.lang.Exception */ public static NameMappings createJsonNameMappings(String jsonStr) throws Exception { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NameMappings.class); } // createJsonNameMappings @@ -193,7 +203,9 @@ public static NGSIEvent createInterceptedNGSIEvent(String originalCEStr, String * @throws java.lang.Exception */ public static NotifyContextRequest.ContextElement createJsonContextElement(String jsonStr) throws Exception { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NotifyContextRequest.ContextElement.class); } // createJsonContextElement diff --git a/docker/cygnus-ngsi/Dockerfile b/docker/cygnus-ngsi/Dockerfile index 69c1fcb4b..cf30c7d26 100644 --- a/docker/cygnus-ngsi/Dockerfile +++ b/docker/cygnus-ngsi/Dockerfile @@ -269,14 +269,7 @@ RUN \ apt-get -y update && \ apt-get -y upgrade && \ # Install dependencies - # Debian 12 comes with Java 17 but we have found some problems with it (see https://github.com/telefonicaid/fiware-cygnus/issues/2297) - # so we "downgrade" to Java 11 apt-get -y install curl git python3 && \ - # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ - # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb && \ - # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb && \ - # curl -s --insecure -L 'http://security.debian.org/debian-security/pool/updates/main/o/openjdk-11/openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb' > openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb && \ - # apt-get -y install ./openjdk-11-jre-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jre_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk-headless_11.0.22+7-1~deb11u1_amd64.deb ./openjdk-11-jdk_11.0.22+7-1~deb11u1_amd64.deb && \ apt-get -y install openjdk-17-jdk openjdk-17-jdk-headless openjdk-17-jre openjdk-17-jre-headless && \ apt-get -y install maven && \ # Add Cygnus user From 24b25d8b3632e4a147a79cc75f2e21d49284dec6 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 09:46:59 +0100 Subject: [PATCH 04/19] add missed file --- .../cygnus/management/PatternTypeAdapter.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java new file mode 100644 index 000000000..21b6d8f42 --- /dev/null +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java @@ -0,0 +1,26 @@ +package com.telefonica.iot.cygnus.management; + +import com.google.gson.TypeAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +import java.io.IOException; +import java.util.regex.Pattern; + +public class PatternTypeAdapter extends TypeAdapter { + + @Override + public void write(JsonWriter out, Pattern pattern) throws IOException { + if (pattern == null) { + out.nullValue(); + return; + } + out.value(pattern.pattern()); + } + + @Override + public Pattern read(JsonReader in) throws IOException { + String patternString = in.nextString(); + return Pattern.compile(patternString); + } +} From 6c46386765aba3c5b977998f6e501bc81cc1f7d3 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 09:51:11 +0100 Subject: [PATCH 05/19] =?UTF-8?q?add=20jDK=2016=20and=2017=20to=20CI=C2=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff371f5e4..e58b858e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,8 @@ jobs: - 13 - 14 - 15 -# - 16 -# - 17 + - 16 + - 17 steps: - name: Git checkout uses: actions/checkout@v2 From 1aa44bf7f4e7c1bb4e4bcce79156f5a87d205d4d Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 10:06:02 +0100 Subject: [PATCH 06/19] update CNR --- CHANGES_NEXT_RELEASE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index e2875010e..0b58d81da 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,3 @@ - [cygnus-common][cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 -- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.1 to 1.17 in Dockerfile (#2297,#2304) -- [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339) \ No newline at end of file +- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297,#2304) +- [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339) From cf9944369363bd227891e98c5efa6b8961653607 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 11:27:01 +0100 Subject: [PATCH 07/19] Update cygnus-ngsi-ld --- .../cygnus/containers/NotifyContextRequestLD.java | 11 +++++++---- .../iot/cygnus/handlers/NGSIRestHandler.java | 7 ++++++- .../com/telefonica/iot/cygnus/sinks/NGSILDSink.java | 7 ++++++- .../iot/cygnus/utils/NGSIUtilsForTests.java | 12 +++++++++--- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/containers/NotifyContextRequestLD.java b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/containers/NotifyContextRequestLD.java index 266390ef2..b5ea9a9a3 100644 --- a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/containers/NotifyContextRequestLD.java +++ b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/containers/NotifyContextRequestLD.java @@ -21,13 +21,14 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Map; - +import java.util.regex.Pattern; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.reflect.TypeToken; import org.json.JSONArray; import org.json.JSONObject; - +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; /** * @@ -141,7 +142,9 @@ public static class ContextElement { * Constructor for Gson, a Json parser. */ public ContextElement(String contextElement) { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); String cer = contextElement; Map map = gson.fromJson(cer, new TypeToken>() { }.getType()); @@ -238,4 +241,4 @@ public String toString() { } // ContextElement -} \ No newline at end of file +} diff --git a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java index c81094494..c4325eede 100644 --- a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java +++ b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandler.java @@ -19,6 +19,7 @@ package com.telefonica.iot.cygnus.handlers; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonSyntaxException; import com.google.gson.reflect.TypeToken; @@ -27,7 +28,9 @@ import com.telefonica.iot.cygnus.log.CygnusLogger; import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.CommonUtils; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import java.io.BufferedReader; +import java.util.regex.Pattern; import java.util.ArrayList; import java.util.Enumeration; import java.util.HashMap; @@ -271,7 +274,9 @@ public List getEvents(javax.servlet.http.HttpServletRequest request) thro // Parse the original data into a NotifyContextRequest object JSONObject content = new JSONObject(data); NotifyContextRequestLD notifyContextRequestLD = null; - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); try { notifyContextRequestLD = new NotifyContextRequestLD(content); diff --git a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/sinks/NGSILDSink.java b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/sinks/NGSILDSink.java index 519503949..d58af79f7 100644 --- a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/sinks/NGSILDSink.java +++ b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/sinks/NGSILDSink.java @@ -18,6 +18,7 @@ package com.telefonica.iot.cygnus.sinks; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.telefonica.iot.cygnus.containers.NotifyContextRequestLD.ContextElement; import com.telefonica.iot.cygnus.errors.*; import com.telefonica.iot.cygnus.interceptors.NGSILDEvent; @@ -25,6 +26,7 @@ import com.telefonica.iot.cygnus.sinks.Enums.DataModel; import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.NGSIConstants; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import org.apache.flume.*; import org.apache.flume.conf.Configurable; import org.apache.log4j.MDC; @@ -33,6 +35,7 @@ import java.util.Arrays; import java.util.Date; import java.util.Map; +import java.util.regex.Pattern; /** * @@ -497,7 +500,9 @@ private Status processNewBatches() { } else { // Event comes from file... original and mapped context elements must be re-created String[] contextElementsStr = (new String(event.getBody())).split(CommonConstants.CONCATENATOR); - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); ContextElement originalCE = null; ContextElement mappedCE = null; diff --git a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java index 677b20492..5854d2012 100644 --- a/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java +++ b/cygnus-ngsi-ld/src/main/java/com/telefonica/iot/cygnus/utils/NGSIUtilsForTests.java @@ -18,11 +18,13 @@ package com.telefonica.iot.cygnus.utils; import com.google.gson.Gson; +import com.google.gson.GsonBuilder; import com.telefonica.iot.cygnus.containers.NameMappings; import com.telefonica.iot.cygnus.containers.NotifyContextRequestLD; import java.util.HashMap; - +import java.util.regex.Pattern; import com.telefonica.iot.cygnus.interceptors.NGSILDEvent; +import com.telefonica.iot.cygnus.management.PatternTypeAdapter; import org.apache.flume.Context; import org.json.JSONObject; @@ -98,7 +100,9 @@ public static Context createContextForOrion(String orionHost, String orionPort, } // createContextForOrion public static NotifyContextRequestLD createJsonNotifyContextRequestLD(String jsonStr) throws Exception { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NotifyContextRequestLD.class); } // createJsonNotifyContextRequest @@ -132,7 +136,9 @@ public static NGSILDEvent createNGSIEventLD(String originalCEStr, String mappedC * @throws java.lang.Exception */ public static NameMappings createJsonNameMappings(String jsonStr) throws Exception { - Gson gson = new Gson(); + Gson gson = new GsonBuilder() + .registerTypeAdapter(Pattern.class, new PatternTypeAdapter()) + .create(); return gson.fromJson(jsonStr, NameMappings.class); } // createJsonNameMappings From 012a7aacdfa7a7934c31a10f1dc4b9dccf84b3f4 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 11:43:48 +0100 Subject: [PATCH 08/19] Upgrade mockito dep for ngsi-ld --- cygnus-ngsi-ld/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cygnus-ngsi-ld/pom.xml b/cygnus-ngsi-ld/pom.xml index 40ef56834..3c101c664 100644 --- a/cygnus-ngsi-ld/pom.xml +++ b/cygnus-ngsi-ld/pom.xml @@ -17,9 +17,9 @@ - org.mockito - mockito-all - 1.9.5 + org.mockito + mockito-core + 5.10.0 test From a0fc2cdad639280a5824d1c1206943e24e68bf12 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 11:52:09 +0100 Subject: [PATCH 09/19] upgrade mockito --- .../telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java | 4 ++-- .../com/telefonica/iot/cygnus/sinks/NGSICKANSinkTest.java | 2 +- .../com/telefonica/iot/cygnus/sinks/NGSIPostgisSinkTest.java | 2 +- .../telefonica/iot/cygnus/sinks/NGSIPostgreSQLSinkTest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java index cb79e5ea2..c6997e060 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java @@ -36,7 +36,7 @@ import static org.junit.Assert.*; // this is required by "fail" like assertions import org.junit.Before; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.junit.Test; import org.mockito.Mock; import static org.mockito.Mockito.when; @@ -628,4 +628,4 @@ private Context createContext(String notificationTarget, String defaultService, return context; } // createContext -} // NGSIRestHandlerTest \ No newline at end of file +} // NGSIRestHandlerTest diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSICKANSinkTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSICKANSinkTest.java index 9c5db6ec7..57d0312bb 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSICKANSinkTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSICKANSinkTest.java @@ -22,7 +22,7 @@ import com.telefonica.iot.cygnus.sinks.Enums.DataModel; import static com.telefonica.iot.cygnus.utils.CommonUtilsForTests.getTestTraceHead; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import org.apache.flume.Context; import org.apache.log4j.Level; import org.apache.log4j.LogManager; diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgisSinkTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgisSinkTest.java index dbe3ed3ae..2b8a8eba7 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgisSinkTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgisSinkTest.java @@ -25,7 +25,7 @@ import org.apache.log4j.LogManager; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; /** * diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgreSQLSinkTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgreSQLSinkTest.java index f5fe0ecaf..9dd2b15ec 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgreSQLSinkTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/sinks/NGSIPostgreSQLSinkTest.java @@ -22,7 +22,7 @@ import org.apache.log4j.LogManager; import org.junit.Test; import org.junit.runner.RunWith; -import org.mockito.runners.MockitoJUnitRunner; +import org.mockito.junit.MockitoJUnitRunner; import static com.telefonica.iot.cygnus.utils.CommonUtilsForTests.getTestTraceHead; import static org.junit.Assert.assertEquals; From 73ff3f3faf1ef8c360020f065c68e30585bac67d Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 12:05:36 +0100 Subject: [PATCH 10/19] update pom --- cygnus-ngsi-ld/pom.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cygnus-ngsi-ld/pom.xml b/cygnus-ngsi-ld/pom.xml index 3c101c664..53b3cee5e 100644 --- a/cygnus-ngsi-ld/pom.xml +++ b/cygnus-ngsi-ld/pom.xml @@ -32,7 +32,7 @@ org.apache.httpcomponents httpcore - 4.3.1 + 4.4.16 @@ -54,7 +54,7 @@ org.apache.commons commons-lang3 - 3.4 + 3.12.0 @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.5.1 + 3.8.0 1.8 1.8 @@ -91,7 +91,7 @@ org.apache.maven.plugins maven-assembly-plugin - 2.6 + 3.5.0 jar-with-dependencies @@ -101,7 +101,7 @@ org.apache.maven.plugins maven-assembly-plugin - 2.6 + 3.5.0 src/main/assembly/assemblyCompile.xml @@ -121,7 +121,7 @@ org.codehaus.mojo exec-maven-plugin - 1.5.0 + 3.1.0 compile @@ -142,7 +142,7 @@ org.apache.maven.plugins maven-site-plugin - 3.5.1 + 3.8.2 @@ -156,7 +156,7 @@ org.apache.maven.plugins maven-surefire-report-plugin - 2.16 + 3.0.0 true @@ -164,7 +164,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 2.12 + 3.2.1 telefonica_checkstyle.xml false @@ -174,7 +174,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9 + 3.5.0 true From edf7ee40009117322c2ce572300ebb3c894e306e Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 12:16:57 +0100 Subject: [PATCH 11/19] aling with ngsi test --- .../iot/cygnus/handlers/NGSIRestHandlerTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java index c6997e060..6f3b356fb 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java @@ -31,6 +31,13 @@ import javax.servlet.http.HttpServletRequest; import org.apache.flume.Context; import org.apache.flume.Event; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.LoggerConfig; +import org.apache.flume.Context; +import org.apache.flume.Event; import org.apache.log4j.Level; import org.apache.log4j.LogManager; import static org.junit.Assert.*; // this is required by "fail" like assertions From 71868618a9c5f52ba50d0b6a6a7093f6aec0f478 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 12:22:19 +0100 Subject: [PATCH 12/19] update with log --- .../telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java index 6f3b356fb..37df9d868 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java @@ -185,7 +185,11 @@ public class NGSIRestHandlerTest { * Constructor. */ public NGSIRestHandlerTest() { - LogManager.getRootLogger().setLevel(Level.FATAL); + LoggerContext ctx = (LoggerContext) LogManager.getContext(false); + Configuration config = ctx.getConfiguration(); + LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME); + loggerConfig.setLevel(Level.FATAL); + ctx.updateLoggers(); } // NGSIRestHandlerTest /** From ffed54f04238dc3669057e0a0b33edb469192570 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 12:24:59 +0100 Subject: [PATCH 13/19] remove old imports --- .../telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java index 37df9d868..78caee575 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java @@ -36,10 +36,6 @@ import org.apache.logging.log4j.core.LoggerContext; import org.apache.logging.log4j.core.config.Configuration; import org.apache.logging.log4j.core.config.LoggerConfig; -import org.apache.flume.Context; -import org.apache.flume.Event; -import org.apache.log4j.Level; -import org.apache.log4j.LogManager; import static org.junit.Assert.*; // this is required by "fail" like assertions import org.junit.Before; import org.junit.runner.RunWith; From bf424318444fa78e9d0b32f2eefad40b63a898c3 Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Wed, 7 Feb 2024 12:51:03 +0100 Subject: [PATCH 14/19] force silent mockito --- .../com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java index 78caee575..cb32fb73e 100644 --- a/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java +++ b/cygnus-ngsi-ld/src/test/java/com/telefonica/iot/cygnus/handlers/NGSIRestHandlerTest.java @@ -51,7 +51,7 @@ * * @author frb */ -@RunWith(MockitoJUnitRunner.class) +@RunWith(MockitoJUnitRunner.Silent.class) public class NGSIRestHandlerTest { // Mocks From 3ef5db618aeff5de5ed0b4869d066316082b77f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 13:05:55 +0100 Subject: [PATCH 15/19] Update cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java --- .../cygnus/management/PatternTypeAdapter.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java index 21b6d8f42..bebfe95d8 100644 --- a/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java +++ b/cygnus-common/src/main/java/com/telefonica/iot/cygnus/management/PatternTypeAdapter.java @@ -1,3 +1,21 @@ +/** + * Copyright 2024 Telefonica Investigación y Desarrollo, S.A.U + * + * This file is part of fiware-cygnus (FI-WARE project). + * + * fiware-cygnus is free software: you can redistribute it and/or modify it under the terms of the GNU Affero + * General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * fiware-cygnus is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the + * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License + * for more details. + * + * You should have received a copy of the GNU Affero General Public License along with fiware-cygnus. If not, see + * http://www.gnu.org/licenses/. + * + * For those usages not covered by the GNU Affero General Public License please contact with iot_support at tid dot es + */ + package com.telefonica.iot.cygnus.management; import com.google.gson.TypeAdapter; From e72997f67ab7cd13db3c91de14e68491db8cbcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 13:21:54 +0100 Subject: [PATCH 16/19] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 0b58d81da..33a3c6722 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,3 @@ - [cygnus-common][cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 -- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297,#2304) +- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297, #2304) - [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339) From 18696a541f48cb2f3674bd33401c64dee6b2c1c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 13:24:37 +0100 Subject: [PATCH 17/19] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 33a3c6722..5d10f0cc4 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,3 +1,4 @@ -- [cygnus-common][cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 +- [cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 +- [cygnus-ngsi-ld] Upgrade mockito-all 1.9.5 to mockito-core 5.10.0, httpcore from 4.3.1 to 4.4.16 and maven dependencies in general - [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297, #2304) - [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339) From 1edeca9bbe1de5e751f68cfa9aaf2434cc4952fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 13:25:47 +0100 Subject: [PATCH 18/19] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 5d10f0cc4..3079a2059 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,4 +1,4 @@ - [cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 - [cygnus-ngsi-ld] Upgrade mockito-all 1.9.5 to mockito-core 5.10.0, httpcore from 4.3.1 to 4.4.16 and maven dependencies in general -- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297, #2304) +- [cygnus-ngsi] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297, #2304) - [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339) From 3a82a742d8f08b286995d177215558dbcad5907c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Wed, 7 Feb 2024 13:26:58 +0100 Subject: [PATCH 19/19] Update CHANGES_NEXT_RELEASE --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index 3079a2059..5ca111bff 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -1,4 +1,5 @@ - [cygnus-ngsi] Upgrade mockito-core dep from 5.5.0 to 5.10.0 - [cygnus-ngsi-ld] Upgrade mockito-all 1.9.5 to mockito-core 5.10.0, httpcore from 4.3.1 to 4.4.16 and maven dependencies in general - [cygnus-ngsi] Upgrade Java version from 1.11 to 1.17 in Dockerfile (#2297, #2304) +- [cygnus-common][cygnus-ngsi][cygnus-ngsi-ld] Upgrade in source code to support Java 17 build - [cygnus-common] [Arcgis] All NGSI DateTime are translated to Millis from Epoch (esriFieldTypeDate) (#2339)