blob: dcf2a3d28b50dcf2b8fbbfd7bfd37217d5076239 [file] [log] [blame]
tom8cc5aa72014-09-19 15:14:43 -07001package org.onlab.onos.store.device.impl;
2
Yuta HIGUCHIf5479702014-09-25 00:09:24 -07003import static com.google.common.base.Predicates.notNull;
Yuta HIGUCHIb5df76d2014-09-27 20:54:00 -07004
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -07005import com.google.common.base.Optional;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -07006import com.google.common.cache.LoadingCache;
Yuta HIGUCHIf5479702014-09-25 00:09:24 -07007import com.google.common.collect.FluentIterable;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -07008import com.google.common.collect.ImmutableList;
9import com.google.common.collect.ImmutableSet;
10import com.google.common.collect.ImmutableSet.Builder;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070011import com.hazelcast.core.IMap;
12import com.hazelcast.core.ISet;
Yuta HIGUCHIf5479702014-09-25 00:09:24 -070013
tom0872a172014-09-23 11:24:26 -070014import org.apache.felix.scr.annotations.Activate;
15import org.apache.felix.scr.annotations.Component;
16import org.apache.felix.scr.annotations.Deactivate;
tom0872a172014-09-23 11:24:26 -070017import org.apache.felix.scr.annotations.Service;
18import org.onlab.onos.net.DefaultDevice;
19import org.onlab.onos.net.DefaultPort;
20import org.onlab.onos.net.Device;
21import org.onlab.onos.net.DeviceId;
tom0872a172014-09-23 11:24:26 -070022import org.onlab.onos.net.Port;
23import org.onlab.onos.net.PortNumber;
24import org.onlab.onos.net.device.DeviceDescription;
25import org.onlab.onos.net.device.DeviceEvent;
26import org.onlab.onos.net.device.DeviceStore;
tom0755a362014-09-24 11:54:43 -070027import org.onlab.onos.net.device.DeviceStoreDelegate;
tom0872a172014-09-23 11:24:26 -070028import org.onlab.onos.net.device.PortDescription;
29import org.onlab.onos.net.provider.ProviderId;
Yuta HIGUCHIb5df76d2014-09-27 20:54:00 -070030import org.onlab.onos.store.common.AbsentInvalidatingLoadingCache;
31import org.onlab.onos.store.common.AbstractHazelcastStore;
32import org.onlab.onos.store.common.OptionalCacheLoader;
tom0872a172014-09-23 11:24:26 -070033import org.slf4j.Logger;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070034
tom0872a172014-09-23 11:24:26 -070035import java.util.ArrayList;
36import java.util.Collections;
37import java.util.HashMap;
38import java.util.HashSet;
39import java.util.Iterator;
40import java.util.List;
41import java.util.Map;
42import java.util.Objects;
43import java.util.Set;
tomca55e642014-09-24 18:28:38 -070044
tom0872a172014-09-23 11:24:26 -070045import static com.google.common.base.Preconditions.checkArgument;
tomb41d1ac2014-09-24 01:51:24 -070046import static com.google.common.cache.CacheBuilder.newBuilder;
tom0872a172014-09-23 11:24:26 -070047import static org.onlab.onos.net.device.DeviceEvent.Type.*;
48import static org.slf4j.LoggerFactory.getLogger;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070049
tom8cc5aa72014-09-19 15:14:43 -070050/**
51 * Manages inventory of infrastructure devices using Hazelcast-backed map.
52 */
53@Component(immediate = true)
54@Service
tom0755a362014-09-24 11:54:43 -070055public class DistributedDeviceStore
Yuta HIGUCHI2e963892014-09-27 13:00:39 -070056 extends AbstractHazelcastStore<DeviceEvent, DeviceStoreDelegate>
tomb41d1ac2014-09-24 01:51:24 -070057 implements DeviceStore {
tom8cc5aa72014-09-19 15:14:43 -070058
59 private final Logger log = getLogger(getClass());
60
61 public static final String DEVICE_NOT_FOUND = "Device with ID %s not found";
62
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070063 // private IMap<DeviceId, DefaultDevice> cache;
64 private IMap<byte[], byte[]> rawDevices;
65 private LoadingCache<DeviceId, Optional<DefaultDevice>> devices;
66
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070067 // private ISet<DeviceId> availableDevices;
68 private ISet<byte[]> availableDevices;
69
70 // TODO DevicePorts is very inefficient consider restructuring.
71 // private IMap<DeviceId, Map<PortNumber, Port>> devicePorts;
72 private IMap<byte[], byte[]> rawDevicePorts;
73 private LoadingCache<DeviceId, Optional<Map<PortNumber, Port>>> devicePorts;
74
Yuta HIGUCHIbb1fc722014-09-24 00:00:13 -070075 @Override
tom8cc5aa72014-09-19 15:14:43 -070076 @Activate
77 public void activate() {
tomb41d1ac2014-09-24 01:51:24 -070078 super.activate();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070079
80 // IMap event handler needs value
81 final boolean includeValue = true;
82
83 // TODO decide on Map name scheme to avoid collision
84 rawDevices = theInstance.getMap("devices");
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070085 final OptionalCacheLoader<DeviceId, DefaultDevice> deviceLoader
tomb41d1ac2014-09-24 01:51:24 -070086 = new OptionalCacheLoader<>(storeService, rawDevices);
87 devices = new AbsentInvalidatingLoadingCache<>(newBuilder().build(deviceLoader));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070088 // refresh/populate cache based on notification from other instance
tomca55e642014-09-24 18:28:38 -070089 rawDevices.addEntryListener(new RemoteDeviceEventHandler(devices), includeValue);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070090
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070091 // TODO cache availableDevices
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070092 availableDevices = theInstance.getSet("availableDevices");
93
94 rawDevicePorts = theInstance.getMap("devicePorts");
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070095 final OptionalCacheLoader<DeviceId, Map<PortNumber, Port>> devicePortLoader
tomb41d1ac2014-09-24 01:51:24 -070096 = new OptionalCacheLoader<>(storeService, rawDevicePorts);
97 devicePorts = new AbsentInvalidatingLoadingCache<>(newBuilder().build(devicePortLoader));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070098 // refresh/populate cache based on notification from other instance
tomca55e642014-09-24 18:28:38 -070099 rawDevicePorts.addEntryListener(new RemotePortEventHandler(devicePorts), includeValue);
100
101 loadDeviceCache();
Yuta HIGUCHIce58fa72014-09-24 22:15:10 -0700102 loadDevicePortsCache();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700103
tomb41d1ac2014-09-24 01:51:24 -0700104 log.info("Started");
tom8cc5aa72014-09-19 15:14:43 -0700105 }
106
107 @Deactivate
108 public void deactivate() {
109 log.info("Stopped");
110 }
111
112 @Override
113 public int getDeviceCount() {
tomca55e642014-09-24 18:28:38 -0700114 return devices.asMap().size();
tom8cc5aa72014-09-19 15:14:43 -0700115 }
116
117 @Override
118 public Iterable<Device> getDevices() {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700119 // TODO builder v.s. copyOf. Guava semms to be using copyOf?
tom0872a172014-09-23 11:24:26 -0700120 Builder<Device> builder = ImmutableSet.builder();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700121 for (Optional<DefaultDevice> e : devices.asMap().values()) {
122 if (e.isPresent()) {
123 builder.add(e.get());
124 }
125 }
126 return builder.build();
tom8cc5aa72014-09-19 15:14:43 -0700127 }
128
tomca55e642014-09-24 18:28:38 -0700129 private void loadDeviceCache() {
Yuta HIGUCHIce58fa72014-09-24 22:15:10 -0700130 for (byte[] keyBytes : rawDevices.keySet()) {
131 final DeviceId id = deserialize(keyBytes);
132 devices.refresh(id);
133 }
134 }
135
136 private void loadDevicePortsCache() {
137 for (byte[] keyBytes : rawDevicePorts.keySet()) {
138 final DeviceId id = deserialize(keyBytes);
139 devicePorts.refresh(id);
tomca55e642014-09-24 18:28:38 -0700140 }
141 }
142
tom8cc5aa72014-09-19 15:14:43 -0700143 @Override
144 public Device getDevice(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700145 // TODO revisit if ignoring exception is safe.
146 return devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700147 }
148
149 @Override
150 public DeviceEvent createOrUpdateDevice(ProviderId providerId, DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700151 DeviceDescription deviceDescription) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700152 DefaultDevice device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700153 if (device == null) {
154 return createDevice(providerId, deviceId, deviceDescription);
155 }
156 return updateDevice(providerId, device, deviceDescription);
157 }
158
159 // Creates the device and returns the appropriate event if necessary.
160 private DeviceEvent createDevice(ProviderId providerId, DeviceId deviceId,
161 DeviceDescription desc) {
162 DefaultDevice device = new DefaultDevice(providerId, deviceId, desc.type(),
163 desc.manufacturer(),
164 desc.hwVersion(), desc.swVersion(),
165 desc.serialNumber());
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700166
tom8cc5aa72014-09-19 15:14:43 -0700167 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700168 final byte[] deviceIdBytes = serialize(deviceId);
169 rawDevices.put(deviceIdBytes, serialize(device));
170 devices.put(deviceId, Optional.of(device));
171
172 availableDevices.add(deviceIdBytes);
tom8cc5aa72014-09-19 15:14:43 -0700173 }
tomca55e642014-09-24 18:28:38 -0700174 return new DeviceEvent(DEVICE_ADDED, device, null);
tom8cc5aa72014-09-19 15:14:43 -0700175 }
176
177 // Updates the device and returns the appropriate event if necessary.
178 private DeviceEvent updateDevice(ProviderId providerId, DefaultDevice device,
179 DeviceDescription desc) {
180 // We allow only certain attributes to trigger update
181 if (!Objects.equals(device.hwVersion(), desc.hwVersion()) ||
tom0872a172014-09-23 11:24:26 -0700182 !Objects.equals(device.swVersion(), desc.swVersion())) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700183
tom8cc5aa72014-09-19 15:14:43 -0700184 DefaultDevice updated = new DefaultDevice(providerId, device.id(),
185 desc.type(),
186 desc.manufacturer(),
187 desc.hwVersion(),
188 desc.swVersion(),
189 desc.serialNumber());
190 synchronized (this) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700191 final byte[] deviceIdBytes = serialize(device.id());
192 rawDevices.put(deviceIdBytes, serialize(updated));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700193 devices.put(device.id(), Optional.of(updated));
194 availableDevices.add(serialize(device.id()));
tom8cc5aa72014-09-19 15:14:43 -0700195 }
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700196 return new DeviceEvent(DeviceEvent.Type.DEVICE_UPDATED, updated, null);
tom8cc5aa72014-09-19 15:14:43 -0700197 }
198
199 // Otherwise merely attempt to change availability
200 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700201 boolean added = availableDevices.add(serialize(device.id()));
tom8cc5aa72014-09-19 15:14:43 -0700202 return !added ? null :
203 new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null);
204 }
205 }
206
207 @Override
208 public DeviceEvent markOffline(DeviceId deviceId) {
209 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700210 Device device = devices.getUnchecked(deviceId).orNull();
211 boolean removed = device != null && availableDevices.remove(serialize(deviceId));
tom8cc5aa72014-09-19 15:14:43 -0700212 return !removed ? null :
213 new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null);
214 }
215 }
216
217 @Override
218 public List<DeviceEvent> updatePorts(DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700219 List<PortDescription> portDescriptions) {
tom8cc5aa72014-09-19 15:14:43 -0700220 List<DeviceEvent> events = new ArrayList<>();
221 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700222 Device device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700223 checkArgument(device != null, DEVICE_NOT_FOUND, deviceId);
224 Map<PortNumber, Port> ports = getPortMap(deviceId);
225
226 // Add new ports
227 Set<PortNumber> processed = new HashSet<>();
228 for (PortDescription portDescription : portDescriptions) {
229 Port port = ports.get(portDescription.portNumber());
230 events.add(port == null ?
231 createPort(device, portDescription, ports) :
232 updatePort(device, port, portDescription, ports));
233 processed.add(portDescription.portNumber());
234 }
235
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700236 updatePortMap(deviceId, ports);
237
tom8cc5aa72014-09-19 15:14:43 -0700238 events.addAll(pruneOldPorts(device, ports, processed));
239 }
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700240 return FluentIterable.from(events).filter(notNull()).toList();
tom8cc5aa72014-09-19 15:14:43 -0700241 }
242
243 // Creates a new port based on the port description adds it to the map and
244 // Returns corresponding event.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700245 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700246 private DeviceEvent createPort(Device device, PortDescription portDescription,
247 Map<PortNumber, Port> ports) {
248 DefaultPort port = new DefaultPort(device, portDescription.portNumber(),
249 portDescription.isEnabled());
250 ports.put(port.number(), port);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700251 updatePortMap(device.id(), ports);
tom8cc5aa72014-09-19 15:14:43 -0700252 return new DeviceEvent(PORT_ADDED, device, port);
253 }
254
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700255 // Checks if the specified port requires update and if so, it replaces the
tom8cc5aa72014-09-19 15:14:43 -0700256 // existing entry in the map and returns corresponding event.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700257 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700258 private DeviceEvent updatePort(Device device, Port port,
259 PortDescription portDescription,
260 Map<PortNumber, Port> ports) {
261 if (port.isEnabled() != portDescription.isEnabled()) {
262 DefaultPort updatedPort =
263 new DefaultPort(device, portDescription.portNumber(),
264 portDescription.isEnabled());
265 ports.put(port.number(), updatedPort);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700266 updatePortMap(device.id(), ports);
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700267 return new DeviceEvent(PORT_UPDATED, device, updatedPort);
tom8cc5aa72014-09-19 15:14:43 -0700268 }
269 return null;
270 }
271
272 // Prunes the specified list of ports based on which ports are in the
273 // processed list and returns list of corresponding events.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700274 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700275 private List<DeviceEvent> pruneOldPorts(Device device,
276 Map<PortNumber, Port> ports,
277 Set<PortNumber> processed) {
278 List<DeviceEvent> events = new ArrayList<>();
279 Iterator<PortNumber> iterator = ports.keySet().iterator();
280 while (iterator.hasNext()) {
281 PortNumber portNumber = iterator.next();
282 if (!processed.contains(portNumber)) {
283 events.add(new DeviceEvent(PORT_REMOVED, device,
284 ports.get(portNumber)));
285 iterator.remove();
286 }
287 }
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700288 if (!events.isEmpty()) {
289 updatePortMap(device.id(), ports);
290 }
tom8cc5aa72014-09-19 15:14:43 -0700291 return events;
292 }
293
294 // Gets the map of ports for the specified device; if one does not already
295 // exist, it creates and registers a new one.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700296 // WARN: returned value is a copy, changes made to the Map
297 // needs to be written back using updatePortMap
298 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700299 private Map<PortNumber, Port> getPortMap(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700300 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700301 if (ports == null) {
302 ports = new HashMap<>();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700303 // this probably is waste of time in most cases.
304 updatePortMap(deviceId, ports);
tom8cc5aa72014-09-19 15:14:43 -0700305 }
306 return ports;
307 }
308
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700309 //@GuardedBy("this")
310 private void updatePortMap(DeviceId deviceId, Map<PortNumber, Port> ports) {
311 rawDevicePorts.put(serialize(deviceId), serialize(ports));
312 devicePorts.put(deviceId, Optional.of(ports));
313 }
314
tom8cc5aa72014-09-19 15:14:43 -0700315 @Override
316 public DeviceEvent updatePortStatus(DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700317 PortDescription portDescription) {
tom8cc5aa72014-09-19 15:14:43 -0700318 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700319 Device device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700320 checkArgument(device != null, DEVICE_NOT_FOUND, deviceId);
321 Map<PortNumber, Port> ports = getPortMap(deviceId);
322 Port port = ports.get(portDescription.portNumber());
323 return updatePort(device, port, portDescription, ports);
324 }
325 }
326
327 @Override
328 public List<Port> getPorts(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700329 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
330 return ports == null ? Collections.<Port>emptyList() : ImmutableList.copyOf(ports.values());
tom8cc5aa72014-09-19 15:14:43 -0700331 }
332
333 @Override
334 public Port getPort(DeviceId deviceId, PortNumber portNumber) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700335 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700336 return ports == null ? null : ports.get(portNumber);
337 }
338
339 @Override
340 public boolean isAvailable(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700341 return availableDevices.contains(serialize(deviceId));
tom8cc5aa72014-09-19 15:14:43 -0700342 }
343
344 @Override
tom8cc5aa72014-09-19 15:14:43 -0700345 public DeviceEvent removeDevice(DeviceId deviceId) {
346 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700347 byte[] deviceIdBytes = serialize(deviceId);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700348
349 // TODO conditional remove?
350 Device device = deserialize(rawDevices.remove(deviceIdBytes));
351 devices.invalidate(deviceId);
tom8cc5aa72014-09-19 15:14:43 -0700352 return device == null ? null :
353 new DeviceEvent(DEVICE_REMOVED, device, null);
354 }
355 }
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700356
tomca55e642014-09-24 18:28:38 -0700357 private class RemoteDeviceEventHandler extends RemoteEventHandler<DeviceId, DefaultDevice> {
358 public RemoteDeviceEventHandler(LoadingCache<DeviceId, Optional<DefaultDevice>> cache) {
359 super(cache);
360 }
361
362 @Override
363 protected void onAdd(DeviceId deviceId, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700364 notifyDelegate(new DeviceEvent(DEVICE_ADDED, device));
tomca55e642014-09-24 18:28:38 -0700365 }
366
367 @Override
368 protected void onRemove(DeviceId deviceId, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700369 notifyDelegate(new DeviceEvent(DEVICE_REMOVED, device));
tomca55e642014-09-24 18:28:38 -0700370 }
371
372 @Override
Yuta HIGUCHIa8a53eb2014-09-25 17:47:55 -0700373 protected void onUpdate(DeviceId deviceId, DefaultDevice oldDevice, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700374 notifyDelegate(new DeviceEvent(DEVICE_UPDATED, device));
tomca55e642014-09-24 18:28:38 -0700375 }
376 }
377
378 private class RemotePortEventHandler extends RemoteEventHandler<DeviceId, Map<PortNumber, Port>> {
379 public RemotePortEventHandler(LoadingCache<DeviceId, Optional<Map<PortNumber, Port>>> cache) {
380 super(cache);
381 }
382
383 @Override
384 protected void onAdd(DeviceId deviceId, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700385// notifyDelegate(new DeviceEvent(PORT_ADDED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700386 }
387
388 @Override
389 protected void onRemove(DeviceId deviceId, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700390// notifyDelegate(new DeviceEvent(PORT_REMOVED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700391 }
392
393 @Override
Yuta HIGUCHIa8a53eb2014-09-25 17:47:55 -0700394 protected void onUpdate(DeviceId deviceId, Map<PortNumber, Port> oldPorts, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700395// notifyDelegate(new DeviceEvent(PORT_UPDATED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700396 }
397 }
398
399
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700400 // TODO cache serialized DeviceID if we suffer from serialization cost
tom8cc5aa72014-09-19 15:14:43 -0700401}