Yuta HIGUCHI | da27f52 | 2016-07-07 22:05:39 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016-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 | */ |
Jian Li | 5e505c6 | 2016-12-05 02:44:24 +0900 | [diff] [blame] | 16 | package org.onosproject.lisp.ctl; |
Yuta HIGUCHI | da27f52 | 2016-07-07 22:05:39 -0700 | [diff] [blame] | 17 | |
| 18 | /** |
Jian Li | 6322a36 | 2016-10-31 00:57:19 +0900 | [diff] [blame] | 19 | * Abstraction of a LISP controller. Serves as a one stop shop for obtaining |
| 20 | * LISP devices and (un)register listeners on LISP events. |
Yuta HIGUCHI | da27f52 | 2016-07-07 22:05:39 -0700 | [diff] [blame] | 21 | */ |
Jian Li | 6322a36 | 2016-10-31 00:57:19 +0900 | [diff] [blame] | 22 | public interface LispController { |
Yuta HIGUCHI | da27f52 | 2016-07-07 22:05:39 -0700 | [diff] [blame] | 23 | |
Jian Li | 7ccc3a8 | 2016-12-09 01:30:56 +0900 | [diff] [blame] | 24 | /** |
| 25 | * Obtains all LISP routers known to this LISP controller. |
| 26 | * |
| 27 | * @return Iterable of LISP router elements |
| 28 | */ |
| 29 | Iterable<LispRouter> getRouters(); |
| 30 | |
| 31 | /** |
Jian Li | 834ff72 | 2016-12-13 19:43:02 +0900 | [diff] [blame^] | 32 | * Obtains all subscribed LISP routers known to this LISP controllers. |
| 33 | * |
| 34 | * @return Iterable of LISP router elements |
| 35 | */ |
| 36 | Iterable<LispRouter> getSubscribedRouters(); |
| 37 | |
| 38 | /** |
Jian Li | 7ccc3a8 | 2016-12-09 01:30:56 +0900 | [diff] [blame] | 39 | * Obtains the actual router for the given LispRouterId. |
| 40 | * |
| 41 | * @param routerId the router to fetch |
| 42 | * @return the interface to this router |
| 43 | */ |
| 44 | LispRouter getRouter(LispRouterId routerId); |
| 45 | |
| 46 | /** |
| 47 | * Registers a router listener to track router status. |
| 48 | * (e.g., router add and removal) |
| 49 | * |
| 50 | * @param listener the listener to notify |
| 51 | */ |
| 52 | void addRouterListener(LispRouterListener listener); |
| 53 | |
| 54 | /** |
| 55 | * Unregisters a router listener. |
| 56 | * |
| 57 | * @param listener the listener to unregister |
| 58 | */ |
| 59 | void removeRouterListener(LispRouterListener listener); |
| 60 | |
| 61 | /** |
| 62 | * Registers a listener for all LISP message types. |
| 63 | * |
| 64 | * @param listener the listener to notify |
| 65 | */ |
| 66 | void addMessageListener(LispMessageListener listener); |
| 67 | |
| 68 | /** |
| 69 | * Unregisters a listener. |
| 70 | * |
| 71 | * @param listener the listener to unregister |
| 72 | */ |
| 73 | void removeMessageListener(LispMessageListener listener); |
Yuta HIGUCHI | da27f52 | 2016-07-07 22:05:39 -0700 | [diff] [blame] | 74 | } |