Commit 94bc3e2d1b82e8295545e86024c840e7b05092b0
1 parent
d30ac7d2
Changed method usage - single set instead of collection
Showing
15 changed files
with
33 additions
and
55 deletions
... | ... | @@ -24,8 +24,6 @@ import org.thingsboard.server.gen.edge.v1.AdminSettingsUpdateMsg; |
24 | 24 | import org.thingsboard.server.gen.edge.v1.DownlinkMsg; |
25 | 25 | import org.thingsboard.server.queue.util.TbCoreComponent; |
26 | 26 | |
27 | -import java.util.Collections; | |
28 | - | |
29 | 27 | @Component |
30 | 28 | @Slf4j |
31 | 29 | @TbCoreComponent |
... | ... | @@ -33,10 +31,10 @@ public class AdminSettingsEdgeProcessor extends BaseEdgeProcessor { |
33 | 31 | |
34 | 32 | public DownlinkMsg processAdminSettingsToEdge(EdgeEvent edgeEvent) { |
35 | 33 | AdminSettings adminSettings = mapper.convertValue(edgeEvent.getBody(), AdminSettings.class); |
36 | - AdminSettingsUpdateMsg t = adminSettingsMsgConstructor.constructAdminSettingsUpdateMsg(adminSettings); | |
34 | + AdminSettingsUpdateMsg adminSettingsUpdateMsg = adminSettingsMsgConstructor.constructAdminSettingsUpdateMsg(adminSettings); | |
37 | 35 | return DownlinkMsg.newBuilder() |
38 | 36 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
39 | - .addAllAdminSettingsUpdateMsg(Collections.singletonList(t)) | |
37 | + .addAdminSettingsUpdateMsg(adminSettingsUpdateMsg) | |
40 | 38 | .build(); |
41 | 39 | } |
42 | 40 | ... | ... |
... | ... | @@ -42,7 +42,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
42 | 42 | import org.thingsboard.server.gen.transport.TransportProtos; |
43 | 43 | import org.thingsboard.server.queue.util.TbCoreComponent; |
44 | 44 | |
45 | -import java.util.Collections; | |
46 | 45 | import java.util.UUID; |
47 | 46 | |
48 | 47 | @Component |
... | ... | @@ -122,7 +121,7 @@ public class AlarmEdgeProcessor extends BaseEdgeProcessor { |
122 | 121 | if (alarm != null) { |
123 | 122 | downlinkMsg = DownlinkMsg.newBuilder() |
124 | 123 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
125 | - .addAllAlarmUpdateMsg(Collections.singletonList(alarmMsgConstructor.constructAlarmUpdatedMsg(edge.getTenantId(), msgType, alarm))) | |
124 | + .addAlarmUpdateMsg(alarmMsgConstructor.constructAlarmUpdatedMsg(edge.getTenantId(), msgType, alarm)) | |
126 | 125 | .build(); |
127 | 126 | } |
128 | 127 | } catch (Exception e) { | ... | ... |
... | ... | @@ -29,8 +29,6 @@ import org.thingsboard.server.gen.edge.v1.DownlinkMsg; |
29 | 29 | import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
30 | 30 | import org.thingsboard.server.queue.util.TbCoreComponent; |
31 | 31 | |
32 | -import java.util.Collections; | |
33 | - | |
34 | 32 | @Component |
35 | 33 | @Slf4j |
36 | 34 | @TbCoreComponent |
... | ... | @@ -52,7 +50,7 @@ public class AssetEdgeProcessor extends BaseEdgeProcessor { |
52 | 50 | assetMsgConstructor.constructAssetUpdatedMsg(msgType, asset, customerId); |
53 | 51 | downlinkMsg = DownlinkMsg.newBuilder() |
54 | 52 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
55 | - .addAllAssetUpdateMsg(Collections.singletonList(assetUpdateMsg)) | |
53 | + .addAssetUpdateMsg(assetUpdateMsg) | |
56 | 54 | .build(); |
57 | 55 | } |
58 | 56 | break; |
... | ... | @@ -62,7 +60,7 @@ public class AssetEdgeProcessor extends BaseEdgeProcessor { |
62 | 60 | assetMsgConstructor.constructAssetDeleteMsg(assetId); |
63 | 61 | downlinkMsg = DownlinkMsg.newBuilder() |
64 | 62 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
65 | - .addAllAssetUpdateMsg(Collections.singletonList(assetUpdateMsg)) | |
63 | + .addAssetUpdateMsg(assetUpdateMsg) | |
66 | 64 | .build(); |
67 | 65 | break; |
68 | 66 | } | ... | ... |
... | ... | @@ -35,7 +35,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
35 | 35 | import org.thingsboard.server.gen.transport.TransportProtos; |
36 | 36 | import org.thingsboard.server.queue.util.TbCoreComponent; |
37 | 37 | |
38 | -import java.util.Collections; | |
39 | 38 | import java.util.UUID; |
40 | 39 | |
41 | 40 | @Component |
... | ... | @@ -55,7 +54,7 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor { |
55 | 54 | customerMsgConstructor.constructCustomerUpdatedMsg(msgType, customer); |
56 | 55 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 56 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllCustomerUpdateMsg(Collections.singletonList(customerUpdateMsg)) | |
57 | + .addCustomerUpdateMsg(customerUpdateMsg) | |
59 | 58 | .build(); |
60 | 59 | } |
61 | 60 | break; |
... | ... | @@ -64,7 +63,7 @@ public class CustomerEdgeProcessor extends BaseEdgeProcessor { |
64 | 63 | customerMsgConstructor.constructCustomerDeleteMsg(customerId); |
65 | 64 | downlinkMsg = DownlinkMsg.newBuilder() |
66 | 65 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
67 | - .addAllCustomerUpdateMsg(Collections.singletonList(customerUpdateMsg)) | |
66 | + .addCustomerUpdateMsg(customerUpdateMsg) | |
68 | 67 | .build(); |
69 | 68 | break; |
70 | 69 | } | ... | ... |
... | ... | @@ -55,7 +55,7 @@ public class DashboardEdgeProcessor extends BaseEdgeProcessor { |
55 | 55 | dashboardMsgConstructor.constructDashboardUpdatedMsg(msgType, dashboard, customerId); |
56 | 56 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 57 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllDashboardUpdateMsg(Collections.singletonList(dashboardUpdateMsg)) | |
58 | + .addDashboardUpdateMsg(dashboardUpdateMsg) | |
59 | 59 | .build(); |
60 | 60 | } |
61 | 61 | break; |
... | ... | @@ -65,7 +65,7 @@ public class DashboardEdgeProcessor extends BaseEdgeProcessor { |
65 | 65 | dashboardMsgConstructor.constructDashboardDeleteMsg(dashboardId); |
66 | 66 | downlinkMsg = DownlinkMsg.newBuilder() |
67 | 67 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
68 | - .addAllDashboardUpdateMsg(Collections.singletonList(dashboardUpdateMsg)) | |
68 | + .addDashboardUpdateMsg(dashboardUpdateMsg) | |
69 | 69 | .build(); |
70 | 70 | break; |
71 | 71 | } | ... | ... |
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/DeviceEdgeProcessor.java
... | ... | @@ -63,7 +63,6 @@ import org.thingsboard.server.queue.util.TbCoreComponent; |
63 | 63 | import org.thingsboard.server.service.rpc.FromDeviceRpcResponse; |
64 | 64 | import org.thingsboard.server.service.rpc.FromDeviceRpcResponseActorMsg; |
65 | 65 | |
66 | -import java.util.Collections; | |
67 | 66 | import java.util.UUID; |
68 | 67 | import java.util.concurrent.locks.ReentrantLock; |
69 | 68 | |
... | ... | @@ -340,7 +339,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor { |
340 | 339 | deviceMsgConstructor.constructDeviceUpdatedMsg(msgType, device, customerId, null); |
341 | 340 | downlinkMsg = DownlinkMsg.newBuilder() |
342 | 341 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
343 | - .addAllDeviceUpdateMsg(Collections.singletonList(deviceUpdateMsg)) | |
342 | + .addDeviceUpdateMsg(deviceUpdateMsg) | |
344 | 343 | .build(); |
345 | 344 | } |
346 | 345 | break; |
... | ... | @@ -350,7 +349,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor { |
350 | 349 | deviceMsgConstructor.constructDeviceDeleteMsg(deviceId); |
351 | 350 | downlinkMsg = DownlinkMsg.newBuilder() |
352 | 351 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
353 | - .addAllDeviceUpdateMsg(Collections.singletonList(deviceUpdateMsg)) | |
352 | + .addDeviceUpdateMsg(deviceUpdateMsg) | |
354 | 353 | .build(); |
355 | 354 | break; |
356 | 355 | case CREDENTIALS_UPDATED: |
... | ... | @@ -360,7 +359,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor { |
360 | 359 | deviceMsgConstructor.constructDeviceCredentialsUpdatedMsg(deviceCredentials); |
361 | 360 | downlinkMsg = DownlinkMsg.newBuilder() |
362 | 361 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
363 | - .addAllDeviceCredentialsUpdateMsg(Collections.singletonList(deviceCredentialsUpdateMsg)) | |
362 | + .addDeviceCredentialsUpdateMsg(deviceCredentialsUpdateMsg) | |
364 | 363 | .build(); |
365 | 364 | } |
366 | 365 | break; |
... | ... | @@ -374,7 +373,7 @@ public class DeviceEdgeProcessor extends BaseEdgeProcessor { |
374 | 373 | deviceMsgConstructor.constructDeviceRpcCallMsg(edgeEvent.getEntityId(), edgeEvent.getBody()); |
375 | 374 | return DownlinkMsg.newBuilder() |
376 | 375 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
377 | - .addAllDeviceRpcCallMsg(Collections.singletonList(deviceRpcCallMsg)) | |
376 | + .addDeviceRpcCallMsg(deviceRpcCallMsg) | |
378 | 377 | .build(); |
379 | 378 | } |
380 | 379 | } | ... | ... |
... | ... | @@ -27,8 +27,6 @@ import org.thingsboard.server.gen.edge.v1.DownlinkMsg; |
27 | 27 | import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
28 | 28 | import org.thingsboard.server.queue.util.TbCoreComponent; |
29 | 29 | |
30 | -import java.util.Collections; | |
31 | - | |
32 | 30 | @Component |
33 | 31 | @Slf4j |
34 | 32 | @TbCoreComponent |
... | ... | @@ -46,7 +44,7 @@ public class DeviceProfileEdgeProcessor extends BaseEdgeProcessor { |
46 | 44 | deviceProfileMsgConstructor.constructDeviceProfileUpdatedMsg(msgType, deviceProfile); |
47 | 45 | downlinkMsg = DownlinkMsg.newBuilder() |
48 | 46 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
49 | - .addAllDeviceProfileUpdateMsg(Collections.singletonList(deviceProfileUpdateMsg)) | |
47 | + .addDeviceProfileUpdateMsg(deviceProfileUpdateMsg) | |
50 | 48 | .build(); |
51 | 49 | } |
52 | 50 | break; |
... | ... | @@ -55,7 +53,7 @@ public class DeviceProfileEdgeProcessor extends BaseEdgeProcessor { |
55 | 53 | deviceProfileMsgConstructor.constructDeviceProfileDeleteMsg(deviceProfileId); |
56 | 54 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 55 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllDeviceProfileUpdateMsg(Collections.singletonList(deviceProfileUpdateMsg)) | |
56 | + .addDeviceProfileUpdateMsg(deviceProfileUpdateMsg) | |
59 | 57 | .build(); |
60 | 58 | break; |
61 | 59 | } | ... | ... |
application/src/main/java/org/thingsboard/server/service/edge/rpc/processor/EntityEdgeProcessor.java
... | ... | @@ -45,7 +45,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
45 | 45 | import org.thingsboard.server.gen.transport.TransportProtos; |
46 | 46 | import org.thingsboard.server.queue.util.TbCoreComponent; |
47 | 47 | |
48 | -import java.util.Collections; | |
49 | 48 | import java.util.List; |
50 | 49 | import java.util.UUID; |
51 | 50 | |
... | ... | @@ -64,11 +63,11 @@ public class EntityEdgeProcessor extends BaseEdgeProcessor { |
64 | 63 | if(edgeEvent.getBody() != null) { |
65 | 64 | conflictName = edgeEvent.getBody().get("conflictName").asText(); |
66 | 65 | } |
67 | - DeviceUpdateMsg d = deviceMsgConstructor | |
66 | + DeviceUpdateMsg deviceUpdateMsg = deviceMsgConstructor | |
68 | 67 | .constructDeviceUpdatedMsg(UpdateMsgType.ENTITY_MERGE_RPC_MESSAGE, device, customerId, conflictName); |
69 | 68 | downlinkMsg = DownlinkMsg.newBuilder() |
70 | 69 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
71 | - .addAllDeviceUpdateMsg(Collections.singletonList(d)) | |
70 | + .addDeviceUpdateMsg(deviceUpdateMsg) | |
72 | 71 | .build(); |
73 | 72 | } |
74 | 73 | return downlinkMsg; |
... | ... | @@ -84,7 +83,7 @@ public class EntityEdgeProcessor extends BaseEdgeProcessor { |
84 | 83 | .build(); |
85 | 84 | DownlinkMsg.Builder builder = DownlinkMsg.newBuilder() |
86 | 85 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
87 | - .addAllDeviceCredentialsRequestMsg(Collections.singletonList(deviceCredentialsRequestMsg)); | |
86 | + .addDeviceCredentialsRequestMsg(deviceCredentialsRequestMsg); | |
88 | 87 | downlinkMsg = builder.build(); |
89 | 88 | } |
90 | 89 | return downlinkMsg; | ... | ... |
... | ... | @@ -29,8 +29,6 @@ import org.thingsboard.server.gen.edge.v1.EntityViewUpdateMsg; |
29 | 29 | import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
30 | 30 | import org.thingsboard.server.queue.util.TbCoreComponent; |
31 | 31 | |
32 | -import java.util.Collections; | |
33 | - | |
34 | 32 | @Component |
35 | 33 | @Slf4j |
36 | 34 | @TbCoreComponent |
... | ... | @@ -52,7 +50,7 @@ public class EntityViewEdgeProcessor extends BaseEdgeProcessor { |
52 | 50 | entityViewMsgConstructor.constructEntityViewUpdatedMsg(msgType, entityView, customerId); |
53 | 51 | downlinkMsg = DownlinkMsg.newBuilder() |
54 | 52 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
55 | - .addAllEntityViewUpdateMsg(Collections.singletonList(entityViewUpdateMsg)) | |
53 | + .addEntityViewUpdateMsg(entityViewUpdateMsg) | |
56 | 54 | .build(); |
57 | 55 | } |
58 | 56 | break; |
... | ... | @@ -62,7 +60,7 @@ public class EntityViewEdgeProcessor extends BaseEdgeProcessor { |
62 | 60 | entityViewMsgConstructor.constructEntityViewDeleteMsg(entityViewId); |
63 | 61 | downlinkMsg = DownlinkMsg.newBuilder() |
64 | 62 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
65 | - .addAllEntityViewUpdateMsg(Collections.singletonList(entityViewUpdateMsg)) | |
63 | + .addEntityViewUpdateMsg(entityViewUpdateMsg) | |
66 | 64 | .build(); |
67 | 65 | break; |
68 | 66 | } | ... | ... |
... | ... | @@ -48,7 +48,6 @@ import org.thingsboard.server.gen.transport.TransportProtos; |
48 | 48 | import org.thingsboard.server.queue.util.TbCoreComponent; |
49 | 49 | |
50 | 50 | import java.util.ArrayList; |
51 | -import java.util.Collections; | |
52 | 51 | import java.util.HashSet; |
53 | 52 | import java.util.List; |
54 | 53 | import java.util.Set; |
... | ... | @@ -118,10 +117,10 @@ public class RelationEdgeProcessor extends BaseEdgeProcessor { |
118 | 117 | |
119 | 118 | public DownlinkMsg processRelationToEdge(EdgeEvent edgeEvent, UpdateMsgType msgType) { |
120 | 119 | EntityRelation entityRelation = mapper.convertValue(edgeEvent.getBody(), EntityRelation.class); |
121 | - RelationUpdateMsg r = relationMsgConstructor.constructRelationUpdatedMsg(msgType, entityRelation); | |
120 | + RelationUpdateMsg relationUpdateMsg = relationMsgConstructor.constructRelationUpdatedMsg(msgType, entityRelation); | |
122 | 121 | return DownlinkMsg.newBuilder() |
123 | 122 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
124 | - .addAllRelationUpdateMsg(Collections.singletonList(r)) | |
123 | + .addRelationUpdateMsg(relationUpdateMsg) | |
125 | 124 | .build(); |
126 | 125 | } |
127 | 126 | ... | ... |
... | ... | @@ -30,8 +30,6 @@ import org.thingsboard.server.gen.edge.v1.RuleChainUpdateMsg; |
30 | 30 | import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
31 | 31 | import org.thingsboard.server.queue.util.TbCoreComponent; |
32 | 32 | |
33 | -import java.util.Collections; | |
34 | - | |
35 | 33 | @Component |
36 | 34 | @Slf4j |
37 | 35 | @TbCoreComponent |
... | ... | @@ -50,7 +48,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor { |
50 | 48 | ruleChainMsgConstructor.constructRuleChainUpdatedMsg(edge.getRootRuleChainId(), msgType, ruleChain); |
51 | 49 | downlinkMsg = DownlinkMsg.newBuilder() |
52 | 50 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
53 | - .addAllRuleChainUpdateMsg(Collections.singletonList(ruleChainUpdateMsg)) | |
51 | + .addRuleChainUpdateMsg(ruleChainUpdateMsg) | |
54 | 52 | .build(); |
55 | 53 | } |
56 | 54 | break; |
... | ... | @@ -58,7 +56,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor { |
58 | 56 | case UNASSIGNED_FROM_EDGE: |
59 | 57 | downlinkMsg = DownlinkMsg.newBuilder() |
60 | 58 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
61 | - .addAllRuleChainUpdateMsg(Collections.singletonList(ruleChainMsgConstructor.constructRuleChainDeleteMsg(ruleChainId))) | |
59 | + .addRuleChainUpdateMsg(ruleChainMsgConstructor.constructRuleChainDeleteMsg(ruleChainId)) | |
62 | 60 | .build(); |
63 | 61 | break; |
64 | 62 | } |
... | ... | @@ -76,7 +74,7 @@ public class RuleChainEdgeProcessor extends BaseEdgeProcessor { |
76 | 74 | if (ruleChainMetadataUpdateMsg != null) { |
77 | 75 | downlinkMsg = DownlinkMsg.newBuilder() |
78 | 76 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
79 | - .addAllRuleChainMetadataUpdateMsg(Collections.singletonList(ruleChainMetadataUpdateMsg)) | |
77 | + .addRuleChainMetadataUpdateMsg(ruleChainMetadataUpdateMsg) | |
80 | 78 | .build(); |
81 | 79 | } |
82 | 80 | } | ... | ... |
... | ... | @@ -65,7 +65,6 @@ import org.thingsboard.server.queue.util.TbCoreComponent; |
65 | 65 | |
66 | 66 | import javax.annotation.Nullable; |
67 | 67 | import java.util.ArrayList; |
68 | -import java.util.Collections; | |
69 | 68 | import java.util.HashSet; |
70 | 69 | import java.util.List; |
71 | 70 | import java.util.Set; |
... | ... | @@ -323,7 +322,7 @@ public class TelemetryEdgeProcessor extends BaseEdgeProcessor { |
323 | 322 | EntityDataProto entityDataProto = entityDataMsgConstructor.constructEntityDataMsg(entityId, actionType, entityData); |
324 | 323 | return DownlinkMsg.newBuilder() |
325 | 324 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
326 | - .addAllEntityData(Collections.singletonList(entityDataProto)) | |
325 | + .addEntityData(entityDataProto) | |
327 | 326 | .build(); |
328 | 327 | } |
329 | 328 | ... | ... |
... | ... | @@ -30,8 +30,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
30 | 30 | import org.thingsboard.server.gen.edge.v1.UserCredentialsUpdateMsg; |
31 | 31 | import org.thingsboard.server.queue.util.TbCoreComponent; |
32 | 32 | |
33 | -import java.util.Collections; | |
34 | - | |
35 | 33 | @Component |
36 | 34 | @Slf4j |
37 | 35 | @TbCoreComponent |
... | ... | @@ -48,14 +46,14 @@ public class UserEdgeProcessor extends BaseEdgeProcessor { |
48 | 46 | CustomerId customerId = getCustomerIdIfEdgeAssignedToCustomer(user, edge); |
49 | 47 | downlinkMsg = DownlinkMsg.newBuilder() |
50 | 48 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
51 | - .addAllUserUpdateMsg(Collections.singletonList(userMsgConstructor.constructUserUpdatedMsg(msgType, user, customerId))) | |
49 | + .addUserUpdateMsg(userMsgConstructor.constructUserUpdatedMsg(msgType, user, customerId)) | |
52 | 50 | .build(); |
53 | 51 | } |
54 | 52 | break; |
55 | 53 | case DELETED: |
56 | 54 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 55 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllUserUpdateMsg(Collections.singletonList(userMsgConstructor.constructUserDeleteMsg(userId))) | |
56 | + .addUserUpdateMsg(userMsgConstructor.constructUserDeleteMsg(userId)) | |
59 | 57 | .build(); |
60 | 58 | break; |
61 | 59 | case CREDENTIALS_UPDATED: |
... | ... | @@ -65,7 +63,7 @@ public class UserEdgeProcessor extends BaseEdgeProcessor { |
65 | 63 | userMsgConstructor.constructUserCredentialsUpdatedMsg(userCredentialsByUserId); |
66 | 64 | downlinkMsg = DownlinkMsg.newBuilder() |
67 | 65 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
68 | - .addAllUserCredentialsUpdateMsg(Collections.singletonList(userCredentialsUpdateMsg)) | |
66 | + .addUserCredentialsUpdateMsg(userCredentialsUpdateMsg) | |
69 | 67 | .build(); |
70 | 68 | } |
71 | 69 | } | ... | ... |
... | ... | @@ -27,8 +27,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
27 | 27 | import org.thingsboard.server.gen.edge.v1.WidgetsBundleUpdateMsg; |
28 | 28 | import org.thingsboard.server.queue.util.TbCoreComponent; |
29 | 29 | |
30 | -import java.util.Collections; | |
31 | - | |
32 | 30 | @Component |
33 | 31 | @Slf4j |
34 | 32 | @TbCoreComponent |
... | ... | @@ -46,7 +44,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor { |
46 | 44 | widgetsBundleMsgConstructor.constructWidgetsBundleUpdateMsg(msgType, widgetsBundle); |
47 | 45 | downlinkMsg = DownlinkMsg.newBuilder() |
48 | 46 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
49 | - .addAllWidgetsBundleUpdateMsg(Collections.singletonList(widgetsBundleUpdateMsg)) | |
47 | + .addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg) | |
50 | 48 | .build(); |
51 | 49 | } |
52 | 50 | break; |
... | ... | @@ -55,7 +53,7 @@ public class WidgetBundleEdgeProcessor extends BaseEdgeProcessor { |
55 | 53 | widgetsBundleMsgConstructor.constructWidgetsBundleDeleteMsg(widgetsBundleId); |
56 | 54 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 55 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllWidgetsBundleUpdateMsg(Collections.singletonList(widgetsBundleUpdateMsg)) | |
56 | + .addWidgetsBundleUpdateMsg(widgetsBundleUpdateMsg) | |
59 | 57 | .build(); |
60 | 58 | break; |
61 | 59 | } | ... | ... |
... | ... | @@ -27,8 +27,6 @@ import org.thingsboard.server.gen.edge.v1.UpdateMsgType; |
27 | 27 | import org.thingsboard.server.gen.edge.v1.WidgetTypeUpdateMsg; |
28 | 28 | import org.thingsboard.server.queue.util.TbCoreComponent; |
29 | 29 | |
30 | -import java.util.Collections; | |
31 | - | |
32 | 30 | @Component |
33 | 31 | @Slf4j |
34 | 32 | @TbCoreComponent |
... | ... | @@ -46,7 +44,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor { |
46 | 44 | widgetTypeMsgConstructor.constructWidgetTypeUpdateMsg(msgType, widgetType); |
47 | 45 | downlinkMsg = DownlinkMsg.newBuilder() |
48 | 46 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
49 | - .addAllWidgetTypeUpdateMsg(Collections.singletonList(widgetTypeUpdateMsg)) | |
47 | + .addWidgetTypeUpdateMsg(widgetTypeUpdateMsg) | |
50 | 48 | .build(); |
51 | 49 | } |
52 | 50 | break; |
... | ... | @@ -55,7 +53,7 @@ public class WidgetTypeEdgeProcessor extends BaseEdgeProcessor { |
55 | 53 | widgetTypeMsgConstructor.constructWidgetTypeDeleteMsg(widgetTypeId); |
56 | 54 | downlinkMsg = DownlinkMsg.newBuilder() |
57 | 55 | .setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
58 | - .addAllWidgetTypeUpdateMsg(Collections.singletonList(widgetTypeUpdateMsg)) | |
56 | + .addWidgetTypeUpdateMsg(widgetTypeUpdateMsg) | |
59 | 57 | .build(); |
60 | 58 | break; |
61 | 59 | } | ... | ... |