Adding support for link state to GUI.
Change-Id: I6476cf04810f7bc7e88af629a36ce671b42748d0
diff --git a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java
index 2f8fbd2..ba1cafb 100644
--- a/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java
+++ b/core/store/trivial/src/main/java/org/onlab/onos/store/trivial/impl/SimpleHostStore.java
@@ -15,6 +15,7 @@
*/
package org.onlab.onos.store.trivial.impl;
+import static org.onlab.onos.net.DefaultAnnotations.merge;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED;
import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED;
@@ -33,6 +34,7 @@
import org.apache.felix.scr.annotations.Service;
import org.onlab.onos.net.Annotations;
import org.onlab.onos.net.ConnectPoint;
+import org.onlab.onos.net.DefaultAnnotations;
import org.onlab.onos.net.DefaultHost;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.Host;
@@ -106,7 +108,8 @@
descr.hwAddress(),
descr.vlan(),
descr.location(),
- ImmutableSet.copyOf(descr.ipAddress()));
+ ImmutableSet.copyOf(descr.ipAddress()),
+ descr.annotations());
synchronized (this) {
hosts.put(hostId, newhost);
locations.put(descr.location(), newhost);
@@ -123,15 +126,19 @@
return new HostEvent(HOST_MOVED, host);
}
- if (host.ipAddresses().containsAll(descr.ipAddress())) {
+ if (host.ipAddresses().containsAll(descr.ipAddress()) &&
+ descr.annotations().keys().isEmpty()) {
return null;
}
Set<IpAddress> addresses = new HashSet<>(host.ipAddresses());
addresses.addAll(descr.ipAddress());
+ Annotations annotations = merge((DefaultAnnotations) host.annotations(),
+ descr.annotations());
StoredHost updated = new StoredHost(providerId, host.id(),
host.mac(), host.vlan(),
- descr.location(), addresses);
+ descr.location(), addresses,
+ annotations);
event = new HostEvent(HOST_UPDATED, updated);
synchronized (this) {
hosts.put(host.id(), updated);