|
|
|
@ -84,7 +84,6 @@ public class TbEntityLocalSubsInfo { |
|
|
|
if (!newState.attrAllKeys) { |
|
|
|
if (attrSub.isAllKeys()) { |
|
|
|
newState.attrAllKeys = true; |
|
|
|
newState.attrKeys = null; |
|
|
|
stateChanged = true; |
|
|
|
} else { |
|
|
|
if (newState.attrKeys == null) { |
|
|
|
@ -101,7 +100,6 @@ public class TbEntityLocalSubsInfo { |
|
|
|
if (!newState.tsAllKeys) { |
|
|
|
if (tsSub.isAllKeys()) { |
|
|
|
newState.tsAllKeys = true; |
|
|
|
newState.tsKeys = null; |
|
|
|
stateChanged = true; |
|
|
|
} else { |
|
|
|
if (newState.tsKeys == null) { |
|
|
|
@ -135,30 +133,8 @@ public class TbEntityLocalSubsInfo { |
|
|
|
return toEvent(ComponentLifecycleEvent.DELETED); |
|
|
|
} |
|
|
|
TbSubscriptionsInfo oldState = state.copy(); |
|
|
|
|
|
|
|
//copy unchanged state only
|
|
|
|
TbSubscriptionsInfo newState = state.copy(); |
|
|
|
switch (sub.getType()) { |
|
|
|
case NOTIFICATIONS: |
|
|
|
case NOTIFICATIONS_COUNT: |
|
|
|
newState.notifications = false; |
|
|
|
break; |
|
|
|
case ALARMS: |
|
|
|
newState.alarms = false; |
|
|
|
break; |
|
|
|
case ATTRIBUTES: |
|
|
|
newState.attrAllKeys = false; |
|
|
|
newState.attrKeys = null; |
|
|
|
break; |
|
|
|
case TIMESERIES: |
|
|
|
newState.tsAllKeys = false; |
|
|
|
newState.tsKeys = null; |
|
|
|
} |
|
|
|
|
|
|
|
TbSubscriptionsInfo newState = new TbSubscriptionsInfo(); |
|
|
|
for (TbSubscription<?> subscription : subs) { |
|
|
|
if (subscription.getType() != sub.getType()) { |
|
|
|
continue; // skip unchanged types
|
|
|
|
} |
|
|
|
switch (subscription.getType()) { |
|
|
|
case NOTIFICATIONS: |
|
|
|
case NOTIFICATIONS_COUNT: |
|
|
|
@ -175,7 +151,6 @@ public class TbEntityLocalSubsInfo { |
|
|
|
var attrSub = (TbAttributeSubscription) subscription; |
|
|
|
if (!newState.attrAllKeys && attrSub.isAllKeys()) { |
|
|
|
newState.attrAllKeys = true; |
|
|
|
newState.attrKeys = null; |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (newState.attrKeys == null) { |
|
|
|
@ -188,7 +163,6 @@ public class TbEntityLocalSubsInfo { |
|
|
|
var tsSub = (TbTimeSeriesSubscription) subscription; |
|
|
|
if (!newState.tsAllKeys && tsSub.isAllKeys()) { |
|
|
|
newState.tsAllKeys = true; |
|
|
|
newState.tsKeys = null; |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (newState.tsKeys == null) { |
|
|
|
|