CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame^] | 2 | * Copyright 2015-present Open Networking Laboratory |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [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 | */ |
| 16 | package org.onosproject.ovsdb.controller; |
| 17 | |
Hyunsun Moon | 5fb20a5 | 2015-09-25 17:02:33 -0700 | [diff] [blame] | 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.TpPort; |
| 20 | |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 21 | import java.util.List; |
| 22 | |
| 23 | /** |
BitOhenry | 264f35a | 2015-11-03 20:58:39 +0800 | [diff] [blame] | 24 | * Abstraction of an ovsdb controller. Serves as an one stop shop for obtaining |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 25 | * OvsdbNode and (un)register listeners on ovsdb events and ovsdb node events. |
| 26 | */ |
| 27 | public interface OvsdbController { |
| 28 | |
| 29 | /** |
| 30 | * Adds Node Event Listener. |
| 31 | * |
| 32 | * @param listener node listener |
| 33 | */ |
| 34 | void addNodeListener(OvsdbNodeListener listener); |
| 35 | |
| 36 | /** |
| 37 | * Removes Node Event Listener. |
| 38 | * |
| 39 | * @param listener node listener |
| 40 | */ |
| 41 | void removeNodeListener(OvsdbNodeListener listener); |
| 42 | |
| 43 | /** |
| 44 | * Adds ovsdb event listener. |
| 45 | * |
| 46 | * @param listener event listener |
| 47 | */ |
| 48 | void addOvsdbEventListener(OvsdbEventListener listener); |
| 49 | |
| 50 | /** |
| 51 | * Removes ovsdb event listener. |
| 52 | * |
| 53 | * @param listener event listener |
| 54 | */ |
| 55 | void removeOvsdbEventListener(OvsdbEventListener listener); |
| 56 | |
| 57 | /** |
| 58 | * Gets all the nodes information. |
| 59 | * |
| 60 | * @return the list of node id |
| 61 | */ |
| 62 | List<OvsdbNodeId> getNodeIds(); |
| 63 | |
| 64 | /** |
BitOhenry | 264f35a | 2015-11-03 20:58:39 +0800 | [diff] [blame] | 65 | * Gets an ovsdb client by node identifier. |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 66 | * |
| 67 | * @param nodeId node identifier |
| 68 | * @return OvsdbClient ovsdb node information |
| 69 | */ |
| 70 | OvsdbClientService getOvsdbClient(OvsdbNodeId nodeId); |
Hyunsun Moon | 5fb20a5 | 2015-09-25 17:02:33 -0700 | [diff] [blame] | 71 | |
| 72 | /** |
| 73 | * Connect to the ovsdb server with given ip address and port number. |
| 74 | * |
| 75 | * @param ip ip address |
| 76 | * @param port port number |
| 77 | */ |
| 78 | void connect(IpAddress ip, TpPort port); |
CNlucius | 74fd494 | 2015-07-20 14:28:04 +0800 | [diff] [blame] | 79 | } |