refactoring: - dashboard delete remove generic

This commit is contained in:
nickAS21 2022-05-18 15:56:46 +03:00
parent 647012c2d4
commit 9e70cb362d

View File

@ -81,7 +81,7 @@ public class DefaultTbNotificationEntityService implements TbNotificationEntityS
SecurityUser user, SecurityUser user,
String body, Object... additionalInfo) { String body, Object... additionalInfo) {
logEntityAction(tenantId, originatorId, alarm, customerId, actionType, user, additionalInfo); logEntityAction(tenantId, originatorId, alarm, customerId, actionType, user, additionalInfo);
sendAlarmDeleteNotificationMsg(tenantId, alarm.getId(), alarm, relatedEdgeIds, body); sendAlarmDeleteNotificationMsg(tenantId, alarm, relatedEdgeIds, body);
} }
@Override @Override
@ -228,12 +228,11 @@ public class DefaultTbNotificationEntityService implements TbNotificationEntityS
} }
} }
protected <E extends HasName, I extends EntityId> void sendAlarmDeleteNotificationMsg(TenantId tenantId, I entityId, E entity, protected void sendAlarmDeleteNotificationMsg(TenantId tenantId, Alarm alarm, List<EdgeId> edgeIds, String body) {
List<EdgeId> edgeIds, String body) {
try { try {
sendDeleteNotificationMsg(tenantId, entityId, edgeIds, body); sendDeleteNotificationMsg(tenantId, alarm.getId(), edgeIds, body);
} catch (Exception e) { } catch (Exception e) {
log.warn("Failed to push delete " + entity.getClass().getName() + " msg to core: {}", entity, e); log.warn("Failed to push delete msg to core: {}", alarm, e);
} }
} }
@ -242,7 +241,7 @@ public class DefaultTbNotificationEntityService implements TbNotificationEntityS
try { try {
sendDeleteNotificationMsg(tenantId, entityId, edgeIds, null); sendDeleteNotificationMsg(tenantId, entityId, edgeIds, null);
} catch (Exception e) { } catch (Exception e) {
log.warn("Failed to push delete " + entity.getClass().getName() + " msg to core: {}", entity, e); log.warn("Failed to push delete msg to core: {}", entity, e);
} }
} }