Remove deprecated flow statistics APIs
Change-Id: I0b44886f2e2f549377dd70ce123eefe73eb10fda
diff --git a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
index 926b291..eef2021 100644
--- a/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
+++ b/core/api/src/main/java/org/onosproject/net/statistic/FlowStatisticService.java
@@ -16,16 +16,15 @@
package org.onosproject.net.statistic;
+import java.util.List;
+import java.util.Map;
+
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.Device;
import org.onosproject.net.PortNumber;
import org.onosproject.net.flow.FlowEntry;
-import org.onosproject.net.flow.TypedStoredFlowEntry;
import org.onosproject.net.flow.instructions.Instruction;
-import java.util.List;
-import java.util.Map;
-
/**
* Service for obtaining individual flow statistic information about device and link in the system.
* Basic statistics are obtained from the StatisticService
@@ -104,72 +103,6 @@
FlowEntry.FlowLiveType liveType,
Instruction.Type instType,
int topn);
-
- // The belows are deprecated interfaces...
-
- /**
- * Obtain the set of the flow type and load list for the device with the given link.
- *
- * @param device the Device to query.
- * @param liveType the FlowLiveType to filter, null means no filtering .
- * @param instType the InstructionType to filter, null means no filtering.
- * @return map of flow entry load
- * @deprecated in Ibis(1.8.1) release
- */
- @Deprecated
- Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType);
-
- /**
- * Obtain the flow type and load list for the device with the given link or port.
- *
- * @param device the Device to query.
- * @param pNumber the port number of the Device to query
- * @param liveType the FlowLiveType to filter, null means no filtering .
- * @param instType the InstructionType to filter, null means no filtering.
- * @return list of flow entry load
- * @deprecated in Ibis(1.8.1) release
- */
- @Deprecated
- List<TypedFlowEntryWithLoad> loadAllByType(Device device,
- PortNumber pNumber,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType);
-
- /**
- * Obtain the set of the flow type and load topn list for the device with the given link.
- *
- * @param device the Device to query.
- * @param liveType the FlowLiveType to filter, null means no filtering .
- * @param instType the InstructionType to filter, null means no filtering.
- * @param topn the top number to filter, null means no filtering.
- * @return map of flow entry load
- * @deprecated in Ibis(1.8.1) release
- */
- @Deprecated
- Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType,
- int topn);
-
- /**
- * Obtain the flow type and load topn list for the device with the given link or port.
- *
- * @param device the Device to query.
- * @param pNumber the port number of the Device to query
- * @param liveType the FlowLiveType to filter, null means no filtering .
- * @param instType the InstructionType to filter, null means no filtering.
- * @param topn topn //FIXME what?
- * @return list of flow entry load
- * @deprecated in Ibis(1.8.1) release
- */
- @Deprecated
- List<TypedFlowEntryWithLoad> loadTopnByType(Device device,
- PortNumber pNumber,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType,
- int topn);
}
diff --git a/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java b/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
index 1287211..3f294f2 100644
--- a/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
+++ b/core/net/src/main/java/org/onosproject/net/statistic/impl/FlowStatisticManager.java
@@ -16,16 +16,21 @@
package org.onosproject.net.statistic.impl;
-import com.google.common.base.MoreObjects;
-import com.google.common.base.Predicate;
-import com.google.common.collect.ImmutableSet;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.stream.Collectors;
+
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.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.apache.felix.scr.annotations.Service;
-import org.onosproject.utils.Comparators;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.Device;
import org.onosproject.net.Port;
@@ -46,22 +51,17 @@
import org.onosproject.net.statistic.StatisticStore;
import org.onosproject.net.statistic.SummaryFlowEntryWithLoad;
import org.onosproject.net.statistic.TypedFlowEntryWithLoad;
-
+import org.onosproject.utils.Comparators;
import org.slf4j.Logger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.stream.Collectors;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Predicate;
+import com.google.common.collect.ImmutableSet;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.onosproject.security.AppGuard.checkPermission;
+import static org.onosproject.security.AppPermission.Type.STATISTIC_READ;
import static org.slf4j.LoggerFactory.getLogger;
-import static org.onosproject.security.AppPermission.Type.*;
/**
* Provides an implementation of the Flow Statistic Service.
@@ -380,75 +380,6 @@
}
}
- //
- // Deprecated interfaces...
- //
- @Override
- public Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadAllByType(Device device,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType) {
- FlowEntry.FlowLiveType type = toFlowEntryLiveType(liveType);
-
- Map<ConnectPoint, List<FlowEntryWithLoad>> loadMap = loadAllByType(device, type, instType);
-
- return toFlowEntryWithLoadMap(loadMap);
- }
-
- @Override
- public List<TypedFlowEntryWithLoad> loadAllByType(Device device, PortNumber pNumber,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType) {
- FlowEntry.FlowLiveType type = toFlowEntryLiveType(liveType);
-
- List<FlowEntryWithLoad> loadList = loadAllByType(device, pNumber, type, instType);
-
- return toFlowEntryWithLoad(loadList);
- }
-
- @Override
- public Map<ConnectPoint, List<TypedFlowEntryWithLoad>> loadTopnByType(Device device,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType,
- int topn) {
- FlowEntry.FlowLiveType type = toFlowEntryLiveType(liveType);
-
- Map<ConnectPoint, List<FlowEntryWithLoad>> loadMap = loadTopnByType(device, type, instType, topn);
-
- return toFlowEntryWithLoadMap(loadMap);
- }
-
- @Override
- public List<TypedFlowEntryWithLoad> loadTopnByType(Device device, PortNumber pNumber,
- TypedStoredFlowEntry.FlowLiveType liveType,
- Instruction.Type instType,
- int topn) {
- FlowEntry.FlowLiveType type = toFlowEntryLiveType(liveType);
-
- List<FlowEntryWithLoad> loadList = loadTopnByType(device, pNumber, type, instType, topn);
-
- return toFlowEntryWithLoad(loadList);
- }
-
- private FlowEntry.FlowLiveType toFlowEntryLiveType(TypedStoredFlowEntry.FlowLiveType liveType) {
- if (liveType == null) {
- return null;
- }
-
- // convert TypedStoredFlowEntry flow live type to FlowEntry one
- switch (liveType) {
- case IMMEDIATE_FLOW:
- return FlowEntry.FlowLiveType.IMMEDIATE;
- case SHORT_FLOW:
- return FlowEntry.FlowLiveType.SHORT;
- case MID_FLOW:
- return FlowEntry.FlowLiveType.MID;
- case LONG_FLOW:
- return FlowEntry.FlowLiveType.LONG;
- default:
- return FlowEntry.FlowLiveType.UNKNOWN;
- }
- }
-
private TypedStoredFlowEntry.FlowLiveType toTypedStoredFlowEntryLiveType(FlowEntry.FlowLiveType liveType) {
if (liveType == null) {
return null;