X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FFlowProgrammerNotifier.java;h=dfa2026cddc041ea08b040c33b50ca31de0cc8ca;hb=315a10ec8b79abec3f4d718359ebb4202bffcb11;hp=2a62d6c34a08a19c4cccb898acdf90945ada255b;hpb=ff1b4a79cca00743a00c3b0b1100bd0ab2b2fb31;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerNotifier.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerNotifier.java index 2a62d6c34a..dfa2026cdd 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerNotifier.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerNotifier.java @@ -10,6 +10,7 @@ package org.opendaylight.controller.protocol_plugin.openflow.internal; import org.apache.felix.dm.Component; import org.opendaylight.controller.protocol_plugin.openflow.IFlowProgrammerNotifier; +import org.opendaylight.controller.sal.connection.IPluginOutConnectionService; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.flowprogrammer.Flow; import org.opendaylight.controller.sal.flowprogrammer.IPluginOutFlowProgrammerService; @@ -24,6 +25,7 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier { protected static final Logger logger = LoggerFactory .getLogger(FlowProgrammerNotifier.class); private IPluginOutFlowProgrammerService salNotifier; + private IPluginOutConnectionService connectionOutService; public FlowProgrammerNotifier() { salNotifier = null; @@ -76,6 +78,11 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier { @Override public void flowRemoved(Node node, Flow flow) { + if (!connectionOutService.isLocal(node)) { + logger.debug("flow removed will not be notified in a non-master controller for node "+node); + return; + } + if (salNotifier != null) { salNotifier.flowRemoved(node, flow); } else { @@ -85,6 +92,11 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier { @Override public void flowErrorReported(Node node, long rid, Object err) { + if (!connectionOutService.isLocal(node)) { + logger.debug("flow error will not be notified in a non-master controller for node "+node); + return; + } + if (salNotifier != null) { salNotifier.flowErrorReported(node, rid, err); } else { @@ -92,4 +104,14 @@ public class FlowProgrammerNotifier implements IFlowProgrammerNotifier { } } + void setIPluginOutConnectionService(IPluginOutConnectionService s) { + connectionOutService = s; + } + + void unsetIPluginOutConnectionService(IPluginOutConnectionService s) { + if (connectionOutService == s) { + connectionOutService = null; + } + } + }