Browse Source

Renaming MsgConstructorFactory method to get MsgConstructor by Edge Version

pull/9617/head
Andrii Landiak 3 years ago
parent
commit
acdd90eafd
  1. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorFactory.java
  2. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorFactory.java
  3. 7
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructor.java
  4. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorFactory.java
  5. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorFactory.java
  6. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorFactory.java
  7. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorFactory.java
  8. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorFactory.java
  9. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorFactory.java
  10. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMetadataConstructor.java
  11. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMsgConstructor.java
  12. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java
  13. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java
  14. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV362.java
  15. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorFactory.java
  16. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV1.java
  17. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV2.java
  18. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorFactory.java
  19. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorFactory.java
  20. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorFactory.java
  21. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorFactory.java
  22. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java
  23. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java
  24. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java
  25. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java
  26. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java
  27. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java
  28. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java
  29. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java
  30. 6
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java
  31. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java
  32. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java
  33. 2
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java
  34. 6
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java
  35. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java
  36. 4
      application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/alarm/AlarmMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class AlarmMsgConstructorFactory {
@Autowired
protected AlarmMsgConstructorV2 alarmMsgConstructorV2;
public AlarmMsgConstructor getAlarmMsgConstructor(EdgeVersion edgeVersion) {
public AlarmMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/customer/CustomerMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class CustomerMsgConstructorFactory {
@Autowired
protected CustomerMsgConstructorV2 customerMsgConstructorV2;
public CustomerMsgConstructor getCustomerMsgConstructor(EdgeVersion edgeVersion) {
public CustomerMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

7
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructor.java

@ -17,9 +17,12 @@ package org.thingsboard.server.service.edge.rpc.constructor.device;
import com.fasterxml.jackson.databind.JsonNode;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.id.DeviceId;
import org.thingsboard.server.common.data.id.DeviceProfileId;
import org.thingsboard.server.common.data.security.DeviceCredentials;
import org.thingsboard.server.gen.edge.v1.DeviceCredentialsUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DeviceProfileUpdateMsg;
import org.thingsboard.server.gen.edge.v1.DeviceRpcCallMsg;
import org.thingsboard.server.gen.edge.v1.DeviceUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
@ -34,5 +37,9 @@ public interface DeviceMsgConstructor {
DeviceCredentialsUpdateMsg constructDeviceCredentialsUpdatedMsg(DeviceCredentials deviceCredentials);
DeviceProfileUpdateMsg constructDeviceProfileUpdatedMsg(UpdateMsgType msgType, DeviceProfile deviceProfile);
DeviceProfileUpdateMsg constructDeviceProfileDeleteMsg(DeviceProfileId deviceProfileId);
DeviceRpcCallMsg constructDeviceRpcCallMsg(UUID deviceId, JsonNode body);
}

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/device/DeviceMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class DeviceMsgConstructorFactory {
@Autowired
protected DeviceMsgConstructorV2 deviceMsgConstructorV2;
public DeviceMsgConstructor getDeviceMsgConstructor(EdgeVersion edgeVersion) {
public DeviceMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/entityview/EntityViewMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class EntityViewMsgConstructorFactory {
@Autowired
protected EntityViewMsgConstructorV2 entityViewMsgConstructorV2;
public EntityViewMsgConstructor getEntityViewMsgConstructor(EdgeVersion edgeVersion) {
public EntityViewMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/ota/OtaPackageMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class OtaPackageMsgConstructorFactory {
@Autowired
protected OtaPackageMsgConstructorV2 otaPackageMsgConstructorV2;
public OtaPackageMsgConstructor getOtaPackageMsgConstructor(EdgeVersion edgeVersion) {
public OtaPackageMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/queue/QueueMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class QueueMsgConstructorFactory {
@Autowired
protected QueueMsgConstructorV2 queueMsgConstructorV2;
public QueueMsgConstructor getQueueMsgConstructor(EdgeVersion edgeVersion) {
public QueueMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/relation/RelationMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class RelationMsgConstructorFactory {
@Autowired
protected RelationMsgConstructorV2 relationMsgConstructorV2;
public RelationMsgConstructor getRelationMsgConstructor(EdgeVersion edgeVersion) {
public RelationMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/resource/ResourceMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class ResourceMsgConstructorFactory {
@Autowired
protected ResourceMsgConstructorV2 resourceMsgConstructorV2;
public ResourceMsgConstructor getResourceMsgConstructor(EdgeVersion edgeVersion) {
public ResourceMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMetadataConstructor.java

@ -37,7 +37,7 @@ import java.util.NavigableSet;
@Slf4j
@AllArgsConstructor
public abstract class AbstractRuleChainMetadataConstructor implements RuleChainMetadataConstructor {
public abstract class BaseRuleChainMetadataConstructor implements RuleChainMetadataConstructor {
@Override
public RuleChainMetadataUpdateMsg constructRuleChainMetadataUpdatedMsg(TenantId tenantId,

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/BaseRuleChainMsgConstructor.java

@ -23,7 +23,7 @@ import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg;
import org.thingsboard.server.gen.edge.v1.UpdateMsgType;
public abstract class AbstractRuleChainMsgConstructor implements RuleChainMsgConstructor {
public abstract class BaseRuleChainMsgConstructor implements RuleChainMsgConstructor {
@Override
public RuleChainUpdateMsg constructRuleChainDeleteMsg(RuleChainId ruleChainId) {

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV330.java

@ -36,7 +36,7 @@ import java.util.UUID;
import java.util.stream.Collectors;
@Slf4j
public class RuleChainMetadataConstructorV330 extends AbstractRuleChainMetadataConstructor {
public class RuleChainMetadataConstructorV330 extends BaseRuleChainMetadataConstructor {
private static final String RULE_CHAIN_INPUT_NODE = TbRuleChainInputNode.class.getName();
private static final String TB_RULE_CHAIN_OUTPUT_NODE = TbRuleChainOutputNode.class.getName();

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV340.java

@ -23,7 +23,7 @@ import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
import java.util.TreeSet;
@Slf4j
public class RuleChainMetadataConstructorV340 extends AbstractRuleChainMetadataConstructor {
public class RuleChainMetadataConstructorV340 extends BaseRuleChainMetadataConstructor {
@Override
protected void constructRuleChainMetadataUpdatedMsg(TenantId tenantId,

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMetadataConstructorV362.java

@ -20,7 +20,7 @@ import org.thingsboard.server.common.data.id.TenantId;
import org.thingsboard.server.common.data.rule.RuleChainMetaData;
import org.thingsboard.server.gen.edge.v1.RuleChainMetadataUpdateMsg;
public class RuleChainMetadataConstructorV362 extends AbstractRuleChainMetadataConstructor {
public class RuleChainMetadataConstructorV362 extends BaseRuleChainMetadataConstructor {
@Override
protected void constructRuleChainMetadataUpdatedMsg(TenantId tenantId, RuleChainMetadataUpdateMsg.Builder builder, RuleChainMetaData ruleChainMetaData) {

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class RuleChainMsgConstructorFactory {
@Autowired
protected RuleChainMsgConstructorV2 ruleChainMsgConstructorV2;
public RuleChainMsgConstructor getRuleChainMsgConstructor(EdgeVersion edgeVersion) {
public RuleChainMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV1.java

@ -24,7 +24,7 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
public class RuleChainMsgConstructorV1 extends AbstractRuleChainMsgConstructor {
public class RuleChainMsgConstructorV1 extends BaseRuleChainMsgConstructor {
@Override
public RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot) {

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/rule/RuleChainMsgConstructorV2.java

@ -24,7 +24,7 @@ import org.thingsboard.server.queue.util.TbCoreComponent;
@Component
@TbCoreComponent
public class RuleChainMsgConstructorV2 extends AbstractRuleChainMsgConstructor {
public class RuleChainMsgConstructorV2 extends BaseRuleChainMsgConstructor {
@Override
public RuleChainUpdateMsg constructRuleChainUpdatedMsg(UpdateMsgType msgType, RuleChain ruleChain, boolean isRoot) {

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/settings/AdminSettingsMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class AdminSettingsMsgConstructorFactory {
@Autowired
protected AdminSettingsMsgConstructorV2 adminSettingsMsgConstructorV2;
public AdminSettingsMsgConstructor getAdminSettingsMsgConstructor(EdgeVersion edgeVersion) {
public AdminSettingsMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/tenant/TenantMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class TenantMsgConstructorFactory {
@Autowired
protected TenantMsgConstructorV2 tenantMsgConstructorV2;
public TenantMsgConstructor getTenantMsgConstructor(EdgeVersion edgeVersion) {
public TenantMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/user/UserMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class UserMsgConstructorFactory {
@Autowired
protected UserMsgConstructorV2 userMsgConstructorV2;
public UserMsgConstructor getUserMsgConstructor(EdgeVersion edgeVersion) {
public UserMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/constructor/widget/WidgetMsgConstructorFactory.java

@ -30,7 +30,7 @@ public class WidgetMsgConstructorFactory {
@Autowired
protected WidgetMsgConstructorV2 widgetMsgConstructorV2;
public WidgetMsgConstructor getWidgetMsgConstructor(EdgeVersion edgeVersion) {
public WidgetMsgConstructor getMsgConstructorByEdgeVersion(EdgeVersion edgeVersion) {
switch (edgeVersion) {
case V_3_3_0:
case V_3_3_3:

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/alarm/BaseAlarmProcessor.java

@ -132,13 +132,13 @@ public abstract class BaseAlarmProcessor extends BaseEdgeProcessor {
case ALARM_CLEAR:
Alarm alarm = alarmService.findAlarmById(tenantId, alarmId);
if (alarm != null) {
return alarmMsgConstructorFactory.getAlarmMsgConstructor(edgeVersion).constructAlarmUpdatedMsg(msgType, alarm, findOriginatorEntityName(tenantId, alarm));
return alarmMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructAlarmUpdatedMsg(msgType, alarm, findOriginatorEntityName(tenantId, alarm));
}
break;
case DELETED:
Alarm deletedAlarm = JacksonUtil.convertValue(body, Alarm.class);
if (deletedAlarm != null) {
return alarmMsgConstructorFactory.getAlarmMsgConstructor(edgeVersion).constructAlarmUpdatedMsg(msgType, deletedAlarm, findOriginatorEntityName(tenantId, deletedAlarm));
return alarmMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructAlarmUpdatedMsg(msgType, deletedAlarm, findOriginatorEntityName(tenantId, deletedAlarm));
}
}
return null;

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/customer/CustomerEdgeProcessor.java

@ -58,7 +58,7 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor {
if (customer != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
CustomerUpdateMsg customerUpdateMsg =
customerMsgConstructorFactory.getCustomerMsgConstructor(edgeVersion).constructCustomerUpdatedMsg(msgType, customer);
customerMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructCustomerUpdatedMsg(msgType, customer);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addCustomerUpdateMsg(customerUpdateMsg)
@ -67,7 +67,7 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
CustomerUpdateMsg customerUpdateMsg =
customerMsgConstructorFactory.getCustomerMsgConstructor(edgeVersion).constructCustomerDeleteMsg(customerId);
customerMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructCustomerDeleteMsg(customerId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addCustomerUpdateMsg(customerUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/dashboard/DashboardEdgeProcessor.java

@ -111,7 +111,7 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
if (dashboard != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
DashboardUpdateMsg dashboardUpdateMsg =
dashboardMsgConstructorFactory.getDashboardMsgConstructor(edgeVersion).constructDashboardUpdatedMsg(msgType, dashboard);
dashboardMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructDashboardUpdatedMsg(msgType, dashboard);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDashboardUpdateMsg(dashboardUpdateMsg)
@ -121,7 +121,7 @@ public class DashboardEdgeProcessor extends BaseDashboardProcessor {
case DELETED:
case UNASSIGNED_FROM_EDGE:
DashboardUpdateMsg dashboardUpdateMsg =
dashboardMsgConstructorFactory.getDashboardMsgConstructor(edgeVersion).constructDashboardDeleteMsg(dashboardId);
dashboardMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructDashboardDeleteMsg(dashboardId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addDashboardUpdateMsg(dashboardUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/entityview/EntityViewEdgeProcessor.java

@ -118,7 +118,7 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
if (entityView != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
EntityViewUpdateMsg entityViewUpdateMsg =
entityViewMsgConstructorFactory.getEntityViewMsgConstructor(edgeVersion).constructEntityViewUpdatedMsg(msgType, entityView);
entityViewMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructEntityViewUpdatedMsg(msgType, entityView);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addEntityViewUpdateMsg(entityViewUpdateMsg)
@ -128,7 +128,7 @@ public class EntityViewEdgeProcessor extends BaseEntityViewProcessor {
case DELETED:
case UNASSIGNED_FROM_EDGE:
EntityViewUpdateMsg entityViewUpdateMsg =
entityViewMsgConstructorFactory.getEntityViewMsgConstructor(edgeVersion).constructEntityViewDeleteMsg(entityViewId);
entityViewMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructEntityViewDeleteMsg(entityViewId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addEntityViewUpdateMsg(entityViewUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/ota/OtaPackageEdgeProcessor.java

@ -43,7 +43,7 @@ public class OtaPackageEdgeProcessor extends BaseEdgeProcessor {
if (otaPackage != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
OtaPackageUpdateMsg otaPackageUpdateMsg =
otaPackageMsgConstructorFactory.getOtaPackageMsgConstructor(edgeVersion).constructOtaPackageUpdatedMsg(msgType, otaPackage);
otaPackageMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructOtaPackageUpdatedMsg(msgType, otaPackage);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addOtaPackageUpdateMsg(otaPackageUpdateMsg)
@ -52,7 +52,7 @@ public class OtaPackageEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
OtaPackageUpdateMsg otaPackageUpdateMsg =
otaPackageMsgConstructorFactory.getOtaPackageMsgConstructor(edgeVersion).constructOtaPackageDeleteMsg(otaPackageId);
otaPackageMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructOtaPackageDeleteMsg(otaPackageId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addOtaPackageUpdateMsg(otaPackageUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/queue/QueueEdgeProcessor.java

@ -43,7 +43,7 @@ public class QueueEdgeProcessor extends BaseEdgeProcessor {
if (queue != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
QueueUpdateMsg queueUpdateMsg =
queueMsgConstructorFactory.getQueueMsgConstructor(edgeVersion).constructQueueUpdatedMsg(msgType, queue);
queueMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructQueueUpdatedMsg(msgType, queue);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addQueueUpdateMsg(queueUpdateMsg)
@ -52,7 +52,7 @@ public class QueueEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
QueueUpdateMsg queueDeleteMsg =
queueMsgConstructorFactory.getQueueMsgConstructor(edgeVersion).constructQueueDeleteMsg(queueId);
queueMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructQueueDeleteMsg(queueId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addQueueUpdateMsg(queueDeleteMsg)

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/relation/RelationEdgeProcessor.java

@ -59,7 +59,7 @@ public class RelationEdgeProcessor extends BaseRelationProcessor {
public DownlinkMsg convertRelationEventToDownlink(EdgeEvent edgeEvent, EdgeVersion edgeVersion) {
EntityRelation entityRelation = JacksonUtil.convertValue(edgeEvent.getBody(), EntityRelation.class);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
RelationUpdateMsg relationUpdateMsg = relationMsgConstructorFactory.getRelationMsgConstructor(edgeVersion).constructRelationUpdatedMsg(msgType, entityRelation);
RelationUpdateMsg relationUpdateMsg = relationMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructRelationUpdatedMsg(msgType, entityRelation);
return DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addRelationUpdateMsg(relationUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/resource/ResourceEdgeProcessor.java

@ -81,7 +81,7 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
if (tbResource != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
ResourceUpdateMsg resourceUpdateMsg =
resourceMsgConstructorFactory.getResourceMsgConstructor(edgeVersion).constructResourceUpdatedMsg(msgType, tbResource);
resourceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructResourceUpdatedMsg(msgType, tbResource);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addResourceUpdateMsg(resourceUpdateMsg)
@ -90,7 +90,7 @@ public class ResourceEdgeProcessor extends BaseResourceProcessor {
break;
case DELETED:
ResourceUpdateMsg resourceUpdateMsg =
resourceMsgConstructorFactory.getResourceMsgConstructor(edgeVersion).constructResourceDeleteMsg(tbResourceId);
resourceMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructResourceDeleteMsg(tbResourceId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addResourceUpdateMsg(resourceUpdateMsg)

6
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/rule/RuleChainEdgeProcessor.java

@ -54,7 +54,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
}
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
RuleChainUpdateMsg ruleChainUpdateMsg =
ruleChainMsgConstructorFactory.getRuleChainMsgConstructor(edgeVersion).constructRuleChainUpdatedMsg(msgType, ruleChain, isRoot);
ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructRuleChainUpdatedMsg(msgType, ruleChain, isRoot);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addRuleChainUpdateMsg(ruleChainUpdateMsg)
@ -65,7 +65,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
case UNASSIGNED_FROM_EDGE:
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addRuleChainUpdateMsg(ruleChainMsgConstructorFactory.getRuleChainMsgConstructor(edgeVersion).constructRuleChainDeleteMsg(ruleChainId))
.addRuleChainUpdateMsg(ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructRuleChainDeleteMsg(ruleChainId))
.build();
break;
}
@ -80,7 +80,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor {
RuleChainMetaData ruleChainMetaData = ruleChainService.loadRuleChainMetaData(edgeEvent.getTenantId(), ruleChainId);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
RuleChainMetadataUpdateMsg ruleChainMetadataUpdateMsg =
ruleChainMsgConstructorFactory.getRuleChainMsgConstructor(edgeVersion).constructRuleChainMetadataUpdatedMsg(edgeEvent.getTenantId(), msgType, ruleChainMetaData, edgeVersion);
ruleChainMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructRuleChainMetadataUpdatedMsg(edgeEvent.getTenantId(), msgType, ruleChainMetaData, edgeVersion);
if (ruleChainMetadataUpdateMsg != null) {
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/settings/AdminSettingsEdgeProcessor.java

@ -38,7 +38,7 @@ public class AdminSettingsEdgeProcessor extends BaseEdgeProcessor {
return null;
}
AdminSettingsUpdateMsg adminSettingsUpdateMsg =
adminSettingsMsgConstructorFactory.getAdminSettingsMsgConstructor(edgeVersion).constructAdminSettingsUpdateMsg(adminSettings);
adminSettingsMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructAdminSettingsUpdateMsg(adminSettings);
return DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addAdminSettingsUpdateMsg(adminSettingsUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantEdgeProcessor.java

@ -43,9 +43,9 @@ public class TenantEdgeProcessor extends BaseEdgeProcessor {
Tenant tenant = tenantService.findTenantById(tenantId);
if (tenant != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
TenantUpdateMsg tenantUpdateMsg = tenantMsgConstructorFactory.getTenantMsgConstructor(edgeVersion).constructTenantUpdateMsg(msgType, tenant);
TenantUpdateMsg tenantUpdateMsg = tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructTenantUpdateMsg(msgType, tenant);
TenantProfile tenantProfile = tenantProfileService.findTenantProfileById(tenantId, tenant.getTenantProfileId());
TenantProfileUpdateMsg tenantProfileUpdateMsg = tenantMsgConstructorFactory.getTenantMsgConstructor(edgeVersion).constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
TenantProfileUpdateMsg tenantProfileUpdateMsg = tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addTenantUpdateMsg(tenantUpdateMsg)

2
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/tenant/TenantProfileEdgeProcessor.java

@ -42,7 +42,7 @@ public class TenantProfileEdgeProcessor extends BaseEdgeProcessor {
if (tenantProfile != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
TenantProfileUpdateMsg tenantProfileUpdateMsg =
tenantMsgConstructorFactory.getTenantMsgConstructor(edgeVersion).constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
tenantMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructTenantProfileUpdateMsg(msgType, tenantProfile, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addTenantProfileUpdateMsg(tenantProfileUpdateMsg)

6
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/user/UserEdgeProcessor.java

@ -45,21 +45,21 @@ public class UserEdgeProcessor extends BaseEdgeProcessor {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addUserUpdateMsg(userMsgConstructorFactory.getUserMsgConstructor(edgeVersion).constructUserUpdatedMsg(msgType, user))
.addUserUpdateMsg(userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructUserUpdatedMsg(msgType, user))
.build();
}
break;
case DELETED:
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addUserUpdateMsg(userMsgConstructorFactory.getUserMsgConstructor(edgeVersion).constructUserDeleteMsg(userId))
.addUserUpdateMsg(userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructUserDeleteMsg(userId))
.build();
break;
case CREDENTIALS_UPDATED:
UserCredentials userCredentialsByUserId = userService.findUserCredentialsByUserId(edgeEvent.getTenantId(), userId);
if (userCredentialsByUserId != null && userCredentialsByUserId.isEnabled()) {
UserCredentialsUpdateMsg userCredentialsUpdateMsg =
userMsgConstructorFactory.getUserMsgConstructor(edgeVersion).constructUserCredentialsUpdatedMsg(userCredentialsByUserId);
userMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructUserCredentialsUpdatedMsg(userCredentialsByUserId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addUserCredentialsUpdateMsg(userCredentialsUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetBundleEdgeProcessor.java

@ -46,7 +46,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor {
List<String> widgets = widgetTypeService.findWidgetFqnsByWidgetsBundleId(edgeEvent.getTenantId(), widgetsBundleId);
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
WidgetsBundleUpdateMsg widgetsBundleUpdateMsg =
widgetMsgConstructorFactory.getWidgetMsgConstructor(edgeVersion).constructWidgetsBundleUpdateMsg(msgType, widgetsBundle, widgets);
widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructWidgetsBundleUpdateMsg(msgType, widgetsBundle, widgets);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg)
@ -55,7 +55,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
WidgetsBundleUpdateMsg widgetsBundleUpdateMsg =
widgetMsgConstructorFactory.getWidgetMsgConstructor(edgeVersion).constructWidgetsBundleDeleteMsg(widgetsBundleId);
widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructWidgetsBundleDeleteMsg(widgetsBundleId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg)

4
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/widget/WidgetTypeEdgeProcessor.java

@ -43,7 +43,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
if (widgetTypeDetails != null) {
UpdateMsgType msgType = getUpdateMsgType(edgeEvent.getAction());
WidgetTypeUpdateMsg widgetTypeUpdateMsg =
widgetMsgConstructorFactory.getWidgetMsgConstructor(edgeVersion).constructWidgetTypeUpdateMsg(msgType, widgetTypeDetails, edgeVersion);
widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructWidgetTypeUpdateMsg(msgType, widgetTypeDetails, edgeVersion);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetTypeUpdateMsg(widgetTypeUpdateMsg)
@ -52,7 +52,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor {
break;
case DELETED:
WidgetTypeUpdateMsg widgetTypeUpdateMsg =
widgetMsgConstructorFactory.getWidgetMsgConstructor(edgeVersion).constructWidgetTypeDeleteMsg(widgetTypeId);
widgetMsgConstructorFactory.getMsgConstructorByEdgeVersion(edgeVersion).constructWidgetTypeDeleteMsg(widgetTypeId);
downlinkMsg = DownlinkMsg.newBuilder()
.setDownlinkMsgId(EdgeUtils.nextPositiveInt())
.addWidgetTypeUpdateMsg(widgetTypeUpdateMsg)

Loading…
Cancel
Save