Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014-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.cordvtn; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | import org.onlab.packet.TpPort; |
| 20 | import org.onosproject.net.DeviceId; |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 21 | |
| 22 | /** |
| 23 | * Representation of a node with ovsdb server. |
| 24 | */ |
| 25 | public interface OvsdbNode { |
| 26 | /** |
| 27 | * State of the ovsdb node. |
| 28 | */ |
| 29 | enum State { |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 30 | INIT, READY, CONNECTED, DISCONNECTED |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Returns the IP address of ovsdb server. |
| 35 | * |
| 36 | * @return ip address |
| 37 | */ |
| 38 | IpAddress ip(); |
| 39 | |
| 40 | /** |
| 41 | * Returns the port number of ovsdb server. |
| 42 | * |
| 43 | * @return port number |
| 44 | */ |
| 45 | TpPort port(); |
| 46 | |
| 47 | /** |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 48 | * Returns the hostname of the node. |
| 49 | * |
| 50 | * @return hostname |
| 51 | */ |
| 52 | String hostname(); |
| 53 | |
| 54 | /** |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 55 | * Returns the state of the node. |
| 56 | * |
| 57 | * @return state of the node |
| 58 | */ |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 59 | State state(); |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 60 | |
| 61 | /** |
| 62 | * Returns the device ID of the node. |
| 63 | * |
| 64 | * @return device id |
| 65 | */ |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 66 | DeviceId deviceId(); |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 67 | |
| 68 | /** |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 69 | * Returns the device ID of the bridge associated with this node. |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 70 | * |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 71 | * @return device id |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 72 | */ |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame^] | 73 | DeviceId bridgeId(); |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 74 | } |