blob: 1d5b8a648946d51a2c6d5a7aba18b247d81c3751 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart4b5bbb52014-02-06 10:09:31 -08002
3import java.util.ArrayList;
4import java.util.Collection;
Jonathan Hart369875b2014-02-13 10:00:31 -08005import java.util.List;
Jonathan Hart4b5bbb52014-02-06 10:09:31 -08006import java.util.Map;
Jonathan Hart369875b2014-02-13 10:00:31 -08007import java.util.concurrent.TimeUnit;
Jonathan Hart4b5bbb52014-02-06 10:09:31 -08008
9import net.floodlightcontroller.core.IFloodlightProviderService;
10import net.floodlightcontroller.core.IOFSwitch;
11import net.floodlightcontroller.core.module.FloodlightModuleContext;
12import net.floodlightcontroller.core.module.FloodlightModuleException;
13import net.floodlightcontroller.core.module.IFloodlightModule;
14import net.floodlightcontroller.core.module.IFloodlightService;
Jonathan Hart369875b2014-02-13 10:00:31 -080015import net.floodlightcontroller.core.util.SingletonTask;
16import net.floodlightcontroller.threadpool.IThreadPoolService;
Jonathan Hart23701d12014-04-03 10:45:48 -070017import net.onrc.onos.core.devicemanager.IOnosDeviceListener;
18import net.onrc.onos.core.devicemanager.IOnosDeviceService;
19import net.onrc.onos.core.devicemanager.OnosDevice;
20import net.onrc.onos.core.linkdiscovery.ILinkDiscoveryListener;
21import net.onrc.onos.core.linkdiscovery.ILinkDiscoveryService;
Jonathan Hart284e70f2014-07-05 12:32:51 -070022import net.onrc.onos.core.linkdiscovery.Link;
Jonathan Hart51f6f5b2014-04-03 10:32:10 -070023import net.onrc.onos.core.main.IOFSwitchPortListener;
Jonathan Hartdeda0ba2014-04-03 11:14:12 -070024import net.onrc.onos.core.registry.IControllerRegistryService;
Jonathan Hartdeda0ba2014-04-03 11:14:12 -070025import net.onrc.onos.core.registry.IControllerRegistryService.ControlChangeCallback;
Jonathan Harta99ec672014-04-03 11:30:34 -070026import net.onrc.onos.core.registry.RegistryException;
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -070027import net.onrc.onos.core.util.Dpid;
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -070028import net.onrc.onos.core.util.PortNumber;
Yuta HIGUCHI5c8cbeb2014-06-27 11:13:48 -070029import net.onrc.onos.core.util.SwitchPort;
Jonathan Hart4b5bbb52014-02-06 10:09:31 -080030
31import org.openflow.protocol.OFPhysicalPort;
Jonathan Hart369875b2014-02-13 10:00:31 -080032import org.openflow.util.HexString;
Toshio Koide2f570c12014-02-06 16:55:32 -080033import org.slf4j.Logger;
34import org.slf4j.LoggerFactory;
Jonathan Hart4b5bbb52014-02-06 10:09:31 -080035
Jonathan Hart88770672014-04-02 18:08:30 -070036/**
Jonathan Harte37e4e22014-05-13 19:12:02 -070037 * The TopologyPublisher subscribes to topology network events from the
38 * discovery modules. These events are reformatted and relayed to the in-memory
39 * topology instance.
Jonathan Hart88770672014-04-02 18:08:30 -070040 */
Jonathan Harte37e4e22014-05-13 19:12:02 -070041public class TopologyPublisher implements /*IOFSwitchListener,*/
Ray Milkey269ffb92014-04-03 14:43:30 -070042 IOFSwitchPortListener,
43 ILinkDiscoveryListener,
44 IFloodlightModule,
45 IOnosDeviceListener {
Jonathan Hart88770672014-04-02 18:08:30 -070046 private static final Logger log =
Jonathan Harte37e4e22014-05-13 19:12:02 -070047 LoggerFactory.getLogger(TopologyPublisher.class);
Yuta HIGUCHIcb951982014-02-11 13:31:44 -080048
Jonathan Hart88770672014-04-02 18:08:30 -070049 private IFloodlightProviderService floodlightProvider;
50 private ILinkDiscoveryService linkDiscovery;
51 private IControllerRegistryService registryService;
Jonathan Harte37e4e22014-05-13 19:12:02 -070052 private ITopologyService topologyService;
Toshio Koide2f570c12014-02-06 16:55:32 -080053
Jonathan Hart88770672014-04-02 18:08:30 -070054 private IOnosDeviceService onosDeviceService;
Jonathan Hartb3e1b052014-04-02 16:01:12 -070055
Jonathan Harte37e4e22014-05-13 19:12:02 -070056 private Topology topology;
57 private TopologyDiscoveryInterface topologyDiscoveryInterface;
Jonathan Hartb3e1b052014-04-02 16:01:12 -070058
Jonathan Hart88770672014-04-02 18:08:30 -070059 private static final String ENABLE_CLEANUP_PROPERTY = "EnableCleanup";
60 private boolean cleanupEnabled = true;
61 private static final int CLEANUP_TASK_INTERVAL = 60; // in seconds
62 private SingletonTask cleanupTask;
Toshio Koide2f570c12014-02-06 16:55:32 -080063
Jonathan Hart369875b2014-02-13 10:00:31 -080064 /**
Jonathan Harte37e4e22014-05-13 19:12:02 -070065 * Cleanup old switches from the topology. Old switches are those
Jonathan Hart88770672014-04-02 18:08:30 -070066 * which have no controller in the registry.
Jonathan Hart369875b2014-02-13 10:00:31 -080067 */
68 private class SwitchCleanup implements ControlChangeCallback, Runnable {
69 @Override
70 public void run() {
71 String old = Thread.currentThread().getName();
72 Thread.currentThread().setName("SwitchCleanup@" + old);
Jonathan Hartb3e1b052014-04-02 16:01:12 -070073
Jonathan Hart369875b2014-02-13 10:00:31 -080074 try {
Jonathan Hart88770672014-04-02 18:08:30 -070075 if (log.isTraceEnabled()) {
76 log.trace("Running cleanup thread");
77 }
Jonathan Hart369875b2014-02-13 10:00:31 -080078 switchCleanup();
Jonathan Hart369875b2014-02-13 10:00:31 -080079 } finally {
80 cleanupTask.reschedule(CLEANUP_TASK_INTERVAL,
Jonathan Hart88770672014-04-02 18:08:30 -070081 TimeUnit.SECONDS);
Jonathan Hart369875b2014-02-13 10:00:31 -080082 Thread.currentThread().setName(old);
83 }
84 }
Jonathan Hartb3e1b052014-04-02 16:01:12 -070085
Jonathan Hart88770672014-04-02 18:08:30 -070086 /**
87 * First half of the switch cleanup operation. This method will attempt
88 * to get control of any switch it sees without a controller via the
89 * registry.
90 */
Jonathan Hart369875b2014-02-13 10:00:31 -080091 private void switchCleanup() {
Jonathan Harte37e4e22014-05-13 19:12:02 -070092 Iterable<Switch> switches = topology.getSwitches();
Jonathan Hart369875b2014-02-13 10:00:31 -080093
Jonathan Hart88770672014-04-02 18:08:30 -070094 if (log.isTraceEnabled()) {
95 log.trace("Checking for inactive switches");
96 }
97 // For each switch check if a controller exists in controller registry
Ray Milkey269ffb92014-04-03 14:43:30 -070098 for (Switch sw : switches) {
Jonathan Hart88770672014-04-02 18:08:30 -070099 try {
100 String controller =
Yuta HIGUCHI8f3dfa32014-06-25 00:14:25 -0700101 registryService.getControllerForSwitch(sw.getDpid().value());
Jonathan Hart88770672014-04-02 18:08:30 -0700102 if (controller == null) {
103 log.debug("Requesting control to set switch {} INACTIVE",
Yuta HIGUCHI8f3dfa32014-06-25 00:14:25 -0700104 sw.getDpid());
105 registryService.requestControl(sw.getDpid().value(), this);
Jonathan Hart88770672014-04-02 18:08:30 -0700106 }
107 } catch (RegistryException e) {
108 log.error("Caught RegistryException in cleanup thread", e);
109 }
110 }
Jonathan Hart369875b2014-02-13 10:00:31 -0800111 }
112
Jonathan Hart88770672014-04-02 18:08:30 -0700113 /**
114 * Second half of the switch cleanup operation. If the registry grants
115 * control of a switch, we can be sure no other instance is writing
Jonathan Harte37e4e22014-05-13 19:12:02 -0700116 * this switch to the topology, so we can remove it now.
Ray Milkey269ffb92014-04-03 14:43:30 -0700117 *
118 * @param dpid the dpid of the switch we requested control for
Jonathan Hart88770672014-04-02 18:08:30 -0700119 * @param hasControl whether we got control or not
120 */
121 @Override
122 public void controlChanged(long dpid, boolean hasControl) {
123 if (hasControl) {
124 log.debug("Got control to set switch {} INACTIVE",
125 HexString.toHexString(dpid));
Jonathan Harte02cf542014-04-02 16:24:44 -0700126
Yuta HIGUCHIe2a4e172014-07-03 10:50:39 -0700127 SwitchEvent switchEvent = new SwitchEvent(new Dpid(dpid));
Jonathan Harte37e4e22014-05-13 19:12:02 -0700128 topologyDiscoveryInterface.
Jonathan Hart88770672014-04-02 18:08:30 -0700129 removeSwitchDiscoveryEvent(switchEvent);
130 registryService.releaseControl(dpid);
131 }
132 }
Jonathan Hart369875b2014-02-13 10:00:31 -0800133 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800134
Jonathan Hart88770672014-04-02 18:08:30 -0700135 @Override
Jonathan Hart284e70f2014-07-05 12:32:51 -0700136 public void linkAdded(Link link) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700137 LinkEvent linkEvent = new LinkEvent(
Jonathan Hart284e70f2014-07-05 12:32:51 -0700138 new SwitchPort(link.getSrc(), link.getSrcPort()),
139 new SwitchPort(link.getDst(), link.getDstPort()));
140
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700141 // FIXME should be merging, with existing attrs, etc..
142 // TODO define attr name as constant somewhere.
143 // TODO populate appropriate attributes.
144 linkEvent.freeze();
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700145
Jonathan Hart284e70f2014-07-05 12:32:51 -0700146 if (!registryService.hasControl(link.getDst())) {
147 // Don't process or send a link event if we're not master for the
148 // destination switch
149 log.debug("Not the master for dst switch {}. Suppressed link add event {}.",
150 link.getDst(), linkEvent);
151 return;
Jonathan Hart88770672014-04-02 18:08:30 -0700152 }
Jonathan Hart284e70f2014-07-05 12:32:51 -0700153 topologyDiscoveryInterface.putLinkDiscoveryEvent(linkEvent);
154 }
155
156 @Override
157 public void linkRemoved(Link link) {
158 LinkEvent linkEvent = new LinkEvent(
159 new SwitchPort(link.getSrc(), link.getSrcPort()),
160 new SwitchPort(link.getDst(), link.getDstPort()));
161
162 // FIXME should be merging, with existing attrs, etc..
163 // TODO define attr name as constant somewhere.
164 // TODO populate appropriate attributes.
165 linkEvent.freeze();
166
167 if (!registryService.hasControl(link.getDst())) {
168 // Don't process or send a link event if we're not master for the
169 // destination switch
170 log.debug("Not the master for dst switch {}. Suppressed link remove event {}.",
171 link.getDst(), linkEvent);
172 return;
173 }
174 topologyDiscoveryInterface.removeLinkDiscoveryEvent(linkEvent);
Jonathan Hart88770672014-04-02 18:08:30 -0700175 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800176
Jonathan Hart88770672014-04-02 18:08:30 -0700177 @Override
178 public void switchPortAdded(Long switchId, OFPhysicalPort port) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700179 final Dpid dpid = new Dpid(switchId);
180 PortEvent portEvent = new PortEvent(dpid, new PortNumber(port.getPortNumber()));
181 // FIXME should be merging, with existing attrs, etc..
182 // TODO define attr name as constant somewhere.
183 // TODO populate appropriate attributes.
184 portEvent.createStringAttribute("name", port.getName());
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700185
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700186 portEvent.freeze();
187
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700188 if (registryService.hasControl(switchId)) {
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700189 topologyDiscoveryInterface.putPortDiscoveryEvent(portEvent);
Jonathan Hart284e70f2014-07-05 12:32:51 -0700190 linkDiscovery.enableDiscoveryOnPort(switchId, port.getPortNumber());
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700191 } else {
192 log.debug("Not the master for switch {}. Suppressed port add event {}.",
193 new Dpid(switchId), portEvent);
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700194 }
Jonathan Hart88770672014-04-02 18:08:30 -0700195 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800196
Jonathan Hart88770672014-04-02 18:08:30 -0700197 @Override
198 public void switchPortRemoved(Long switchId, OFPhysicalPort port) {
Yuta HIGUCHIe2a4e172014-07-03 10:50:39 -0700199 final Dpid dpid = new Dpid(switchId);
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700200
Yuta HIGUCHIe2a4e172014-07-03 10:50:39 -0700201 PortEvent portEvent = new PortEvent(dpid, new PortNumber(port.getPortNumber()));
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700202 if (registryService.hasControl(switchId)) {
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700203 topologyDiscoveryInterface.removePortDiscoveryEvent(portEvent);
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700204 } else {
205 log.debug("Not the master for switch {}. Suppressed port del event {}.",
Yuta HIGUCHIe2a4e172014-07-03 10:50:39 -0700206 dpid, portEvent);
Jonathan Hart67b6cba2014-05-30 22:36:37 -0700207 }
Jonathan Hart88770672014-04-02 18:08:30 -0700208 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800209
Jonathan Hart88770672014-04-02 18:08:30 -0700210 @Override
211 public void addedSwitch(IOFSwitch sw) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700212 final Dpid dpid = new Dpid(sw.getId());
213 SwitchEvent switchEvent = new SwitchEvent(dpid);
214 // FIXME should be merging, with existing attrs, etc..
215 // TODO define attr name as constant somewhere.
216 // TODO populate appropriate attributes.
217 switchEvent.createStringAttribute("ConnectedSince",
218 sw.getConnectedSince().toString());
Toshio Koide2f570c12014-02-06 16:55:32 -0800219
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700220 switchEvent.freeze();
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700221
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700222 // TODO Not very robust
223 if (!registryService.hasControl(sw.getId())) {
224 log.debug("Not the master for switch {}. Suppressed switch add event {}.",
Yuta HIGUCHIe2a4e172014-07-03 10:50:39 -0700225 dpid, switchEvent);
Yuta HIGUCHI5bbbaca2014-06-09 16:39:08 -0700226 return;
227 }
228
Jonathan Hart88770672014-04-02 18:08:30 -0700229 List<PortEvent> portEvents = new ArrayList<PortEvent>();
230 for (OFPhysicalPort port : sw.getPorts()) {
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700231 PortEvent portEvent = new PortEvent(dpid, new PortNumber(port.getPortNumber()));
232 // FIXME should be merging, with existing attrs, etc..
233 // TODO define attr name as constant somewhere.
234 // TODO populate appropriate attributes.
235 portEvent.createStringAttribute("name", port.getName());
236
237 portEvent.freeze();
238 portEvents.add(portEvent);
Jonathan Hart88770672014-04-02 18:08:30 -0700239 }
Jonathan Harte37e4e22014-05-13 19:12:02 -0700240 topologyDiscoveryInterface
Ray Milkey269ffb92014-04-03 14:43:30 -0700241 .putSwitchDiscoveryEvent(switchEvent, portEvents);
Toshio Koide2f570c12014-02-06 16:55:32 -0800242
Jonathan Hart88770672014-04-02 18:08:30 -0700243 for (OFPhysicalPort port : sw.getPorts()) {
244 // Allow links to be discovered on this port now that it's
245 // in the database
Jonathan Hart284e70f2014-07-05 12:32:51 -0700246 linkDiscovery.enableDiscoveryOnPort(sw.getId(), port.getPortNumber());
Jonathan Hart88770672014-04-02 18:08:30 -0700247 }
248 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800249
Jonathan Hart88770672014-04-02 18:08:30 -0700250 @Override
251 public void removedSwitch(IOFSwitch sw) {
252 // We don't use this event - switch remove is done by cleanup thread
253 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800254
Jonathan Hart88770672014-04-02 18:08:30 -0700255 @Override
256 public void switchPortChanged(Long switchId) {
257 // We don't use this event
258 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800259
Jonathan Hart88770672014-04-02 18:08:30 -0700260 @Override
261 public String getName() {
262 // TODO Auto-generated method stub
263 return null;
264 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800265
Jonathan Hart88770672014-04-02 18:08:30 -0700266 /* *****************
267 * IFloodlightModule
268 * *****************/
Toshio Koide2f570c12014-02-06 16:55:32 -0800269
Jonathan Hart88770672014-04-02 18:08:30 -0700270 @Override
271 public Collection<Class<? extends IFloodlightService>> getModuleServices() {
272 return null;
273 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800274
Jonathan Hart88770672014-04-02 18:08:30 -0700275 @Override
276 public Map<Class<? extends IFloodlightService>, IFloodlightService>
277 getServiceImpls() {
278 return null;
279 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800280
Jonathan Hart88770672014-04-02 18:08:30 -0700281 @Override
282 public Collection<Class<? extends IFloodlightService>>
Ray Milkey269ffb92014-04-03 14:43:30 -0700283 getModuleDependencies() {
Jonathan Hart88770672014-04-02 18:08:30 -0700284 Collection<Class<? extends IFloodlightService>> l =
285 new ArrayList<Class<? extends IFloodlightService>>();
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800286 l.add(IFloodlightProviderService.class);
287 l.add(ILinkDiscoveryService.class);
Jonathan Hart369875b2014-02-13 10:00:31 -0800288 l.add(IThreadPoolService.class);
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800289 l.add(IControllerRegistryService.class);
Jonathan Harte37e4e22014-05-13 19:12:02 -0700290 l.add(ITopologyService.class);
Jonathan Hartebbe6a62014-04-02 16:10:25 -0700291 l.add(IOnosDeviceService.class);
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800292 return l;
Jonathan Hart88770672014-04-02 18:08:30 -0700293 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800294
Jonathan Hart88770672014-04-02 18:08:30 -0700295 @Override
296 public void init(FloodlightModuleContext context)
297 throws FloodlightModuleException {
298 floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
299 linkDiscovery = context.getServiceImpl(ILinkDiscoveryService.class);
300 registryService = context.getServiceImpl(IControllerRegistryService.class);
301 onosDeviceService = context.getServiceImpl(IOnosDeviceService.class);
Toshio Koide2f570c12014-02-06 16:55:32 -0800302
Jonathan Harte37e4e22014-05-13 19:12:02 -0700303 topologyService = context.getServiceImpl(ITopologyService.class);
Jonathan Hart88770672014-04-02 18:08:30 -0700304 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800305
Jonathan Hart88770672014-04-02 18:08:30 -0700306 @Override
307 public void startUp(FloodlightModuleContext context) {
308 floodlightProvider.addOFSwitchListener(this);
309 linkDiscovery.addListener(this);
310 onosDeviceService.addOnosDeviceListener(this);
Toshio Koide2f570c12014-02-06 16:55:32 -0800311
Jonathan Harte37e4e22014-05-13 19:12:02 -0700312 topology = topologyService.getTopology();
313 topologyDiscoveryInterface =
314 topologyService.getTopologyDiscoveryInterface();
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700315
Jonathan Hart88770672014-04-02 18:08:30 -0700316 // Run the cleanup thread
317 String enableCleanup =
318 context.getConfigParams(this).get(ENABLE_CLEANUP_PROPERTY);
319 if (enableCleanup != null
320 && enableCleanup.equalsIgnoreCase("false")) {
321 cleanupEnabled = false;
322 }
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700323
Jonathan Hart88770672014-04-02 18:08:30 -0700324 log.debug("Cleanup thread is {}enabled", (cleanupEnabled) ? "" : "not ");
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700325
Jonathan Hart88770672014-04-02 18:08:30 -0700326 if (cleanupEnabled) {
327 IThreadPoolService threadPool =
328 context.getServiceImpl(IThreadPoolService.class);
329 cleanupTask = new SingletonTask(threadPool.getScheduledExecutor(),
330 new SwitchCleanup());
331 // Run the cleanup task immediately on startup
332 cleanupTask.reschedule(0, TimeUnit.SECONDS);
333 }
334 }
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700335
Jonathan Hart88770672014-04-02 18:08:30 -0700336 @Override
337 public void onosDeviceAdded(OnosDevice device) {
338 log.debug("Called onosDeviceAdded mac {}", device.getMacAddress());
TeruUd1c5b652014-03-24 13:58:46 -0700339
TeruU5d2c9392014-06-09 20:02:02 -0700340 SwitchPort sp = new SwitchPort(device.getSwitchDPID(), device.getSwitchPort());
Jonathan Hart88770672014-04-02 18:08:30 -0700341 List<SwitchPort> spLists = new ArrayList<SwitchPort>();
342 spLists.add(sp);
343 DeviceEvent event = new DeviceEvent(device.getMacAddress());
344 event.setAttachmentPoints(spLists);
345 event.setLastSeenTime(device.getLastSeenTimestamp().getTime());
Jonathan Hart88770672014-04-02 18:08:30 -0700346 // Does not use vlan info now.
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700347 event.freeze();
Jonathan Hartb3e1b052014-04-02 16:01:12 -0700348
Jonathan Harte37e4e22014-05-13 19:12:02 -0700349 topologyDiscoveryInterface.putDeviceDiscoveryEvent(event);
Jonathan Hart88770672014-04-02 18:08:30 -0700350 }
TeruUd1c5b652014-03-24 13:58:46 -0700351
Jonathan Hart88770672014-04-02 18:08:30 -0700352 @Override
353 public void onosDeviceRemoved(OnosDevice device) {
354 log.debug("Called onosDeviceRemoved");
355 DeviceEvent event = new DeviceEvent(device.getMacAddress());
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -0700356 // XXX shouldn't we be setting attachment points?
357 event.freeze();
Jonathan Harte37e4e22014-05-13 19:12:02 -0700358 topologyDiscoveryInterface.removeDeviceDiscoveryEvent(event);
Jonathan Hart88770672014-04-02 18:08:30 -0700359 }
Jonathan Hart4b5bbb52014-02-06 10:09:31 -0800360}