blob: 3e2e1f149b44c59db90158233ea37778343f93b4 [file] [log] [blame]
Yuta HIGUCHIda27f522016-07-07 22:05:39 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Yuta HIGUCHIda27f522016-07-07 22:05:39 -07003 *
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 Li5e505c62016-12-05 02:44:24 +090016package org.onosproject.lisp.ctl;
Yuta HIGUCHIda27f522016-07-07 22:05:39 -070017
18/**
Jian Li6322a362016-10-31 00:57:19 +090019 * Abstraction of a LISP controller. Serves as a one stop shop for obtaining
20 * LISP devices and (un)register listeners on LISP events.
Yuta HIGUCHIda27f522016-07-07 22:05:39 -070021 */
Jian Li6322a362016-10-31 00:57:19 +090022public interface LispController {
Yuta HIGUCHIda27f522016-07-07 22:05:39 -070023
Jian Li7ccc3a82016-12-09 01:30:56 +090024 /**
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 Li834ff722016-12-13 19:43:02 +090032 * 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 Li9b1a45b2017-01-19 13:34:31 -080039 * Connects to a specific LISP router.
40 * If the connection is established, it creates and adds the device to
41 * ONOS core as a LISP router.
42 *
43 * @param routerId router identifier
44 * @return LispRouter LISP router
45 */
46 LispRouter connectRouter(LispRouterId routerId);
47
48 /**
49 * Disconnects a LISP router and notify router removal event.
50 *
51 * @param routerId router identifier
52 * @param remove true only if want to notify router removal event
53 */
54 void disconnectRouter(LispRouterId routerId, boolean remove);
55
56 /**
Jian Li7ccc3a82016-12-09 01:30:56 +090057 * Obtains the actual router for the given LispRouterId.
58 *
59 * @param routerId the router to fetch
60 * @return the interface to this router
61 */
62 LispRouter getRouter(LispRouterId routerId);
63
64 /**
65 * Registers a router listener to track router status.
66 * (e.g., router add and removal)
67 *
68 * @param listener the listener to notify
69 */
70 void addRouterListener(LispRouterListener listener);
71
72 /**
73 * Unregisters a router listener.
74 *
75 * @param listener the listener to unregister
76 */
77 void removeRouterListener(LispRouterListener listener);
78
79 /**
80 * Registers a listener for all LISP message types.
81 *
82 * @param listener the listener to notify
83 */
84 void addMessageListener(LispMessageListener listener);
85
86 /**
87 * Unregisters a listener.
88 *
89 * @param listener the listener to unregister
90 */
91 void removeMessageListener(LispMessageListener listener);
Yuta HIGUCHIda27f522016-07-07 22:05:39 -070092}