blob: e1ec904ea2d75c4154195e01b98dcf738fd98792 [file] [log] [blame]
alshabib8c2a8b32015-03-31 16:31:03 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
alshabib8c2a8b32015-03-31 16:31:03 -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 */
16package org.onosproject.net.behaviour;
17
andreaed976a42015-10-05 14:38:25 -070018import org.onosproject.net.driver.HandlerBehaviour;
19
alshabib8c2a8b32015-03-31 16:31:03 -070020import java.util.List;
21
22/**
Palash Kalac99b15a2017-06-14 09:36:56 +090023 * Device behaviour to obtain, set and remove controllers at the device.
alshabib8c2a8b32015-03-31 16:31:03 -070024 */
andreaed976a42015-10-05 14:38:25 -070025public interface ControllerConfig extends HandlerBehaviour {
alshabib8c2a8b32015-03-31 16:31:03 -070026
27 //TODO: add other controller parameters as needed.
28
29 /**
30 * Obtain the list of controller which are currently configured.
andreaed976a42015-10-05 14:38:25 -070031 *
alshabib8c2a8b32015-03-31 16:31:03 -070032 * @return a list for controller descriptions
33 */
34 List<ControllerInfo> getControllers();
35
36 /**
37 * Set a list of controllers on a device.
andreaed976a42015-10-05 14:38:25 -070038 *
alshabib8c2a8b32015-03-31 16:31:03 -070039 * @param controllers a list of controller descriptions
40 */
41 void setControllers(List<ControllerInfo> controllers);
42
Palash Kalac99b15a2017-06-14 09:36:56 +090043 /**
44 * Remove a list of controllers on a device.
45 *
46 * @param controllers a list of controller descriptions
47 */
48 default void removeControllers(List<ControllerInfo> controllers) {
49 List<ControllerInfo> controllersList = this.getControllers();
50 controllersList.removeAll(controllers);
51 this.setControllers(controllersList);
52 }
53
alshabib8c2a8b32015-03-31 16:31:03 -070054}