blob: 5e2c1e6e50e834de6c0490a4eea4eec7726c39cc [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 /**
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020046 * Updates the store with a host based source information for a given route. There may be
47 * multiple source connect points for the given host.
Andrea Campanella545edb42018-03-20 16:37:29 -070048 *
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020049 * @param route a Multicast route
50 * @param hostId the host source
51 * @param connectPoints the sources connect point
52 */
53 void storeSource(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
54
55 /**
56 * Updates the store with source information for a given route.
57 * The source stored with this method are not tied with any host.
58 * Traffic will be sent from all of them.
59 *
Ilayda Ozdemirad741712020-06-10 08:31:27 +000060 * @param route a Multicast route
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020061 * @param sources set of specific connect points
Andrea Campanella545edb42018-03-20 16:37:29 -070062 */
63 void storeSources(McastRoute route, Set<ConnectPoint> sources);
64
65 /**
66 * Removes from the store all the sources information for a given route.
67 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070068 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070069 */
70 void removeSources(McastRoute route);
71
72 /**
73 * Removes from the store the source information for the given route.
Andrea Campanella545edb42018-03-20 16:37:29 -070074 *
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020075 * @param route a Multicast route
76 * @param source a source
Andrea Campanella545edb42018-03-20 16:37:29 -070077 */
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020078 void removeSource(McastRoute route, HostId source);
79
80 /**
Ilayda Ozdemirad741712020-06-10 08:31:27 +000081 * Removes a set of source connect points for a given route.
82 * This method is not tied with any host.
83 *
84 * @param route a Multicast route
85 * @param sources set of specific connect points
86 */
87 void removeSources(McastRoute route, Set<ConnectPoint> sources);
88
89 /**
Andrea Campanella0ddf9b82018-04-27 15:54:42 +020090 * Removes a set of source connect points for a given host the route.
91 *
92 * @param route the multicast route
93 * @param hostId a source host
94 * @param connectPoints a given set of connect points to remove
95 */
96 void removeSources(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
Andrea Campanella545edb42018-03-20 16:37:29 -070097
98 /**
99 * Updates the store with a host based sink information for a given route. There may be
100 * multiple sink connect points for the given host.
101 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700102 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700103 * @param hostId the host sink
104 * @param sinks the sinks
105 */
106 void addSink(McastRoute route, HostId hostId, Set<ConnectPoint> sinks);
107
108 /**
109 * Updates the store with sinks information for a given route.
110 * The sinks stored with this method are not tied with any host.
111 * Traffic will be sent to all of them.
112 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700113 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700114 * @param sinks set of specific connect points
115 */
116 void addSinks(McastRoute route, Set<ConnectPoint> sinks);
117
118 /**
119 * Removes from the store all the sink information for a given route.
120 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700121 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700122 */
123 void removeSinks(McastRoute route);
124
125 /**
126 * Removes from the store the complete set of sink information for a given host for a given route.
127 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700128 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700129 * @param hostId a specific host
130 */
131 void removeSink(McastRoute route, HostId hostId);
132
133 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700134 * Removes a set of sink connect points for a given host the route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700135 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700136 * @param route the multicast route
137 * @param hostId a sink host
138 * @param connectPoints a given set of connect points to remove
Andrea Campanella545edb42018-03-20 16:37:29 -0700139 */
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700140 void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
Andrea Campanella545edb42018-03-20 16:37:29 -0700141
142 /**
143 * Removes from the store the set of non host bind sink information for a given route.
144 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700145 * @param route a Multicast route
146 * @param sinks a set of Multicast sinks
Andrea Campanella545edb42018-03-20 16:37:29 -0700147 */
148 void removeSinks(McastRoute route, Set<ConnectPoint> sinks);
149
150 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700151 * Obtains the sources for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700152 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700153 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700154 * @return a connect point
155 */
156 Set<ConnectPoint> sourcesFor(McastRoute route);
157
158 /**
Andrea Campanella0ddf9b82018-04-27 15:54:42 +0200159 * Obtains the sources for a given host for a given Multicast route.
160 *
161 * @param route a Multicast route
162 * @param hostId the host
163 * @return a set of sources
164 */
165 Set<ConnectPoint> sourcesFor(McastRoute route, HostId hostId);
166
167 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700168 * Obtains the sinks for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700169 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700170 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700171 * @return a set of sinks
172 */
173 Set<ConnectPoint> sinksFor(McastRoute route);
174
175 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700176 * Obtains the sinks for a given host for a given Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700177 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700178 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700179 * @param hostId the host
180 * @return a set of sinks
181 */
182 Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId);
183
Andrea Campanella545edb42018-03-20 16:37:29 -0700184 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700185 * Gets the set of all known Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700186 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700187 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700188 */
189 Set<McastRoute> getRoutes();
190
191 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700192 * Gets the Multicast data for a given route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700193 *
194 * @param route the route
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700195 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700196 */
197 McastRouteData getRouteData(McastRoute route);
198}