blob: 55ace4068632474fb97d1da949deea059ce50dac [file] [log] [blame]
Jonathan Hart96c146b2017-02-24 16:32:00 -08001/*
2 * Copyright 2017-present Open Networking Laboratory
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
17package org.onosproject.incubator.store.routing.impl;
18
19import org.onlab.packet.IpAddress;
20import org.onlab.packet.IpPrefix;
21import org.onosproject.incubator.net.routing.Route;
22import org.onosproject.incubator.net.routing.RouteSet;
23import org.onosproject.incubator.net.routing.RouteTableId;
24
25import java.util.Collection;
26import java.util.Collections;
27
28/**
29 * Route table that contains no routes.
30 */
31public 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
55 public void remove(Route route) {
56
57 }
58
59 @Override
60 public RouteTableId id() {
61 return id;
62 }
63
64 @Override
65 public Collection<RouteSet> getRoutes() {
66 return Collections.emptyList();
67 }
68
69 @Override
70 public RouteSet getRoutes(IpPrefix prefix) {
71 return null;
72 }
73
74 @Override
75 public Collection<Route> getRoutesForNextHop(IpAddress nextHop) {
76 return Collections.emptyList();
77 }
78
79 @Override
80 public void shutdown() {
81
82 }
83
84 @Override
85 public void destroy() {
86
87 }
88}