blob: aa429b206c6a6513656d3dc413a8c42c6aafbc98 [file] [log] [blame]
Andrea Campanella545edb42018-03-20 16:37:29 -07001/*
2 * Copyright 2018-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 */
16package org.onosproject.mcast.api;
17
18import com.google.common.annotations.Beta;
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.HostId;
21import org.onosproject.store.Store;
22
23import java.util.Set;
24
25/**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070026 * Entity responsible for storing Multicast state information.
Andrea Campanella545edb42018-03-20 16:37:29 -070027 */
28@Beta
29public interface McastStore extends Store<McastEvent, McastStoreDelegate> {
30
31 /**
32 * Updates the store with the route information.
33 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070034 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070035 */
36 void storeRoute(McastRoute route);
37
38 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070039 * Removes from the store the route information.
Andrea Campanella545edb42018-03-20 16:37:29 -070040 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070041 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070042 */
43 void removeRoute(McastRoute route);
44
45 /**
46 * Add to the store with source information for the given route.
47 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070048 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070049 * @param sources a set of sources
50 */
51 void storeSources(McastRoute route, Set<ConnectPoint> sources);
52
53 /**
54 * Removes from the store all the sources information for a given route.
55 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070056 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070057 */
58 void removeSources(McastRoute route);
59
60 /**
61 * Removes from the store the source information for the given route.
62 * value.
63 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070064 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070065 * @param sources a set of sources
66 */
67 void removeSources(McastRoute route, Set<ConnectPoint> sources);
68
69 /**
70 * Updates the store with a host based sink information for a given route. There may be
71 * multiple sink connect points for the given host.
72 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070073 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070074 * @param hostId the host sink
75 * @param sinks the sinks
76 */
77 void addSink(McastRoute route, HostId hostId, Set<ConnectPoint> sinks);
78
79 /**
80 * Updates the store with sinks information for a given route.
81 * The sinks stored with this method are not tied with any host.
82 * Traffic will be sent to all of them.
83 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070084 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070085 * @param sinks set of specific connect points
86 */
87 void addSinks(McastRoute route, Set<ConnectPoint> sinks);
88
89 /**
90 * Removes from the store all the sink information for a given route.
91 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070092 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070093 */
94 void removeSinks(McastRoute route);
95
96 /**
97 * Removes from the store the complete set of sink information for a given host for a given route.
98 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070099 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700100 * @param hostId a specific host
101 */
102 void removeSink(McastRoute route, HostId hostId);
103
104 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700105 * Removes a set of sink connect points for a given host the route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700106 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700107 * @param route the multicast route
108 * @param hostId a sink host
109 * @param connectPoints a given set of connect points to remove
Andrea Campanella545edb42018-03-20 16:37:29 -0700110 */
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700111 void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
Andrea Campanella545edb42018-03-20 16:37:29 -0700112
113 /**
114 * Removes from the store the set of non host bind sink information for a given route.
115 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700116 * @param route a Multicast route
117 * @param sinks a set of Multicast sinks
Andrea Campanella545edb42018-03-20 16:37:29 -0700118 */
119 void removeSinks(McastRoute route, Set<ConnectPoint> sinks);
120
121 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700122 * Obtains the sources for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700123 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700124 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700125 * @return a connect point
126 */
127 Set<ConnectPoint> sourcesFor(McastRoute route);
128
129 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700130 * Obtains the sinks for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700131 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700132 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700133 * @return a set of sinks
134 */
135 Set<ConnectPoint> sinksFor(McastRoute route);
136
137 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700138 * Obtains the sinks for a given host for a given Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700139 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700140 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700141 * @param hostId the host
142 * @return a set of sinks
143 */
144 Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId);
145
Andrea Campanella545edb42018-03-20 16:37:29 -0700146 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700147 * Gets the set of all known Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700148 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700149 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700150 */
151 Set<McastRoute> getRoutes();
152
153 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700154 * Gets the Multicast data for a given route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700155 *
156 * @param route the route
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700157 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700158 */
159 McastRouteData getRouteData(McastRoute route);
160}