2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.md.controller.topology.lldp
10 import org.opendaylight.controller.sal.binding.api.NotificationProviderService
11 import org.opendaylight.controller.sal.binding.api.data.DataProviderService
12 import org.opendaylight.yangtools.concepts.Registration
13 import org.opendaylight.yangtools.yang.binding.NotificationListener
14 import org.slf4j.LoggerFactory
16 class LLDPDiscoveryProvider implements AutoCloseable {
19 static val LOG = LoggerFactory.getLogger(LLDPDiscoveryProvider);
22 DataProviderService dataService;
25 NotificationProviderService notificationService;
27 val LLDPDiscoveryListener commiter = new LLDPDiscoveryListener(this);
29 Registration<NotificationListener> listenerRegistration
32 listenerRegistration = notificationService.registerNotificationListener(commiter);
33 LLDPLinkAger.instance.manager = this;
34 LOG.info("LLDPDiscoveryListener Started.");
39 LOG.info("LLDPDiscoveryListener stopped.");
40 listenerRegistration?.close();
41 LLDPLinkAger.instance.close();