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