From d2748030e251f35f78d39bd54445e7bc4808853b Mon Sep 17 00:00:00 2001 From: Andrii Landiak Date: Tue, 6 Aug 2024 13:05:15 +0300 Subject: [PATCH] Fix compile errors after merge with master --- .../thingsboard/server/dao/cloud/CloudEventService.java | 2 +- .../server/dao/cloud/BaseCloudEventService.java | 7 ++++--- .../server/dao/sql/cloud/JpaBaseCloudEventDao.java | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/dao-api/src/main/java/org/thingsboard/server/dao/cloud/CloudEventService.java b/common/dao-api/src/main/java/org/thingsboard/server/dao/cloud/CloudEventService.java index 47976ddf157..6514990d20c 100644 --- a/common/dao-api/src/main/java/org/thingsboard/server/dao/cloud/CloudEventService.java +++ b/common/dao-api/src/main/java/org/thingsboard/server/dao/cloud/CloudEventService.java @@ -51,7 +51,7 @@ ListenableFuture saveCloudEventAsync(TenantId tenantId, EdgeSettings findEdgeSettings(TenantId tenantId); - ListenableFuture> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings); + ListenableFuture> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings); void cleanupEvents(long ttl); } \ No newline at end of file diff --git a/dao/src/main/java/org/thingsboard/server/dao/cloud/BaseCloudEventService.java b/dao/src/main/java/org/thingsboard/server/dao/cloud/BaseCloudEventService.java index ad7fe124129..89ebe23260a 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/cloud/BaseCloudEventService.java +++ b/dao/src/main/java/org/thingsboard/server/dao/cloud/BaseCloudEventService.java @@ -22,6 +22,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.thingsboard.common.util.JacksonUtil; +import org.thingsboard.server.common.data.AttributeScope; import org.thingsboard.server.common.data.DataConstants; import org.thingsboard.server.common.data.cloud.CloudEvent; import org.thingsboard.server.common.data.cloud.CloudEventType; @@ -141,7 +142,7 @@ private long countEventsByTenantIdAndEntityIdAndActionAndTypeAndStartTimeAndEndT public EdgeSettings findEdgeSettings(TenantId tenantId) { try { Optional attr = - attributesService.find(tenantId, tenantId, DataConstants.SERVER_SCOPE, DataConstants.EDGE_SETTINGS_ATTR_KEY).get(); + attributesService.find(tenantId, tenantId, AttributeScope.SERVER_SCOPE, DataConstants.EDGE_SETTINGS_ATTR_KEY).get(); if (attr.isPresent()) { log.trace("Found current edge settings {}", attr.get().getValueAsString()); return JacksonUtil.fromString(attr.get().getValueAsString(), EdgeSettings.class); @@ -156,13 +157,13 @@ public EdgeSettings findEdgeSettings(TenantId tenantId) { } @Override - public ListenableFuture> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings) { + public ListenableFuture> saveEdgeSettings(TenantId tenantId, EdgeSettings edgeSettings) { try { BaseAttributeKvEntry edgeSettingAttr = new BaseAttributeKvEntry(new StringDataEntry(DataConstants.EDGE_SETTINGS_ATTR_KEY, JacksonUtil.toString(edgeSettings)), System.currentTimeMillis()); List attributes = Collections.singletonList(edgeSettingAttr); - return attributesService.save(tenantId, tenantId, DataConstants.SERVER_SCOPE, attributes); + return attributesService.save(tenantId, tenantId, AttributeScope.SERVER_SCOPE, attributes); } catch (Exception e) { log.error("Exception while saving edge settings", e); throw new RuntimeException("Exception while saving edge settings", e); diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/cloud/JpaBaseCloudEventDao.java b/dao/src/main/java/org/thingsboard/server/dao/sql/cloud/JpaBaseCloudEventDao.java index 01022f5b1bb..80fb0e6014a 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/cloud/JpaBaseCloudEventDao.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/cloud/JpaBaseCloudEventDao.java @@ -85,7 +85,7 @@ public class JpaBaseCloudEventDao extends JpaAbstractDao queue; + private TbSqlBlockingQueueWrapper queue; @Override protected Class getEntityClass() {