blob: 318657847a01da85dd1f523e7b95f67ae6708f57 [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 HIGUCHIb3b2ac42014-09-21 23:37:11 -07004import com.google.common.base.Optional;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -07005import com.google.common.cache.LoadingCache;
Yuta HIGUCHIf5479702014-09-25 00:09:24 -07006import com.google.common.collect.FluentIterable;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -07007import com.google.common.collect.ImmutableList;
8import com.google.common.collect.ImmutableSet;
9import com.google.common.collect.ImmutableSet.Builder;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070010import com.hazelcast.core.IMap;
11import com.hazelcast.core.ISet;
Yuta HIGUCHIf5479702014-09-25 00:09:24 -070012
tom0872a172014-09-23 11:24:26 -070013import org.apache.felix.scr.annotations.Activate;
14import org.apache.felix.scr.annotations.Component;
15import org.apache.felix.scr.annotations.Deactivate;
tom0872a172014-09-23 11:24:26 -070016import org.apache.felix.scr.annotations.Service;
17import org.onlab.onos.net.DefaultDevice;
18import org.onlab.onos.net.DefaultPort;
19import org.onlab.onos.net.Device;
20import org.onlab.onos.net.DeviceId;
tom0872a172014-09-23 11:24:26 -070021import org.onlab.onos.net.Port;
22import org.onlab.onos.net.PortNumber;
23import org.onlab.onos.net.device.DeviceDescription;
24import org.onlab.onos.net.device.DeviceEvent;
25import org.onlab.onos.net.device.DeviceStore;
tom0755a362014-09-24 11:54:43 -070026import org.onlab.onos.net.device.DeviceStoreDelegate;
tom0872a172014-09-23 11:24:26 -070027import org.onlab.onos.net.device.PortDescription;
28import org.onlab.onos.net.provider.ProviderId;
tom0872a172014-09-23 11:24:26 -070029import org.onlab.onos.store.impl.AbsentInvalidatingLoadingCache;
tomb41d1ac2014-09-24 01:51:24 -070030import org.onlab.onos.store.impl.AbstractDistributedStore;
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070031import org.onlab.onos.store.impl.OptionalCacheLoader;
tom0872a172014-09-23 11:24:26 -070032import org.slf4j.Logger;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070033
tom0872a172014-09-23 11:24:26 -070034import java.util.ArrayList;
35import java.util.Collections;
36import java.util.HashMap;
37import java.util.HashSet;
38import java.util.Iterator;
39import java.util.List;
40import java.util.Map;
41import java.util.Objects;
42import java.util.Set;
tomca55e642014-09-24 18:28:38 -070043
tom0872a172014-09-23 11:24:26 -070044import static com.google.common.base.Preconditions.checkArgument;
tomb41d1ac2014-09-24 01:51:24 -070045import static com.google.common.cache.CacheBuilder.newBuilder;
tom0872a172014-09-23 11:24:26 -070046import static org.onlab.onos.net.device.DeviceEvent.Type.*;
47import static org.slf4j.LoggerFactory.getLogger;
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070048
tom8cc5aa72014-09-19 15:14:43 -070049/**
50 * Manages inventory of infrastructure devices using Hazelcast-backed map.
51 */
52@Component(immediate = true)
53@Service
tom0755a362014-09-24 11:54:43 -070054public class DistributedDeviceStore
55 extends AbstractDistributedStore<DeviceEvent, DeviceStoreDelegate>
tomb41d1ac2014-09-24 01:51:24 -070056 implements DeviceStore {
tom8cc5aa72014-09-19 15:14:43 -070057
58 private final Logger log = getLogger(getClass());
59
60 public static final String DEVICE_NOT_FOUND = "Device with ID %s not found";
61
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070062 // private IMap<DeviceId, DefaultDevice> cache;
63 private IMap<byte[], byte[]> rawDevices;
64 private LoadingCache<DeviceId, Optional<DefaultDevice>> devices;
65
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070066 // private ISet<DeviceId> availableDevices;
67 private ISet<byte[]> availableDevices;
68
69 // TODO DevicePorts is very inefficient consider restructuring.
70 // private IMap<DeviceId, Map<PortNumber, Port>> devicePorts;
71 private IMap<byte[], byte[]> rawDevicePorts;
72 private LoadingCache<DeviceId, Optional<Map<PortNumber, Port>>> devicePorts;
73
Yuta HIGUCHIbb1fc722014-09-24 00:00:13 -070074 @Override
tom8cc5aa72014-09-19 15:14:43 -070075 @Activate
76 public void activate() {
tomb41d1ac2014-09-24 01:51:24 -070077 super.activate();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070078
79 // IMap event handler needs value
80 final boolean includeValue = true;
81
82 // TODO decide on Map name scheme to avoid collision
83 rawDevices = theInstance.getMap("devices");
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070084 final OptionalCacheLoader<DeviceId, DefaultDevice> deviceLoader
tomb41d1ac2014-09-24 01:51:24 -070085 = new OptionalCacheLoader<>(storeService, rawDevices);
86 devices = new AbsentInvalidatingLoadingCache<>(newBuilder().build(deviceLoader));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070087 // refresh/populate cache based on notification from other instance
tomca55e642014-09-24 18:28:38 -070088 rawDevices.addEntryListener(new RemoteDeviceEventHandler(devices), includeValue);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070089
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070090 // TODO cache availableDevices
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070091 availableDevices = theInstance.getSet("availableDevices");
92
93 rawDevicePorts = theInstance.getMap("devicePorts");
Yuta HIGUCHI951e7902014-09-23 14:45:11 -070094 final OptionalCacheLoader<DeviceId, Map<PortNumber, Port>> devicePortLoader
tomb41d1ac2014-09-24 01:51:24 -070095 = new OptionalCacheLoader<>(storeService, rawDevicePorts);
96 devicePorts = new AbsentInvalidatingLoadingCache<>(newBuilder().build(devicePortLoader));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -070097 // refresh/populate cache based on notification from other instance
tomca55e642014-09-24 18:28:38 -070098 rawDevicePorts.addEntryListener(new RemotePortEventHandler(devicePorts), includeValue);
99
100 loadDeviceCache();
Yuta HIGUCHIce58fa72014-09-24 22:15:10 -0700101 loadDevicePortsCache();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700102
tomb41d1ac2014-09-24 01:51:24 -0700103 log.info("Started");
tom8cc5aa72014-09-19 15:14:43 -0700104 }
105
106 @Deactivate
107 public void deactivate() {
108 log.info("Stopped");
109 }
110
111 @Override
112 public int getDeviceCount() {
tomca55e642014-09-24 18:28:38 -0700113 return devices.asMap().size();
tom8cc5aa72014-09-19 15:14:43 -0700114 }
115
116 @Override
117 public Iterable<Device> getDevices() {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700118 // TODO builder v.s. copyOf. Guava semms to be using copyOf?
tom0872a172014-09-23 11:24:26 -0700119 Builder<Device> builder = ImmutableSet.builder();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700120 for (Optional<DefaultDevice> e : devices.asMap().values()) {
121 if (e.isPresent()) {
122 builder.add(e.get());
123 }
124 }
125 return builder.build();
tom8cc5aa72014-09-19 15:14:43 -0700126 }
127
tomca55e642014-09-24 18:28:38 -0700128 private void loadDeviceCache() {
Yuta HIGUCHIce58fa72014-09-24 22:15:10 -0700129 for (byte[] keyBytes : rawDevices.keySet()) {
130 final DeviceId id = deserialize(keyBytes);
131 devices.refresh(id);
132 }
133 }
134
135 private void loadDevicePortsCache() {
136 for (byte[] keyBytes : rawDevicePorts.keySet()) {
137 final DeviceId id = deserialize(keyBytes);
138 devicePorts.refresh(id);
tomca55e642014-09-24 18:28:38 -0700139 }
140 }
141
tom8cc5aa72014-09-19 15:14:43 -0700142 @Override
143 public Device getDevice(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700144 // TODO revisit if ignoring exception is safe.
145 return devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700146 }
147
148 @Override
149 public DeviceEvent createOrUpdateDevice(ProviderId providerId, DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700150 DeviceDescription deviceDescription) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700151 DefaultDevice device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700152 if (device == null) {
153 return createDevice(providerId, deviceId, deviceDescription);
154 }
155 return updateDevice(providerId, device, deviceDescription);
156 }
157
158 // Creates the device and returns the appropriate event if necessary.
159 private DeviceEvent createDevice(ProviderId providerId, DeviceId deviceId,
160 DeviceDescription desc) {
161 DefaultDevice device = new DefaultDevice(providerId, deviceId, desc.type(),
162 desc.manufacturer(),
163 desc.hwVersion(), desc.swVersion(),
164 desc.serialNumber());
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700165
tom8cc5aa72014-09-19 15:14:43 -0700166 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700167 final byte[] deviceIdBytes = serialize(deviceId);
168 rawDevices.put(deviceIdBytes, serialize(device));
169 devices.put(deviceId, Optional.of(device));
170
171 availableDevices.add(deviceIdBytes);
tom8cc5aa72014-09-19 15:14:43 -0700172 }
tomca55e642014-09-24 18:28:38 -0700173 return new DeviceEvent(DEVICE_ADDED, device, null);
tom8cc5aa72014-09-19 15:14:43 -0700174 }
175
176 // Updates the device and returns the appropriate event if necessary.
177 private DeviceEvent updateDevice(ProviderId providerId, DefaultDevice device,
178 DeviceDescription desc) {
179 // We allow only certain attributes to trigger update
180 if (!Objects.equals(device.hwVersion(), desc.hwVersion()) ||
tom0872a172014-09-23 11:24:26 -0700181 !Objects.equals(device.swVersion(), desc.swVersion())) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700182
tom8cc5aa72014-09-19 15:14:43 -0700183 DefaultDevice updated = new DefaultDevice(providerId, device.id(),
184 desc.type(),
185 desc.manufacturer(),
186 desc.hwVersion(),
187 desc.swVersion(),
188 desc.serialNumber());
189 synchronized (this) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700190 final byte[] deviceIdBytes = serialize(device.id());
191 rawDevices.put(deviceIdBytes, serialize(updated));
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700192 devices.put(device.id(), Optional.of(updated));
193 availableDevices.add(serialize(device.id()));
tom8cc5aa72014-09-19 15:14:43 -0700194 }
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700195 return new DeviceEvent(DeviceEvent.Type.DEVICE_UPDATED, updated, null);
tom8cc5aa72014-09-19 15:14:43 -0700196 }
197
198 // Otherwise merely attempt to change availability
199 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700200 boolean added = availableDevices.add(serialize(device.id()));
tom8cc5aa72014-09-19 15:14:43 -0700201 return !added ? null :
202 new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null);
203 }
204 }
205
206 @Override
207 public DeviceEvent markOffline(DeviceId deviceId) {
208 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700209 Device device = devices.getUnchecked(deviceId).orNull();
210 boolean removed = device != null && availableDevices.remove(serialize(deviceId));
tom8cc5aa72014-09-19 15:14:43 -0700211 return !removed ? null :
212 new DeviceEvent(DEVICE_AVAILABILITY_CHANGED, device, null);
213 }
214 }
215
216 @Override
217 public List<DeviceEvent> updatePorts(DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700218 List<PortDescription> portDescriptions) {
tom8cc5aa72014-09-19 15:14:43 -0700219 List<DeviceEvent> events = new ArrayList<>();
220 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700221 Device device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700222 checkArgument(device != null, DEVICE_NOT_FOUND, deviceId);
223 Map<PortNumber, Port> ports = getPortMap(deviceId);
224
225 // Add new ports
226 Set<PortNumber> processed = new HashSet<>();
227 for (PortDescription portDescription : portDescriptions) {
228 Port port = ports.get(portDescription.portNumber());
229 events.add(port == null ?
230 createPort(device, portDescription, ports) :
231 updatePort(device, port, portDescription, ports));
232 processed.add(portDescription.portNumber());
233 }
234
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700235 updatePortMap(deviceId, ports);
236
tom8cc5aa72014-09-19 15:14:43 -0700237 events.addAll(pruneOldPorts(device, ports, processed));
238 }
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700239 return FluentIterable.from(events).filter(notNull()).toList();
tom8cc5aa72014-09-19 15:14:43 -0700240 }
241
242 // Creates a new port based on the port description adds it to the map and
243 // Returns corresponding event.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700244 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700245 private DeviceEvent createPort(Device device, PortDescription portDescription,
246 Map<PortNumber, Port> ports) {
247 DefaultPort port = new DefaultPort(device, portDescription.portNumber(),
248 portDescription.isEnabled());
249 ports.put(port.number(), port);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700250 updatePortMap(device.id(), ports);
tom8cc5aa72014-09-19 15:14:43 -0700251 return new DeviceEvent(PORT_ADDED, device, port);
252 }
253
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700254 // Checks if the specified port requires update and if so, it replaces the
tom8cc5aa72014-09-19 15:14:43 -0700255 // existing entry in the map and returns corresponding event.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700256 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700257 private DeviceEvent updatePort(Device device, Port port,
258 PortDescription portDescription,
259 Map<PortNumber, Port> ports) {
260 if (port.isEnabled() != portDescription.isEnabled()) {
261 DefaultPort updatedPort =
262 new DefaultPort(device, portDescription.portNumber(),
263 portDescription.isEnabled());
264 ports.put(port.number(), updatedPort);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700265 updatePortMap(device.id(), ports);
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700266 return new DeviceEvent(PORT_UPDATED, device, updatedPort);
tom8cc5aa72014-09-19 15:14:43 -0700267 }
268 return null;
269 }
270
271 // Prunes the specified list of ports based on which ports are in the
272 // processed list and returns list of corresponding events.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700273 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700274 private List<DeviceEvent> pruneOldPorts(Device device,
275 Map<PortNumber, Port> ports,
276 Set<PortNumber> processed) {
277 List<DeviceEvent> events = new ArrayList<>();
278 Iterator<PortNumber> iterator = ports.keySet().iterator();
279 while (iterator.hasNext()) {
280 PortNumber portNumber = iterator.next();
281 if (!processed.contains(portNumber)) {
282 events.add(new DeviceEvent(PORT_REMOVED, device,
283 ports.get(portNumber)));
284 iterator.remove();
285 }
286 }
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700287 if (!events.isEmpty()) {
288 updatePortMap(device.id(), ports);
289 }
tom8cc5aa72014-09-19 15:14:43 -0700290 return events;
291 }
292
293 // Gets the map of ports for the specified device; if one does not already
294 // exist, it creates and registers a new one.
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700295 // WARN: returned value is a copy, changes made to the Map
296 // needs to be written back using updatePortMap
297 //@GuardedBy("this")
tom8cc5aa72014-09-19 15:14:43 -0700298 private Map<PortNumber, Port> getPortMap(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700299 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700300 if (ports == null) {
301 ports = new HashMap<>();
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700302 // this probably is waste of time in most cases.
303 updatePortMap(deviceId, ports);
tom8cc5aa72014-09-19 15:14:43 -0700304 }
305 return ports;
306 }
307
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700308 //@GuardedBy("this")
309 private void updatePortMap(DeviceId deviceId, Map<PortNumber, Port> ports) {
310 rawDevicePorts.put(serialize(deviceId), serialize(ports));
311 devicePorts.put(deviceId, Optional.of(ports));
312 }
313
tom8cc5aa72014-09-19 15:14:43 -0700314 @Override
315 public DeviceEvent updatePortStatus(DeviceId deviceId,
tom0872a172014-09-23 11:24:26 -0700316 PortDescription portDescription) {
tom8cc5aa72014-09-19 15:14:43 -0700317 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700318 Device device = devices.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700319 checkArgument(device != null, DEVICE_NOT_FOUND, deviceId);
320 Map<PortNumber, Port> ports = getPortMap(deviceId);
321 Port port = ports.get(portDescription.portNumber());
322 return updatePort(device, port, portDescription, ports);
323 }
324 }
325
326 @Override
327 public List<Port> getPorts(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700328 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
329 return ports == null ? Collections.<Port>emptyList() : ImmutableList.copyOf(ports.values());
tom8cc5aa72014-09-19 15:14:43 -0700330 }
331
332 @Override
333 public Port getPort(DeviceId deviceId, PortNumber portNumber) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700334 Map<PortNumber, Port> ports = devicePorts.getUnchecked(deviceId).orNull();
tom8cc5aa72014-09-19 15:14:43 -0700335 return ports == null ? null : ports.get(portNumber);
336 }
337
338 @Override
339 public boolean isAvailable(DeviceId deviceId) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700340 return availableDevices.contains(serialize(deviceId));
tom8cc5aa72014-09-19 15:14:43 -0700341 }
342
343 @Override
tom8cc5aa72014-09-19 15:14:43 -0700344 public DeviceEvent removeDevice(DeviceId deviceId) {
345 synchronized (this) {
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700346 byte[] deviceIdBytes = serialize(deviceId);
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700347
348 // TODO conditional remove?
349 Device device = deserialize(rawDevices.remove(deviceIdBytes));
350 devices.invalidate(deviceId);
tom8cc5aa72014-09-19 15:14:43 -0700351 return device == null ? null :
352 new DeviceEvent(DEVICE_REMOVED, device, null);
353 }
354 }
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700355
tomca55e642014-09-24 18:28:38 -0700356 private class RemoteDeviceEventHandler extends RemoteEventHandler<DeviceId, DefaultDevice> {
357 public RemoteDeviceEventHandler(LoadingCache<DeviceId, Optional<DefaultDevice>> cache) {
358 super(cache);
359 }
360
361 @Override
362 protected void onAdd(DeviceId deviceId, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700363 notifyDelegate(new DeviceEvent(DEVICE_ADDED, device));
tomca55e642014-09-24 18:28:38 -0700364 }
365
366 @Override
367 protected void onRemove(DeviceId deviceId, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700368 notifyDelegate(new DeviceEvent(DEVICE_REMOVED, device));
tomca55e642014-09-24 18:28:38 -0700369 }
370
371 @Override
Yuta HIGUCHIa8a53eb2014-09-25 17:47:55 -0700372 protected void onUpdate(DeviceId deviceId, DefaultDevice oldDevice, DefaultDevice device) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700373 notifyDelegate(new DeviceEvent(DEVICE_UPDATED, device));
tomca55e642014-09-24 18:28:38 -0700374 }
375 }
376
377 private class RemotePortEventHandler extends RemoteEventHandler<DeviceId, Map<PortNumber, Port>> {
378 public RemotePortEventHandler(LoadingCache<DeviceId, Optional<Map<PortNumber, Port>>> cache) {
379 super(cache);
380 }
381
382 @Override
383 protected void onAdd(DeviceId deviceId, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700384// notifyDelegate(new DeviceEvent(PORT_ADDED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700385 }
386
387 @Override
388 protected void onRemove(DeviceId deviceId, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700389// notifyDelegate(new DeviceEvent(PORT_REMOVED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700390 }
391
392 @Override
Yuta HIGUCHIa8a53eb2014-09-25 17:47:55 -0700393 protected void onUpdate(DeviceId deviceId, Map<PortNumber, Port> oldPorts, Map<PortNumber, Port> ports) {
Yuta HIGUCHIf5479702014-09-25 00:09:24 -0700394// notifyDelegate(new DeviceEvent(PORT_UPDATED, getDevice(deviceId)));
tomca55e642014-09-24 18:28:38 -0700395 }
396 }
397
398
Yuta HIGUCHIb3b2ac42014-09-21 23:37:11 -0700399 // TODO cache serialized DeviceID if we suffer from serialization cost
tom8cc5aa72014-09-19 15:14:43 -0700400}