Browse Source

Minor code cleanup

pull/56/head
Andrew Shvayka 10 years ago
parent
commit
abee0ea2d9
  1. 11
      application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java
  2. 4
      dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java

11
application/src/main/java/org/thingsboard/server/actors/device/DeviceActorMessageProcessor.java

@ -95,12 +95,10 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso
}
private void refreshAttributes(DeviceAttributesEventNotificationMsg msg) {
if (this.deviceAttributes != null) {
if (msg.isDeleted()) {
msg.getDeletedKeys().forEach(key -> deviceAttributes.remove(key));
} else {
deviceAttributes.update(msg.getScope(), msg.getValues());
}
if (msg.isDeleted()) {
msg.getDeletedKeys().forEach(key -> deviceAttributes.remove(key));
} else {
deviceAttributes.update(msg.getScope(), msg.getValues());
}
}
@ -206,7 +204,6 @@ public class DeviceActorMessageProcessor extends AbstractContextAwareMsgProcesso
}
void processAttributesUpdate(ActorContext context, DeviceAttributesEventNotificationMsg msg) {
//TODO: improve this procedure to fetch only changed attributes and support attributes deletion
refreshAttributes(msg);
Set<AttributeKey> keys = msg.getDeletedKeys();
if (attributeSubscriptions.size() > 0) {

4
dao/src/main/java/org/thingsboard/server/dao/timeseries/SimpleListenableFuture.java

@ -22,10 +22,6 @@ import com.google.common.util.concurrent.AbstractFuture;
*/
public class SimpleListenableFuture<V> extends AbstractFuture<V> {
public SimpleListenableFuture() {
}
public boolean set(V value) {
return super.set(value);
}

Loading…
Cancel
Save