blob: 067f51718bd03c259fc9cf3e20cf24a3045553d9 [file] [log] [blame]
alshabib79e52872015-12-07 16:01:01 -08001package org.onosproject.net.mcast;
2
3import org.onosproject.net.ConnectPoint;
4import org.onosproject.store.Store;
5
6import java.util.Set;
7
8/**
9 * Entity responsible for storing multicast state information.
10 */
11public 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 Hart07eb0412016-02-08 16:42:29 -080054 * Obtains the source for a multicast route.
alshabib79e52872015-12-07 16:01:01 -080055 *
56 * @param route a multicast route
57 * @return a connect point
58 */
59 ConnectPoint sourceFor(McastRoute route);
60
61 /**
Jonathan Hart07eb0412016-02-08 16:42:29 -080062 * Obtains the sinks for a multicast route.
alshabib79e52872015-12-07 16:01:01 -080063 *
64 * @param route a multicast route
65 * @return a set of sinks
66 */
67 Set<ConnectPoint> sinksFor(McastRoute route);
Jonathan Hart07eb0412016-02-08 16:42:29 -080068
69 /**
70 * Gets the set of all known multicast routes.
71 *
72 * @return set of multicast routes
73 */
74 Set<McastRoute> getRoutes();
alshabib79e52872015-12-07 16:01:01 -080075}