Thomas Vachuska
Committed by Gerrit Code Review

Fixing visuals for the SDN-IP demo.

Change-Id: I6f41e6cd72834ece28212de8b5962abaf2d418e4
...@@ -17,6 +17,7 @@ package org.onlab.onos.store.host.impl; ...@@ -17,6 +17,7 @@ package org.onlab.onos.store.host.impl;
17 17
18 import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; 18 import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor;
19 import static org.onlab.onos.cluster.ControllerNodeToNodeId.toNodeId; 19 import static org.onlab.onos.cluster.ControllerNodeToNodeId.toNodeId;
20 +import static org.onlab.onos.net.DefaultAnnotations.merge;
20 import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED; 21 import static org.onlab.onos.net.host.HostEvent.Type.HOST_ADDED;
21 import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED; 22 import static org.onlab.onos.net.host.HostEvent.Type.HOST_MOVED;
22 import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED; 23 import static org.onlab.onos.net.host.HostEvent.Type.HOST_REMOVED;
...@@ -47,6 +48,7 @@ import org.onlab.onos.cluster.ControllerNode; ...@@ -47,6 +48,7 @@ import org.onlab.onos.cluster.ControllerNode;
47 import org.onlab.onos.cluster.NodeId; 48 import org.onlab.onos.cluster.NodeId;
48 import org.onlab.onos.net.Annotations; 49 import org.onlab.onos.net.Annotations;
49 import org.onlab.onos.net.ConnectPoint; 50 import org.onlab.onos.net.ConnectPoint;
51 +import org.onlab.onos.net.DefaultAnnotations;
50 import org.onlab.onos.net.DefaultHost; 52 import org.onlab.onos.net.DefaultHost;
51 import org.onlab.onos.net.DeviceId; 53 import org.onlab.onos.net.DeviceId;
52 import org.onlab.onos.net.Host; 54 import org.onlab.onos.net.Host;
...@@ -237,15 +239,19 @@ public class GossipHostStore ...@@ -237,15 +239,19 @@ public class GossipHostStore
237 return new HostEvent(HOST_MOVED, host); 239 return new HostEvent(HOST_MOVED, host);
238 } 240 }
239 241
240 - if (host.ipAddresses().containsAll(descr.ipAddress())) { 242 + if (host.ipAddresses().containsAll(descr.ipAddress()) &&
243 + descr.annotations().keys().isEmpty()) {
241 return null; 244 return null;
242 } 245 }
243 246
244 Set<IpAddress> addresses = new HashSet<>(host.ipAddresses()); 247 Set<IpAddress> addresses = new HashSet<>(host.ipAddresses());
245 addresses.addAll(descr.ipAddress()); 248 addresses.addAll(descr.ipAddress());
249 + Annotations annotations = merge((DefaultAnnotations) host.annotations(),
250 + descr.annotations());
246 StoredHost updated = new StoredHost(providerId, host.id(), 251 StoredHost updated = new StoredHost(providerId, host.id(),
247 host.mac(), host.vlan(), 252 host.mac(), host.vlan(),
248 - host.location, addresses); 253 + host.location, addresses,
254 + annotations);
249 event = new HostEvent(HOST_UPDATED, updated); 255 event = new HostEvent(HOST_UPDATED, updated);
250 synchronized (this) { 256 synchronized (this) {
251 hosts.put(host.id(), updated); 257 hosts.put(host.id(), updated);
......
...@@ -241,7 +241,7 @@ public abstract class TopologyViewMessages { ...@@ -241,7 +241,7 @@ public abstract class TopologyViewMessages {
241 .put("id", compactLinkString(link)) 241 .put("id", compactLinkString(link))
242 .put("type", link.type().toString().toLowerCase()) 242 .put("type", link.type().toString().toLowerCase())
243 .put("online", link.state() == Link.State.ACTIVE) 243 .put("online", link.state() == Link.State.ACTIVE)
244 - .put("linkWidth", 2) 244 + .put("linkWidth", 1.2)
245 .put("src", link.src().deviceId().toString()) 245 .put("src", link.src().deviceId().toString())
246 .put("srcPort", link.src().port().toString()) 246 .put("srcPort", link.src().port().toString())
247 .put("dst", link.dst().deviceId().toString()) 247 .put("dst", link.dst().deviceId().toString())
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
26 26
27 #topo #map { 27 #topo #map {
28 stroke-width: 2px; 28 stroke-width: 2px;
29 - stroke: #aaaaaa; 29 + stroke: #eee;
30 fill: transparent; 30 fill: transparent;
31 } 31 }
32 32
...@@ -135,15 +135,15 @@ svg .node.host circle { ...@@ -135,15 +135,15 @@ svg .node.host circle {
135 135
136 #topo svg .link.primary { 136 #topo svg .link.primary {
137 stroke: #f11; 137 stroke: #f11;
138 - stroke-width: 6px; 138 + stroke-width: 4px;
139 } 139 }
140 #topo svg .link.secondary { 140 #topo svg .link.secondary {
141 stroke: rgba(255,100,100,0.5); 141 stroke: rgba(255,100,100,0.5);
142 - stroke-width: 4px; 142 + stroke-width: 3px;
143 } 143 }
144 #topo svg .link.animated { 144 #topo svg .link.animated {
145 stroke: #f11; 145 stroke: #f11;
146 - stroke-width: 10px; 146 + stroke-width: 8px;
147 stroke-dasharray: 8 8 147 stroke-dasharray: 8 8
148 } 148 }
149 149
......
...@@ -854,7 +854,7 @@ ...@@ -854,7 +854,7 @@
854 var el = d3.select(this), 854 var el = d3.select(this),
855 img; 855 img;
856 856
857 - $('<img src="img/host.png">').appendTo(el); 857 + $('<img src="img/node.png">').appendTo(el);
858 img = el.select('img') 858 img = el.select('img')
859 .attr({ 859 .attr({
860 width: 30 860 width: 30
......