Code Review
/
openflowplugin.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Switch to MD-SAL APIs
[openflowplugin.git]
/
applications
/
topology-lldp-discovery
/
src
/
main
/
java
/
org
/
opendaylight
/
openflowplugin
/
applications
/
topology
/
lldp
/
LLDPDiscoveryListener.java
diff --git
a/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java
b/applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java
index b5363da4b78e4f28f5eb78e58b717ce3448d9087..aba6fd942a5305146b90a49002204461c32e9269 100644
(file)
--- a/
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java
+++ b/
applications/topology-lldp-discovery/src/main/java/org/opendaylight/openflowplugin/applications/topology/lldp/LLDPDiscoveryListener.java
@@
-1,4
+1,4
@@
-/*
*
+/*
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@
-10,7
+10,7
@@
package org.opendaylight.openflowplugin.applications.topology.lldp;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.aries.blueprint.annotation.service.Reference;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.aries.blueprint.annotation.service.Reference;
-import org.opendaylight.
controller.sal.binding.api.NotificationProvider
Service;
+import org.opendaylight.
mdsal.binding.api.NotificationPublish
Service;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.openflowplugin.applications.topology.lldp.utils.LLDPDiscoveryUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.opendaylight.openflowplugin.applications.topology.lldp.utils.LLDPDiscoveryUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.topology.discovery.rev130819.LinkDiscovered;
@@
-28,11
+28,11
@@
public class LLDPDiscoveryListener implements PacketProcessingListener {
private static final Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryListener.class);
private final LLDPLinkAger lldpLinkAger;
private static final Logger LOG = LoggerFactory.getLogger(LLDPDiscoveryListener.class);
private final LLDPLinkAger lldpLinkAger;
- private final NotificationP
rovider
Service notificationService;
+ private final NotificationP
ublish
Service notificationService;
private final EntityOwnershipService eos;
@Inject
private final EntityOwnershipService eos;
@Inject
- public LLDPDiscoveryListener(@Reference final NotificationP
rovider
Service notificationService,
+ public LLDPDiscoveryListener(@Reference final NotificationP
ublish
Service notificationService,
final LLDPLinkAger lldpLinkAger, @Reference final EntityOwnershipService entityOwnershipService) {
this.notificationService = notificationService;
this.lldpLinkAger = lldpLinkAger;
final LLDPLinkAger lldpLinkAger, @Reference final EntityOwnershipService entityOwnershipService) {
this.notificationService = notificationService;
this.lldpLinkAger = lldpLinkAger;
@@
-54,7
+54,11
@@
public class LLDPDiscoveryListener implements PacketProcessingListener {
lldpLinkAger.put(ld);
if (LLDPDiscoveryUtils.isEntityOwned(this.eos, nodeKey.getId().getValue())) {
LOG.debug("Publish add event for link {}", ld);
lldpLinkAger.put(ld);
if (LLDPDiscoveryUtils.isEntityOwned(this.eos, nodeKey.getId().getValue())) {
LOG.debug("Publish add event for link {}", ld);
- notificationService.publish(ld);
+ try {
+ notificationService.putNotification(ld);
+ } catch (InterruptedException e) {
+ LOG.warn("Interrupted while publishing notification {}", ld, e);
+ }
} else {
LOG.trace("Skip publishing the add event for link because controller is non-owner of the "
+ "node {}. Link : {}", nodeKey.getId().getValue(), ld);
} else {
LOG.trace("Skip publishing the add event for link because controller is non-owner of the "
+ "node {}. Link : {}", nodeKey.getId().getValue(), ld);