blob: 484f32eca06a1bb223b277a048e98dcc7eac183e [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 *
60 * @param route a Multicast route
61 * @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 /**
81 * Removes a set of source connect points for a given host the route.
82 *
83 * @param route the multicast route
84 * @param hostId a source host
85 * @param connectPoints a given set of connect points to remove
86 */
87 void removeSources(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
Andrea Campanella545edb42018-03-20 16:37:29 -070088
89 /**
90 * Updates the store with a host based sink information for a given route. There may be
91 * multiple sink connect points for the given host.
92 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -070093 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -070094 * @param hostId the host sink
95 * @param sinks the sinks
96 */
97 void addSink(McastRoute route, HostId hostId, Set<ConnectPoint> sinks);
98
99 /**
100 * Updates the store with sinks information for a given route.
101 * The sinks stored with this method are not tied with any host.
102 * Traffic will be sent to all of them.
103 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700104 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700105 * @param sinks set of specific connect points
106 */
107 void addSinks(McastRoute route, Set<ConnectPoint> sinks);
108
109 /**
110 * Removes from the store all the sink information for a given route.
111 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700112 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700113 */
114 void removeSinks(McastRoute route);
115
116 /**
117 * Removes from the store the complete set of sink information for a given host for a given route.
118 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700119 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700120 * @param hostId a specific host
121 */
122 void removeSink(McastRoute route, HostId hostId);
123
124 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700125 * Removes a set of sink connect points for a given host the route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700126 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700127 * @param route the multicast route
128 * @param hostId a sink host
129 * @param connectPoints a given set of connect points to remove
Andrea Campanella545edb42018-03-20 16:37:29 -0700130 */
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700131 void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints);
Andrea Campanella545edb42018-03-20 16:37:29 -0700132
133 /**
134 * Removes from the store the set of non host bind sink information for a given route.
135 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700136 * @param route a Multicast route
137 * @param sinks a set of Multicast sinks
Andrea Campanella545edb42018-03-20 16:37:29 -0700138 */
139 void removeSinks(McastRoute route, Set<ConnectPoint> sinks);
140
141 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700142 * Obtains the sources for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700143 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700144 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700145 * @return a connect point
146 */
147 Set<ConnectPoint> sourcesFor(McastRoute route);
148
149 /**
Andrea Campanella0ddf9b82018-04-27 15:54:42 +0200150 * Obtains the sources for a given host for a given Multicast route.
151 *
152 * @param route a Multicast route
153 * @param hostId the host
154 * @return a set of sources
155 */
156 Set<ConnectPoint> sourcesFor(McastRoute route, HostId hostId);
157
158 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700159 * Obtains the sinks for a Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700160 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700161 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700162 * @return a set of sinks
163 */
164 Set<ConnectPoint> sinksFor(McastRoute route);
165
166 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700167 * Obtains the sinks for a given host for a given Multicast route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700168 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700169 * @param route a Multicast route
Andrea Campanella545edb42018-03-20 16:37:29 -0700170 * @param hostId the host
171 * @return a set of sinks
172 */
173 Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId);
174
Andrea Campanella545edb42018-03-20 16:37:29 -0700175 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700176 * Gets the set of all known Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700177 *
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700178 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700179 */
180 Set<McastRoute> getRoutes();
181
182 /**
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700183 * Gets the Multicast data for a given route.
Andrea Campanella545edb42018-03-20 16:37:29 -0700184 *
185 * @param route the route
Andrea Campanella7c8bcdf2018-03-26 23:29:11 -0700186 * @return set of Multicast routes.
Andrea Campanella545edb42018-03-20 16:37:29 -0700187 */
188 McastRouteData getRouteData(McastRoute route);
189}