blob: f04a0e23f1e68803ac152fac26432f11705b8764 [file] [log] [blame]
Brian O'Connor7cbbbb72016-04-09 02:13:23 -07001/*
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 */
alshabib79e52872015-12-07 16:01:01 -080016package org.onosproject.net.mcast;
17
18import org.onosproject.net.ConnectPoint;
19import org.onosproject.store.Store;
20
21import java.util.Set;
22
23/**
24 * Entity responsible for storing multicast state information.
25 */
26public 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 Hart07eb0412016-02-08 16:42:29 -080069 * Obtains the source for a multicast route.
alshabib79e52872015-12-07 16:01:01 -080070 *
71 * @param route a multicast route
72 * @return a connect point
73 */
74 ConnectPoint sourceFor(McastRoute route);
75
76 /**
Jonathan Hart07eb0412016-02-08 16:42:29 -080077 * Obtains the sinks for a multicast route.
alshabib79e52872015-12-07 16:01:01 -080078 *
79 * @param route a multicast route
80 * @return a set of sinks
81 */
82 Set<ConnectPoint> sinksFor(McastRoute route);
Jonathan Hart07eb0412016-02-08 16:42:29 -080083
84 /**
85 * Gets the set of all known multicast routes.
86 *
87 * @return set of multicast routes
88 */
89 Set<McastRoute> getRoutes();
alshabib79e52872015-12-07 16:01:01 -080090}