tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 1 | package org.onlab.onos.cluster; |
| 2 | |
Pavlin Radoslavov | 444b519 | 2014-10-28 10:45:19 -0700 | [diff] [blame] | 3 | import org.onlab.packet.IpAddress; |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 4 | |
| 5 | /** |
| 6 | * Represents a controller instance as a member in a cluster. |
| 7 | */ |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 8 | public interface ControllerNode { |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 9 | |
| 10 | /** Represents the operational state of the instance. */ |
| 11 | public enum State { |
| 12 | /** |
| 13 | * Signifies that the instance is active and operating normally. |
| 14 | */ |
| 15 | ACTIVE, |
| 16 | |
| 17 | /** |
| 18 | * Signifies that the instance is inactive, which means either down or |
| 19 | * up, but not operational. |
| 20 | */ |
| 21 | INACTIVE |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Returns the instance identifier. |
| 26 | * |
| 27 | * @return instance identifier |
| 28 | */ |
tom | e472987 | 2014-09-23 00:37:37 -0700 | [diff] [blame] | 29 | NodeId id(); |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
| 32 | * Returns the IP address of the controller instance. |
| 33 | * |
| 34 | * @return IP address |
| 35 | */ |
Pavlin Radoslavov | 444b519 | 2014-10-28 10:45:19 -0700 | [diff] [blame] | 36 | IpAddress ip(); |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 37 | |
tom | ee49c37 | 2014-09-26 15:14:50 -0700 | [diff] [blame] | 38 | |
| 39 | /** |
| 40 | * Returns the TCP port on which the node listens for connections. |
| 41 | * |
| 42 | * @return TCP port |
| 43 | */ |
| 44 | int tcpPort(); |
| 45 | |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 46 | } |