Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.mcast.api; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
| 19 | import org.onosproject.net.ConnectPoint; |
| 20 | import org.onosproject.net.HostId; |
| 21 | import org.onosproject.store.Store; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
| 25 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 26 | * Entity responsible for storing Multicast state information. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 27 | */ |
| 28 | @Beta |
| 29 | public interface McastStore extends Store<McastEvent, McastStoreDelegate> { |
| 30 | |
| 31 | /** |
| 32 | * Updates the store with the route information. |
| 33 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 34 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 35 | */ |
| 36 | void storeRoute(McastRoute route); |
| 37 | |
| 38 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 39 | * Removes from the store the route information. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 40 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 41 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 42 | */ |
| 43 | void removeRoute(McastRoute route); |
| 44 | |
| 45 | /** |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 46 | * 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 Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 48 | * |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 49 | * @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 Ozdemir | 69a93c4 | 2020-06-10 08:31:27 +0000 | [diff] [blame] | 60 | * @param route a Multicast route |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 61 | * @param sources set of specific connect points |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 62 | */ |
| 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 68 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 69 | */ |
| 70 | void removeSources(McastRoute route); |
| 71 | |
| 72 | /** |
| 73 | * Removes from the store the source information for the given route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 74 | * |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 75 | * @param route a Multicast route |
| 76 | * @param source a source |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 77 | */ |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 78 | void removeSource(McastRoute route, HostId source); |
| 79 | |
| 80 | /** |
Ilayda Ozdemir | 69a93c4 | 2020-06-10 08:31:27 +0000 | [diff] [blame] | 81 | * 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 Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 90 | * 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 Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 97 | |
| 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 102 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 103 | * @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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 113 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 114 | * @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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 121 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 122 | */ |
| 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 128 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 129 | * @param hostId a specific host |
| 130 | */ |
| 131 | void removeSink(McastRoute route, HostId hostId); |
| 132 | |
| 133 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 134 | * Removes a set of sink connect points for a given host the route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 135 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 136 | * @param route the multicast route |
| 137 | * @param hostId a sink host |
| 138 | * @param connectPoints a given set of connect points to remove |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 139 | */ |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 140 | void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints); |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 141 | |
| 142 | /** |
| 143 | * Removes from the store the set of non host bind sink information for a given route. |
| 144 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 145 | * @param route a Multicast route |
| 146 | * @param sinks a set of Multicast sinks |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 147 | */ |
| 148 | void removeSinks(McastRoute route, Set<ConnectPoint> sinks); |
| 149 | |
| 150 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 151 | * Obtains the sources for a Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 152 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 153 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 154 | * @return a connect point |
| 155 | */ |
| 156 | Set<ConnectPoint> sourcesFor(McastRoute route); |
| 157 | |
| 158 | /** |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame] | 159 | * 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 168 | * Obtains the sinks for a Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 169 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 170 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 171 | * @return a set of sinks |
| 172 | */ |
| 173 | Set<ConnectPoint> sinksFor(McastRoute route); |
| 174 | |
| 175 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 176 | * Obtains the sinks for a given host for a given Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 177 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 178 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 179 | * @param hostId the host |
| 180 | * @return a set of sinks |
| 181 | */ |
| 182 | Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId); |
| 183 | |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 184 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 185 | * Gets the set of all known Multicast routes. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 186 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 187 | * @return set of Multicast routes. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 188 | */ |
| 189 | Set<McastRoute> getRoutes(); |
| 190 | |
| 191 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 192 | * Gets the Multicast data for a given route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 193 | * |
| 194 | * @param route the route |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 195 | * @return set of Multicast routes. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 196 | */ |
| 197 | McastRouteData getRouteData(McastRoute route); |
| 198 | } |