Madan Jampani

FlowRuleStore no longer supports applicationId based APIs

......@@ -20,7 +20,6 @@ package org.onlab.onos.net.flow;
import java.util.concurrent.Future;
import org.onlab.onos.ApplicationId;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.store.Store;
......@@ -53,14 +52,6 @@ public interface FlowRuleStore extends Store<FlowRuleBatchEvent, FlowRuleStoreDe
Iterable<FlowEntry> getFlowEntries(DeviceId deviceId);
/**
* Returns the flow entries associated with an application.
*
* @param appId the application id
* @return the flow entries
*/
Iterable<FlowRule> getFlowRulesByAppId(ApplicationId appId);
/**
// TODO: Better description of method behavior.
* Stores a new flow rule without generating events.
*
......
......@@ -26,7 +26,6 @@ import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
import org.onlab.onos.ApplicationId;
import org.onlab.onos.cluster.ClusterService;
import org.onlab.onos.net.Device;
import org.onlab.onos.net.DeviceId;
......@@ -265,15 +264,6 @@ public class DistributedFlowRuleStore
}
@Override
public synchronized Iterable<FlowRule> getFlowRulesByAppId(ApplicationId appId) {
Collection<FlowRule> rules = flowEntriesById.get(appId.id());
if (rules == null) {
return Collections.emptyList();
}
return ImmutableSet.copyOf(rules);
}
@Override
public void storeFlowRule(FlowRule rule) {
storeBatch(new FlowRuleBatchOperation(Arrays.asList(new FlowRuleBatchEntry(FlowRuleOperation.ADD, rule))));
}
......
......@@ -7,7 +7,6 @@ import org.apache.felix.scr.annotations.Activate;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Deactivate;
import org.apache.felix.scr.annotations.Service;
import org.onlab.onos.ApplicationId;
import org.onlab.onos.net.DeviceId;
import org.onlab.onos.net.flow.CompletedBatchOperation;
import org.onlab.onos.net.flow.DefaultFlowEntry;
......@@ -31,9 +30,7 @@ import org.slf4j.Logger;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.CopyOnWriteArrayList;
......@@ -143,20 +140,6 @@ public class SimpleFlowRuleStore
}
@Override
public Iterable<FlowRule> getFlowRulesByAppId(ApplicationId appId) {
Set<FlowRule> rules = new HashSet<>();
for (DeviceId did : flowEntries.keySet()) {
for (FlowEntry fe : getFlowEntries(did)) {
if (fe.appId() == appId.id()) {
rules.add(fe);
}
}
}
return rules;
}
@Override
public void storeFlowRule(FlowRule rule) {
storeFlowRuleInternal(rule);
}
......