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.openflowplugin.applications.topology.lldp;
10 import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
11 import org.opendaylight.yangtools.concepts.ListenerRegistration;
12 import org.opendaylight.yangtools.yang.binding.NotificationListener;
13 import org.slf4j.Logger;
14 import org.slf4j.LoggerFactory;
16 public class LLDPActivator implements AutoCloseable {
17 private static final Logger LOG = LoggerFactory.getLogger(LLDPActivator.class);
19 private static String lldpSecureKey;
21 private final ListenerRegistration<NotificationListener> lldpNotificationRegistration;
23 public LLDPActivator(NotificationProviderService notificationService, LLDPDiscoveryListener lldpDiscoveryListener,
25 lldpSecureKey = secureKey;
27 LOG.info("Starting LLDPActivator with lldpSecureKey: {}", lldpSecureKey);
29 lldpNotificationRegistration = notificationService.registerNotificationListener(lldpDiscoveryListener);
31 LOG.info("LLDPDiscoveryListener started.");
36 lldpNotificationRegistration.close();
38 LOG.info("LLDPDiscoveryListener stopped.");
41 public static String getLldpSecureKey() {