blob: 7a9a06a6782b28ccacd39188fff22cae8c1d04d2 [file] [log] [blame]
Hyunsun Moonab2cf252015-09-10 17:54:10 -07001/*
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 */
16package org.onosproject.cordvtn;
17
18import org.onlab.packet.IpAddress;
19import org.onlab.packet.TpPort;
20import org.onosproject.net.DeviceId;
Hyunsun Moonab2cf252015-09-10 17:54:10 -070021
Hyunsun Moon4f02b3a2015-10-18 18:23:15 -070022import java.util.Comparator;
23
Hyunsun Moonab2cf252015-09-10 17:54:10 -070024/**
25 * Representation of a node with ovsdb server.
26 */
27public interface OvsdbNode {
Hyunsun Moonab2cf252015-09-10 17:54:10 -070028
Hyunsun Moon4f02b3a2015-10-18 18:23:15 -070029 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 Moonab2cf252015-09-10 17:54:10 -070036 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070037 * Returns the IP address of the ovsdb server.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070038 *
39 * @return ip address
40 */
41 IpAddress ip();
42
43 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070044 * Returns the port number of the ovsdb server.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070045 *
46 * @return port number
47 */
48 TpPort port();
49
50 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070051 * Returns the host information of the ovsdb server.
52 * It could be hostname or ip address.
Hyunsun Moond0e932a2015-09-15 22:39:16 -070053 *
Hyunsun Moon2b530322015-09-23 13:24:35 -070054 * @return host
Hyunsun Moond0e932a2015-09-15 22:39:16 -070055 */
Hyunsun Moon2b530322015-09-23 13:24:35 -070056 String host();
Hyunsun Moond0e932a2015-09-15 22:39:16 -070057
58 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070059 * Returns the device id of the ovsdb server.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070060 *
61 * @return device id
62 */
Hyunsun Moond0e932a2015-09-15 22:39:16 -070063 DeviceId deviceId();
Hyunsun Moonab2cf252015-09-10 17:54:10 -070064
65 /**
Hyunsun Moon2b530322015-09-23 13:24:35 -070066 * Returns the device id of the integration bridge associated with the node.
Hyunsun Moonab2cf252015-09-10 17:54:10 -070067 *
Hyunsun Moond0e932a2015-09-15 22:39:16 -070068 * @return device id
Hyunsun Moonab2cf252015-09-10 17:54:10 -070069 */
Hyunsun Moon2b530322015-09-23 13:24:35 -070070 DeviceId intBrId();
Hyunsun Moonab2cf252015-09-10 17:54:10 -070071}