2 * Copyright © 2017 AT&T 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
9 package org.opendaylight.transportpce.networkmodel.listeners;
11 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.LldpNbrInfoChange;
12 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.OrgOpenroadmLldpListener;
13 import org.opendaylight.yang.gen.v1.http.org.openroadm.resource.types.rev161014.ResourceNotificationType;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev150608.NodeId;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
18 public class LldpListener implements OrgOpenroadmLldpListener {
20 private static final Logger LOG = LoggerFactory.getLogger(LldpListener.class);
21 //private final R2RLinkDiscovery linkDiscovery;
22 private final NodeId nodeId;
24 public LldpListener(final String nodeId) {
25 this.nodeId = new NodeId(nodeId);
29 * Callback for lldp-nbr-info-change.
30 * @param notification LldpNbrInfoChange object
33 public void onLldpNbrInfoChange(LldpNbrInfoChange notification) {
34 LOG.info("Notification {} received {}", LldpNbrInfoChange.QNAME, notification);
35 if (notification.getNotificationType().equals(ResourceNotificationType.ResourceCreation)) {
36 /*linkDiscovery.createR2RLink(nodeId,notification.getResource(),
37 notification.getNbrInfo().getRemoteSysName(),
38 notification.getNbrInfo().getRemotePortId());*/
39 } else if (notification.getNotificationType().equals(ResourceNotificationType.ResourceDeletion)) {
40 /*linkDiscovery.deleteR2RLink(nodeId,notification.getResource(),
41 notification.getNbrInfo().getRemoteSysName(),
42 notification.getNbrInfo().getRemotePortId());*/