blob: f49a1748ffb8ae0120c501061d3e6c627aa81edc [file] [log] [blame]
Mohammad Shahidaa7c1232017-08-09 11:13:15 +05301/*
2 * Copyright 2017-present Open Networking Foundation
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 Milkeya95193c2017-08-10 15:35:36 -070017package org.onosproject.evpnrouteservice.store;
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053018
19import org.onlab.packet.IpAddress;
Ray Milkeya95193c2017-08-10 15:35:36 -070020import org.onosproject.evpnrouteservice.EvpnPrefix;
21import org.onosproject.evpnrouteservice.EvpnRoute;
22import org.onosproject.evpnrouteservice.EvpnRouteSet;
23import org.onosproject.evpnrouteservice.EvpnRouteTableId;
24import org.onosproject.evpnrouteservice.EvpnTable;
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053025
26import java.util.Collection;
27import java.util.Collections;
28
29/**
30 * Route table that contains no routes.
31 */
32public final class EmptyEvpnRouteTable implements EvpnTable {
33
Jonathan Harte9c0c6e2017-08-09 16:44:13 -070034 private final EvpnRouteTableId id = new EvpnRouteTableId("empty");
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053035
36 private static final EmptyEvpnRouteTable INSTANCE = new EmptyEvpnRouteTable();
37
38 /**
39 * Returns the instance of the empty route table.
40 *
41 * @return empty route table
42 */
43 public static EmptyEvpnRouteTable instance() {
44 return INSTANCE;
45 }
46
47 private EmptyEvpnRouteTable() {
48 }
49
50 @Override
51 public void update(EvpnRoute route) {
52
53 }
54
55 @Override
56 public void remove(EvpnRoute route) {
57
58 }
59
60 @Override
Jonathan Harte9c0c6e2017-08-09 16:44:13 -070061 public EvpnRouteTableId id() {
Mohammad Shahidaa7c1232017-08-09 11:13:15 +053062 return id;
63 }
64
65 @Override
66 public Collection<EvpnRouteSet> getRoutes() {
67 return Collections.emptyList();
68 }
69
70 @Override
71 public EvpnRouteSet getRoutes(EvpnPrefix prefix) {
72 return null;
73 }
74
75 @Override
76 public Collection<EvpnRoute> getRoutesForNextHop(IpAddress nextHop) {
77 return Collections.emptyList();
78 }
79
80 @Override
81 public void shutdown() {
82
83 }
84
85 @Override
86 public void destroy() {
87
88 }
89}