Brian O'Connor | 7cbbbb7 | 2016-04-09 02:13:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015-present Open Networking Laboratory |
| 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 | */ |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 16 | package org.onosproject.net.mcast; |
| 17 | |
| 18 | import org.onosproject.net.ConnectPoint; |
| 19 | import org.onosproject.store.Store; |
| 20 | |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Entity responsible for storing multicast state information. |
| 25 | */ |
| 26 | public interface McastStore extends Store<McastEvent, McastStoreDelegate> { |
| 27 | |
| 28 | enum Type { |
| 29 | /** |
| 30 | * Adding a route to the mcast rib. |
| 31 | */ |
| 32 | ADD, |
| 33 | |
| 34 | /** |
| 35 | * Removing a route from the mcast rib. |
| 36 | */ |
| 37 | REMOVE |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Updates the store with the route information. |
| 42 | * |
| 43 | * @param route a multicast route |
| 44 | * @param operation an operation |
| 45 | */ |
| 46 | void storeRoute(McastRoute route, Type operation); |
| 47 | |
| 48 | /** |
| 49 | * Updates the store with source information for the given route. Only one |
| 50 | * source is permitted. Submitting another source will replace the previous |
| 51 | * value. |
| 52 | * |
| 53 | * @param route a multicast route |
| 54 | * @param source a source |
| 55 | */ |
| 56 | void storeSource(McastRoute route, ConnectPoint source); |
| 57 | |
| 58 | /** |
| 59 | * Updates the store with sink information for a given route. There may be |
| 60 | * multiple sinks. |
| 61 | * |
| 62 | * @param route a multicast route |
| 63 | * @param sink a sink |
| 64 | * @param operation an operation |
| 65 | */ |
| 66 | void storeSink(McastRoute route, ConnectPoint sink, Type operation); |
| 67 | |
| 68 | /** |
Jonathan Hart | 07eb041 | 2016-02-08 16:42:29 -0800 | [diff] [blame] | 69 | * Obtains the source for a multicast route. |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 70 | * |
| 71 | * @param route a multicast route |
| 72 | * @return a connect point |
| 73 | */ |
| 74 | ConnectPoint sourceFor(McastRoute route); |
| 75 | |
| 76 | /** |
Jonathan Hart | 07eb041 | 2016-02-08 16:42:29 -0800 | [diff] [blame] | 77 | * Obtains the sinks for a multicast route. |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 78 | * |
| 79 | * @param route a multicast route |
| 80 | * @return a set of sinks |
| 81 | */ |
| 82 | Set<ConnectPoint> sinksFor(McastRoute route); |
Jonathan Hart | 07eb041 | 2016-02-08 16:42:29 -0800 | [diff] [blame] | 83 | |
| 84 | /** |
| 85 | * Gets the set of all known multicast routes. |
| 86 | * |
| 87 | * @return set of multicast routes |
| 88 | */ |
| 89 | Set<McastRoute> getRoutes(); |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 90 | } |