alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 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 | 2ce0c73 | 2015-10-02 11:20:39 +0200 | [diff] [blame] | 16 | package org.onosproject.net.mcast; |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 17 | |
alshabib | 2ce0c73 | 2015-10-02 11:20:39 +0200 | [diff] [blame] | 18 | import com.google.common.annotations.Beta; |
alshabib | bf85a10 | 2015-12-04 15:45:43 -0800 | [diff] [blame] | 19 | import org.onosproject.event.ListenerService; |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 20 | import org.onosproject.net.ConnectPoint; |
| 21 | |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 22 | import java.util.Set; |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 23 | |
| 24 | /** |
| 25 | * A service interface for maintaining multicast information. |
| 26 | */ |
alshabib | 2ce0c73 | 2015-10-02 11:20:39 +0200 | [diff] [blame] | 27 | @Beta |
alshabib | bf85a10 | 2015-12-04 15:45:43 -0800 | [diff] [blame] | 28 | public interface MulticastRouteService |
| 29 | extends ListenerService<McastEvent, McastListener> { |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Adds a route to the information base. |
| 33 | * |
| 34 | * @param route a multicast route |
| 35 | */ |
| 36 | void add(McastRoute route); |
| 37 | |
| 38 | /** |
| 39 | * Removes a route from the information base. |
| 40 | * |
| 41 | * @param route a multicast route |
| 42 | */ |
| 43 | void remove(McastRoute route); |
| 44 | |
| 45 | /** |
Jonathan Hart | 07eb041 | 2016-02-08 16:42:29 -0800 | [diff] [blame] | 46 | * Gets all multicast routes in the system. |
| 47 | * |
| 48 | * @return set of multicast routes |
| 49 | */ |
| 50 | Set<McastRoute> getRoutes(); |
| 51 | |
| 52 | /** |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 53 | * Adds a source connection to the route from where the |
| 54 | * data stream is originating. |
| 55 | * |
| 56 | * @param route the multicast route |
| 57 | * @param connectPoint a source connect point |
| 58 | */ |
| 59 | void addSource(McastRoute route, ConnectPoint connectPoint); |
| 60 | |
| 61 | /** |
| 62 | * Adds a sink to the route to which a data stream should be |
| 63 | * sent to. |
| 64 | * |
| 65 | * @param route a multicast route |
| 66 | * @param connectPoint a sink connect point |
| 67 | */ |
| 68 | void addSink(McastRoute route, ConnectPoint connectPoint); |
| 69 | |
| 70 | /** |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 71 | * Removes a sink from the route. |
| 72 | * |
| 73 | * @param route the multicast route |
| 74 | * @param connectPoint a sink connect point |
| 75 | */ |
| 76 | void removeSink(McastRoute route, ConnectPoint connectPoint); |
| 77 | |
| 78 | /** |
| 79 | * Find the data source association for this multicast route. |
| 80 | * |
| 81 | * @param route a multicast route |
| 82 | * @return a connect point |
| 83 | */ |
| 84 | ConnectPoint fetchSource(McastRoute route); |
| 85 | |
| 86 | /** |
| 87 | * Find the list of sinks for this route. |
| 88 | * |
| 89 | * @param route a multicast route |
| 90 | * @return a list of connect points |
| 91 | */ |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 92 | Set<ConnectPoint> fetchSinks(McastRoute route); |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 93 | } |