Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2017-present Open Networking Foundation |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Ray Milkey | 69ec871 | 2017-08-08 13:00:43 -0700 | [diff] [blame] | 17 | package org.onosproject.routeservice.store; |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 18 | |
| 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onlab.packet.IpPrefix; |
Ray Milkey | 69ec871 | 2017-08-08 13:00:43 -0700 | [diff] [blame] | 21 | import org.onosproject.routeservice.Route; |
| 22 | import org.onosproject.routeservice.RouteSet; |
| 23 | import org.onosproject.routeservice.RouteTableId; |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 24 | |
| 25 | import java.util.Collection; |
| 26 | import java.util.Collections; |
| 27 | |
| 28 | /** |
| 29 | * Route table that contains no routes. |
| 30 | */ |
| 31 | public final class EmptyRouteTable implements RouteTable { |
| 32 | |
| 33 | private final RouteTableId id = new RouteTableId("empty"); |
| 34 | |
| 35 | private static final EmptyRouteTable INSTANCE = new EmptyRouteTable(); |
| 36 | |
| 37 | /** |
| 38 | * Returns the instance of the empty route table. |
| 39 | * |
| 40 | * @return empty route table |
| 41 | */ |
| 42 | public static EmptyRouteTable instance() { |
| 43 | return INSTANCE; |
| 44 | } |
| 45 | |
| 46 | private EmptyRouteTable() { |
| 47 | } |
| 48 | |
| 49 | @Override |
| 50 | public void update(Route route) { |
| 51 | |
| 52 | } |
| 53 | |
| 54 | @Override |
pier | 8a86db2 | 2019-10-16 16:58:20 +0200 | [diff] [blame] | 55 | public void update(Collection<Route> routes) { |
| 56 | |
| 57 | } |
| 58 | |
| 59 | @Override |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 60 | public void remove(Route route) { |
| 61 | |
| 62 | } |
| 63 | |
| 64 | @Override |
pier | 8a86db2 | 2019-10-16 16:58:20 +0200 | [diff] [blame] | 65 | public void remove(Collection<Route> routes) { |
| 66 | |
| 67 | } |
| 68 | |
| 69 | @Override |
Daniel Ginsburg | 83b7645 | 2018-06-09 01:43:59 +0300 | [diff] [blame] | 70 | public void replace(Route route) { |
| 71 | |
| 72 | } |
| 73 | |
| 74 | @Override |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 75 | public RouteTableId id() { |
| 76 | return id; |
| 77 | } |
| 78 | |
| 79 | @Override |
| 80 | public Collection<RouteSet> getRoutes() { |
| 81 | return Collections.emptyList(); |
| 82 | } |
| 83 | |
| 84 | @Override |
| 85 | public RouteSet getRoutes(IpPrefix prefix) { |
| 86 | return null; |
| 87 | } |
| 88 | |
| 89 | @Override |
| 90 | public Collection<Route> getRoutesForNextHop(IpAddress nextHop) { |
| 91 | return Collections.emptyList(); |
| 92 | } |
| 93 | |
| 94 | @Override |
pier | 8a86db2 | 2019-10-16 16:58:20 +0200 | [diff] [blame] | 95 | public Collection<RouteSet> getRoutesForNextHops(Collection<IpAddress> nextHops) { |
| 96 | return Collections.emptyList(); |
| 97 | } |
| 98 | |
| 99 | @Override |
Jonathan Hart | 96c146b | 2017-02-24 16:32:00 -0800 | [diff] [blame] | 100 | public void shutdown() { |
| 101 | |
| 102 | } |
| 103 | |
| 104 | @Override |
| 105 | public void destroy() { |
| 106 | |
| 107 | } |
| 108 | } |