|
|
|
@ -247,6 +247,7 @@ public final class EdgeGrpcSession implements Closeable { |
|
|
|
} |
|
|
|
}, ctx.getGrpcCallbackExecutorService()); |
|
|
|
} else { |
|
|
|
log.info("[{}][{}] sync process completed", this.tenantId, edge.getId()); |
|
|
|
DownlinkMsg syncCompleteDownlinkMsg = DownlinkMsg.newBuilder() |
|
|
|
.setDownlinkMsgId(EdgeUtils.nextPositiveInt()) |
|
|
|
.setSyncCompletedMsg(SyncCompletedMsg.newBuilder().build()) |
|
|
|
@ -325,7 +326,11 @@ public final class EdgeGrpcSession implements Closeable { |
|
|
|
} |
|
|
|
|
|
|
|
private void sendDownlinkMsg(ResponseMsg downlinkMsg) { |
|
|
|
log.trace("[{}][{}] Sending downlink msg [{}]", this.tenantId, this.sessionId, downlinkMsg); |
|
|
|
if (downlinkMsg.getDownlinkMsg().getWidgetTypeUpdateMsgCount() > 0) { |
|
|
|
log.trace("[{}][{}] Sending downlink widgetTypeUpdateMsg, downlinkMsgId = {}", this.tenantId, this.sessionId, downlinkMsg.getDownlinkMsg().getDownlinkMsgId()); |
|
|
|
} else { |
|
|
|
log.trace("[{}][{}] Sending downlink msg [{}]", this.tenantId, this.sessionId, downlinkMsg); |
|
|
|
} |
|
|
|
if (isConnected()) { |
|
|
|
downlinkMsgLock.lock(); |
|
|
|
try { |
|
|
|
@ -337,7 +342,7 @@ public final class EdgeGrpcSession implements Closeable { |
|
|
|
} finally { |
|
|
|
downlinkMsgLock.unlock(); |
|
|
|
} |
|
|
|
log.trace("[{}][{}] Response msg successfully sent [{}]", this.tenantId, this.sessionId, downlinkMsg); |
|
|
|
log.trace("[{}][{}] Response msg successfully sent. downlinkMsgId = {}", this.tenantId, this.sessionId, downlinkMsg.getDownlinkMsg().getDownlinkMsgId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -551,9 +556,13 @@ public final class EdgeGrpcSession implements Closeable { |
|
|
|
DownlinkMsg downlinkMsg = null; |
|
|
|
try { |
|
|
|
switch (edgeEvent.getAction()) { |
|
|
|
case UPDATED, ADDED, DELETED, ASSIGNED_TO_EDGE, UNASSIGNED_FROM_EDGE, ALARM_ACK, ALARM_CLEAR, ALARM_DELETE, CREDENTIALS_UPDATED, RELATION_ADD_OR_UPDATE, RELATION_DELETED, CREDENTIALS_REQUEST, RPC_CALL, ASSIGNED_TO_CUSTOMER, UNASSIGNED_FROM_CUSTOMER, ADDED_COMMENT, UPDATED_COMMENT, DELETED_COMMENT -> { |
|
|
|
case UPDATED, ADDED, DELETED, ASSIGNED_TO_EDGE, UNASSIGNED_FROM_EDGE, ALARM_ACK, ALARM_CLEAR, ALARM_DELETE, CREDENTIALS_UPDATED, RELATION_ADD_OR_UPDATE, RELATION_DELETED, RPC_CALL, ASSIGNED_TO_CUSTOMER, UNASSIGNED_FROM_CUSTOMER, ADDED_COMMENT, UPDATED_COMMENT, DELETED_COMMENT -> { |
|
|
|
downlinkMsg = convertEntityEventToDownlink(edgeEvent); |
|
|
|
log.trace("[{}][{}] entity message processed [{}]", this.tenantId, this.sessionId, downlinkMsg); |
|
|
|
if (downlinkMsg != null && downlinkMsg.getWidgetTypeUpdateMsgCount() > 0) { |
|
|
|
log.trace("[{}][{}] widgetTypeUpdateMsg message processed, downlinkMsgId = {}", this.tenantId, this.sessionId, downlinkMsg.getDownlinkMsgId()); |
|
|
|
} else { |
|
|
|
log.trace("[{}][{}] entity message processed [{}]", this.tenantId, this.sessionId, downlinkMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
case ATTRIBUTES_UPDATED, POST_ATTRIBUTES, ATTRIBUTES_DELETED, TIMESERIES_UPDATED -> |
|
|
|
downlinkMsg = ctx.getTelemetryProcessor().convertTelemetryEventToDownlink(edge, edgeEvent); |
|
|
|
|