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 | |
Hyunsun Moon | 838b19b | 2015-10-18 18:23:15 -0700 | [diff] [blame] | 22 | import java.util.Comparator; |
| 23 | |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 24 | /** |
| 25 | * Representation of a node with ovsdb server. |
| 26 | */ |
| 27 | public interface OvsdbNode { |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 28 | |
Hyunsun Moon | 838b19b | 2015-10-18 18:23:15 -0700 | [diff] [blame] | 29 | Comparator<OvsdbNode> OVSDB_NODE_COMPARATOR = new Comparator<OvsdbNode>() { |
| 30 | @Override |
| 31 | public int compare(OvsdbNode ovsdb1, OvsdbNode ovsdb2) { |
| 32 | return ovsdb1.host().compareTo(ovsdb2.host()); |
| 33 | } |
| 34 | }; |
| 35 | |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 36 | /** |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 37 | * Returns the IP address of the ovsdb server. |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 38 | * |
| 39 | * @return ip address |
| 40 | */ |
| 41 | IpAddress ip(); |
| 42 | |
| 43 | /** |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 44 | * Returns the port number of the ovsdb server. |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 45 | * |
| 46 | * @return port number |
| 47 | */ |
| 48 | TpPort port(); |
| 49 | |
| 50 | /** |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 51 | * Returns the host information of the ovsdb server. |
| 52 | * It could be hostname or ip address. |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame] | 53 | * |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 54 | * @return host |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame] | 55 | */ |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 56 | String host(); |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 59 | * Returns the device id of the ovsdb server. |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 60 | * |
| 61 | * @return device id |
| 62 | */ |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame] | 63 | DeviceId deviceId(); |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 64 | |
| 65 | /** |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 66 | * Returns the device id of the integration bridge associated with the node. |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 67 | * |
Hyunsun Moon | e9d7599 | 2015-09-15 22:39:16 -0700 | [diff] [blame] | 68 | * @return device id |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 69 | */ |
Hyunsun Moon | 9661d64 | 2015-09-23 13:24:35 -0700 | [diff] [blame] | 70 | DeviceId intBrId(); |
Hyunsun Moon | 950f639 | 2015-09-10 17:54:10 -0700 | [diff] [blame] | 71 | } |