X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fforwardingrulesmanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fforwardingrulesmanager%2Finternal%2FForwardingRulesManagerImpl.java;h=5fbe12bd1ca44218a9629e50489540bd85d83302;hb=refs%2Fchanges%2F49%2F449%2F1;hp=eee08d3a09db224a7ace5793cbbb597b32a5c2fb;hpb=077392a1ab706962b0da04b78a9cae5422e70e6c;p=controller.git diff --git a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java index eee08d3a09..5fbe12bd1c 100644 --- a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java +++ b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java @@ -489,7 +489,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, * @return the status of this request. In case of asynchronous call, it * will contain the unique id assigned to this request */ - private Status removeEntry(FlowEntry flowEntry, boolean async) { + private synchronized Status removeEntry(FlowEntry flowEntry, boolean async) { Status error = new Status(null, null); // Sanity Check @@ -667,7 +667,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, /* * Update the node mapped flows database */ - private void updateNodeFlowsDB(FlowEntryInstall flowEntries, boolean add) { + private synchronized void updateNodeFlowsDB(FlowEntryInstall flowEntries, boolean add) { Node node = flowEntries.getNode(); Set flowEntrylist = this.nodeFlows.get(node); @@ -751,7 +751,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, * entry is effectively present in the local database */ @SuppressWarnings("unused") - private Status removeEntry(Node node, String flowName) { + private synchronized Status removeEntry(Node node, String flowName) { FlowEntryInstall target = null; // Find in database @@ -904,7 +904,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, return modifyFlowEntryAsync(currentFlowEntries.getOriginal(), newone); } else { - return installFlowEntry(newone); + return installFlowEntryAsync(newone); } } @@ -923,7 +923,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, * @return null if not found, otherwise the FlowEntryInstall which contains * the existing flow entry */ - private FlowEntryInstall findMatch(FlowEntry flowEntry, boolean looseCheck) { + private synchronized FlowEntryInstall findMatch(FlowEntry flowEntry, boolean looseCheck) { Flow flow = flowEntry.getFlow(); Match match = flow.getMatch(); short priority = flow.getPriority(); @@ -953,7 +953,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, * merged flow may conflict with an existing old container flows merged flow * on the network node */ - private void updateFlowsContainerFlow() { + private synchronized void updateFlowsContainerFlow() { List oldCouples = new ArrayList(); List toReinstall = new ArrayList(); for (Entry> entry : this.nodeFlows @@ -1041,19 +1041,17 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, @Override public List getFlowEntriesForGroup(String policyName) { - List list = null; + List list = new ArrayList(); if (this.groupFlows != null && this.groupFlows.containsKey(policyName)) { - list = new ArrayList(); for (FlowEntryInstall entries : groupFlows.get(policyName)) { list.add(entries.getOriginal()); } - return new ArrayList(); } return list; } @Override - public void addOutputPort(Node node, String flowName, + public synchronized void addOutputPort(Node node, String flowName, List portList) { Set flowEntryList = this.nodeFlows.get(node); @@ -1083,7 +1081,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, } @Override - public void removeOutputPort(Node node, String flowName, + public synchronized void removeOutputPort(Node node, String flowName, List portList) { Set flowEntryList = this.nodeFlows.get(node); @@ -1118,7 +1116,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, * This function assumes the target flow has only one output port */ @Override - public void replaceOutputPort(Node node, String flowName, + public synchronized void replaceOutputPort(Node node, String flowName, NodeConnector outPort) { FlowEntry currentFlowEntry = null; FlowEntry newFlowEntry = null; @@ -1165,7 +1163,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, } @Override - public NodeConnector getOutputPort(Node node, String flowName) { + public synchronized NodeConnector getOutputPort(Node node, String flowName) { Set flowEntryList = this.nodeFlows.get(node); for (FlowEntryInstall flow : flowEntryList) { @@ -2537,7 +2535,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, } @Override - public void flowErrorReported(Node node, long rid, Object err) { + public synchronized void flowErrorReported(Node node, long rid, Object err) { log.trace("Got error {} for message rid {} from node {}", new Object[] {err, rid, node }); /*