CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | */ |
| 16 | package org.onosproject.ovsdb.controller; |
| 17 | |
| 18 | import java.util.List; |
| 19 | |
| 20 | /** |
| 21 | * Abstraction of an ovsdb controller. Serves as a one stop shop for obtaining |
| 22 | * OvsdbNode and (un)register listeners on ovsdb events and ovsdb node events. |
| 23 | */ |
| 24 | public interface OvsdbController { |
| 25 | |
| 26 | /** |
| 27 | * Adds Node Event Listener. |
| 28 | * |
| 29 | * @param listener node listener |
| 30 | */ |
| 31 | void addNodeListener(OvsdbNodeListener listener); |
| 32 | |
| 33 | /** |
| 34 | * Removes Node Event Listener. |
| 35 | * |
| 36 | * @param listener node listener |
| 37 | */ |
| 38 | void removeNodeListener(OvsdbNodeListener listener); |
| 39 | |
| 40 | /** |
| 41 | * Adds ovsdb event listener. |
| 42 | * |
| 43 | * @param listener event listener |
| 44 | */ |
| 45 | void addOvsdbEventListener(OvsdbEventListener listener); |
| 46 | |
| 47 | /** |
| 48 | * Removes ovsdb event listener. |
| 49 | * |
| 50 | * @param listener event listener |
| 51 | */ |
| 52 | void removeOvsdbEventListener(OvsdbEventListener listener); |
| 53 | |
| 54 | /** |
| 55 | * Gets all the nodes information. |
| 56 | * |
| 57 | * @return the list of node id |
| 58 | */ |
| 59 | List<OvsdbNodeId> getNodeIds(); |
| 60 | |
| 61 | /** |
| 62 | * Gets a ovsdb client by node identifier. |
| 63 | * |
| 64 | * @param nodeId node identifier |
| 65 | * @return OvsdbClient ovsdb node information |
| 66 | */ |
| 67 | OvsdbClientService getOvsdbClient(OvsdbNodeId nodeId); |
| 68 | } |