blob: 53d444b8e69288cc272bad6424856b9b1bf684ed [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/**
26 * Entity responsible for storing multicast state information.
27 */
28@Beta
29public interface McastStore extends Store<McastEvent, McastStoreDelegate> {
30
31 /**
32 * Updates the store with the route information.
33 *
34 * @param route a multicast route
35 */
36 void storeRoute(McastRoute route);
37
38 /**
39 * Updates the store with the route information.
40 *
41 * @param route a multicast route
42 */
43 void removeRoute(McastRoute route);
44
45 /**
46 * Add to the store with source information for the given route.
47 *
48 * @param route a multicast route
49 * @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 *
56 * @param route a multicast route
57 */
58 void removeSources(McastRoute route);
59
60 /**
61 * Removes from the store the source information for the given route.
62 * value.
63 *
64 * @param route a multicast route
65 * @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 *
73 * @param route a multicast route
74 * @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 *
84 * @param route a multicast route
85 * @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 *
92 * @param route a multicast route
93 */
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 *
99 * @param route a multicast route
100 * @param hostId a specific host
101 */
102 void removeSink(McastRoute route, HostId hostId);
103
104 /**
105 * Removes from the store the given set of sink information for a given host for a given route.
106 *
107 * @param route a multicast route
108 * @param hostId the host
109 * @param sinks a set of multicast sink connect points
110 */
111 void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> sinks);
112
113 /**
114 * Removes from the store the set of non host bind sink information for a given route.
115 *
116 * @param route a multicast route
117 * @param sinks a set of multicast sinks
118 */
119 void removeSinks(McastRoute route, Set<ConnectPoint> sinks);
120
121 /**
122 * Obtains the sources for a multicast route.
123 *
124 * @param route a multicast route
125 * @return a connect point
126 */
127 Set<ConnectPoint> sourcesFor(McastRoute route);
128
129 /**
130 * Obtains the sinks for a multicast route.
131 *
132 * @param route a multicast route
133 * @return a set of sinks
134 */
135 Set<ConnectPoint> sinksFor(McastRoute route);
136
137 /**
138 * Obtains the sinks for a given host for a given multicast route.
139 *
140 * @param route a multicast route
141 * @param hostId the host
142 * @return a set of sinks
143 */
144 Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId);
145
146
147 /**
148 * Gets the set of all known multicast routes.
149 *
150 * @return set of multicast routes.
151 */
152 Set<McastRoute> getRoutes();
153
154 /**
155 * Gets the multicast data for a given route.
156 *
157 * @param route the route
158 * @return set of multicast routes.
159 */
160 McastRouteData getRouteData(McastRoute route);
161}