From f88875dc7e149bde8ce80e69ba9b36567f71b79c Mon Sep 17 00:00:00 2001 From: "angelo.andreussi" Date: Thu, 20 Jun 2024 16:15:25 +0200 Subject: [PATCH] fix: changed parameter type for rest params when we use generics to fix jersey warning --- .../kapua/app/api/resources/v1/resources/DataMessages.java | 6 +++--- .../app/api/resources/v1/resources/DataMessagesJson.java | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java index 85e66421067..98b8039355b 100644 --- a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java +++ b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessages.java @@ -91,15 +91,15 @@ public > MessageListResult simpleQuery(@PathParam("scope @QueryParam("startDate") DateParam startDateParam, @QueryParam("endDate") DateParam endDateParam, @QueryParam("metricName") String metricName, - @QueryParam("metricType") MetricType metricType, + @QueryParam("metricType") String metricType, @QueryParam("metricMin") String metricMinValue, @QueryParam("metricMax") String metricMaxValue, @QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir, @QueryParam("offset") @DefaultValue("0") int offset, @QueryParam("limit") @DefaultValue("50") int limit) throws KapuaException { - - MessageQuery query = parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, metricType, metricMinValue, metricMaxValue, sortDir, offset, limit); + MetricType internalMetricType = new MetricType<>(metricType); + MessageQuery query = parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, internalMetricType, metricMinValue, metricMaxValue, sortDir, offset, limit); return query(scopeId, query); } diff --git a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessagesJson.java b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessagesJson.java index afa058ddafb..44fac949ad3 100644 --- a/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessagesJson.java +++ b/rest-api/resources/src/main/java/org/eclipse/kapua/app/api/resources/v1/resources/DataMessagesJson.java @@ -93,14 +93,15 @@ public > JsonMessageListResult simpleQueryJson(@PathPara @QueryParam("startDate") DateParam startDateParam, @QueryParam("endDate") DateParam endDateParam, @QueryParam("metricName") String metricName, - @QueryParam("metricType") MetricType metricType, + @QueryParam("metricType") String metricType, @QueryParam("metricMin") String metricMinValue, @QueryParam("metricMax") String metricMaxValue, @QueryParam("sortDir") @DefaultValue("DESC") SortDirection sortDir, @QueryParam("offset") @DefaultValue("0") int offset, @QueryParam("limit") @DefaultValue("50") int limit) throws KapuaException { - MessageQuery query = DataMessages.parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, metricType, metricMinValue, metricMaxValue, sortDir, offset, limit); + MetricType internalMetricType = new MetricType<>(metricType); + MessageQuery query = DataMessages.parametersToQuery(datastorePredicateFactory, messageStoreFactory, scopeId, clientId, channel, strictChannel, startDateParam, endDateParam, metricName, internalMetricType , metricMinValue, metricMaxValue, sortDir, offset, limit); query.setScopeId(scopeId); final MessageListResult result = messageStoreService.query(query);