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 | * |
| 60 | * @param route a Multicast route |
| 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 | /** |
| 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 Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 88 | |
| 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 93 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 94 | * @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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 104 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 105 | * @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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 112 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 113 | */ |
| 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 119 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 120 | * @param hostId a specific host |
| 121 | */ |
| 122 | void removeSink(McastRoute route, HostId hostId); |
| 123 | |
| 124 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 125 | * 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] | 126 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 127 | * @param route the multicast route |
| 128 | * @param hostId a sink host |
| 129 | * @param connectPoints a given set of connect points to remove |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 130 | */ |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 131 | void removeSinks(McastRoute route, HostId hostId, Set<ConnectPoint> connectPoints); |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 132 | |
| 133 | /** |
| 134 | * Removes from the store the set of non host bind sink information for a given route. |
| 135 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 136 | * @param route a Multicast route |
| 137 | * @param sinks a set of Multicast sinks |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 138 | */ |
| 139 | void removeSinks(McastRoute route, Set<ConnectPoint> sinks); |
| 140 | |
| 141 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 142 | * Obtains the sources for a Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 143 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 144 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 145 | * @return a connect point |
| 146 | */ |
| 147 | Set<ConnectPoint> sourcesFor(McastRoute route); |
| 148 | |
| 149 | /** |
Andrea Campanella | 0ddf9b8 | 2018-04-27 15:54:42 +0200 | [diff] [blame^] | 150 | * 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 Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 159 | * Obtains the sinks for a Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 160 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 161 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 162 | * @return a set of sinks |
| 163 | */ |
| 164 | Set<ConnectPoint> sinksFor(McastRoute route); |
| 165 | |
| 166 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 167 | * Obtains the sinks for a given host for a given Multicast route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 168 | * |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 169 | * @param route a Multicast route |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 170 | * @param hostId the host |
| 171 | * @return a set of sinks |
| 172 | */ |
| 173 | Set<ConnectPoint> sinksFor(McastRoute route, HostId hostId); |
| 174 | |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 175 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 176 | * Gets the set of all known Multicast routes. |
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 | * @return set of Multicast routes. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 179 | */ |
| 180 | Set<McastRoute> getRoutes(); |
| 181 | |
| 182 | /** |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 183 | * Gets the Multicast data for a given route. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 184 | * |
| 185 | * @param route the route |
Andrea Campanella | 7c8bcdf | 2018-03-26 23:29:11 -0700 | [diff] [blame] | 186 | * @return set of Multicast routes. |
Andrea Campanella | 545edb4 | 2018-03-20 16:37:29 -0700 | [diff] [blame] | 187 | */ |
| 188 | McastRouteData getRouteData(McastRoute route); |
| 189 | } |