Remove deprecated RouteService APIs.
The goal is to clean up the interfaces a little bit in preparation for
a major RouteService refactoring that is coming.
Change-Id: Ifbde9a507dd0dc3cddcd7fa1c02c426dad386e5f
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/NextHop.java b/incubator/api/src/main/java/org/onosproject/incubator/net/routing/NextHop.java
deleted file mode 100644
index 0241742..0000000
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/NextHop.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onosproject.incubator.net.routing;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.ConnectPoint;
-
-import java.util.Objects;
-
-import static com.google.common.base.MoreObjects.toStringHelper;
-
-/**
- * Describes a routing next hop.
- */
-public class NextHop {
-
- private final IpAddress ip;
- private final NextHopData nextHopData;
-
- /**
- * Creates a new next hop.
- *
- * @param ip IP address
- * @param nextHopData Next hop data
- */
- public NextHop(IpAddress ip, NextHopData nextHopData) {
- this.ip = ip;
- this.nextHopData = nextHopData;
- }
-
- /**
- * Returns the IP address of the next hop.
- *
- * @return IP address
- */
- public IpAddress ip() {
- return ip;
- }
-
- /**
- * Returns the MAC address of the next hop.
- *
- * @return MAC address
- */
- public MacAddress mac() {
- return nextHopData.mac();
- }
-
- /**
- * Returns the location of the next hop.
- *
- * @return Connect point
- */
- public ConnectPoint location() {
- return nextHopData.location();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ip, nextHopData);
- }
-
- @Override
- public boolean equals(Object other) {
- if (this == other) {
- return true;
- }
-
- if (!(other instanceof NextHop)) {
- return false;
- }
-
- NextHop that = (NextHop) other;
-
- return Objects.equals(this.ip, that.ip) &&
- Objects.equals(this.nextHopData, that.nextHopData);
- }
-
- @Override
- public String toString() {
- return toStringHelper(this)
- .add("ip", ip)
- .add("nextHopData", nextHopData)
- .toString();
- }
-}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteService.java b/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteService.java
index 4a298ba..c123dc3 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteService.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteService.java
@@ -20,9 +20,7 @@
import org.onosproject.event.ListenerService;
import java.util.Collection;
-import java.util.Map;
import java.util.Optional;
-import java.util.Set;
/**
* Unicast IP route service.
@@ -30,16 +28,6 @@
public interface RouteService extends ListenerService<RouteEvent, RouteListener> {
/**
- * Returns all routes for all route tables in the system.
- *
- * @return map of route table name to routes in that table
- * @deprecated in Kingfisher release. Use {@link #getRoutes(RouteTableId)}
- * instead.
- */
- @Deprecated
- Map<RouteTableId, Collection<Route>> getAllRoutes();
-
- /**
* Returns information about all routes in the given route table.
*
* @param id route table ID
@@ -55,6 +43,14 @@
Collection<RouteTableId> getRouteTables();
/**
+ * Performs a longest prefix lookup on the given IP address.
+ *
+ * @param ip IP address to look up
+ * @return most specific matching route, if one exists
+ */
+ Optional<ResolvedRoute> longestPrefixLookup(IpAddress ip);
+
+ /**
* Performs a longest prefix match on the given IP address. The call will
* return the route with the most specific prefix that contains the given
* IP address.
@@ -66,30 +62,4 @@
*/
@Deprecated
Route longestPrefixMatch(IpAddress ip);
-
- /**
- * Performs a longest prefix lookup on the given IP address.
- *
- * @param ip IP address to look up
- * @return most specific matching route, if one exists
- */
- Optional<ResolvedRoute> longestPrefixLookup(IpAddress ip);
-
- /**
- * Returns the routes for the given next hop.
- *
- * @param nextHop next hop IP address
- * @return routes for this next hop
- */
- @Deprecated
- Collection<Route> getRoutesForNextHop(IpAddress nextHop);
-
- /**
- * Returns all next hops in the route store.
- *
- * @return set of next hops
- */
- @Deprecated
- Set<NextHop> getNextHops();
-
}
diff --git a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteStore.java b/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteStore.java
index 27ec1c3..0d2eb23 100644
--- a/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteStore.java
+++ b/incubator/api/src/main/java/org/onosproject/incubator/net/routing/RouteStore.java
@@ -22,7 +22,6 @@
import org.onosproject.store.Store;
import java.util.Collection;
-import java.util.Map;
import java.util.Set;
/**
@@ -78,49 +77,4 @@
@Beta
RouteSet getRoutes(IpPrefix prefix);
- /**
- * Updates a next hop information in the store.
- *
- * @param ip IP address
- * @param nextHopData Information of the next hop
- */
- @Deprecated
- void updateNextHop(IpAddress ip, NextHopData nextHopData);
-
- /**
- * Removes a next hop information from the store.
- *
- * @param ip IP address
- * @param nextHopData Information of the next hop
- */
- @Deprecated
- void removeNextHop(IpAddress ip, NextHopData nextHopData);
-
- /**
- * Returns the information of the given next hop.
- *
- * @param ip next hop IP
- * @return Information of the next hop
- */
- @Deprecated
- NextHopData getNextHop(IpAddress ip);
-
- /**
- * Returns all next hops in the route store.
- *
- * @return next hops
- */
- @Deprecated
- Map<IpAddress, NextHopData> getNextHops();
-
- /**
- * Performs a longest prefix match with the given IP address.
- *
- * @param ip IP to look up
- * @return longest prefix match route
- * @deprecated in Kingfisher release. Now handled by the manager instead of
- * the store
- */
- @Deprecated
- Route longestPrefixMatch(IpAddress ip);
}
diff --git a/incubator/api/src/test/java/org/onosproject/incubator/net/routing/RouteServiceAdapter.java b/incubator/api/src/test/java/org/onosproject/incubator/net/routing/RouteServiceAdapter.java
index a13f5c8..e81fc30 100644
--- a/incubator/api/src/test/java/org/onosproject/incubator/net/routing/RouteServiceAdapter.java
+++ b/incubator/api/src/test/java/org/onosproject/incubator/net/routing/RouteServiceAdapter.java
@@ -19,9 +19,7 @@
import org.onlab.packet.IpAddress;
import java.util.Collection;
-import java.util.Map;
import java.util.Optional;
-import java.util.Set;
/**
* Adapter class for the route service.
@@ -38,11 +36,6 @@
}
@Override
- public Map<RouteTableId, Collection<Route>> getAllRoutes() {
- return null;
- }
-
- @Override
public Collection<RouteInfo> getRoutes(RouteTableId id) {
return null;
}
@@ -63,16 +56,6 @@
}
@Override
- public Collection<Route> getRoutesForNextHop(IpAddress nextHop) {
- return null;
- }
-
- @Override
- public Set<NextHop> getNextHops() {
- return null;
- }
-
- @Override
public void addListener(RouteListener listener) {
}