tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 1 | package org.onlab.onos.cluster; |
| 2 | |
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 3 | import org.onlab.packet.IpPrefix; |
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 | */ |
Ayaka Koshibe | 1d56fe4 | 2014-09-19 16:51:58 -0700 | [diff] [blame] | 36 | IpPrefix ip(); |
tom | 73d6d1e | 2014-09-17 20:08:01 -0700 | [diff] [blame] | 37 | |
| 38 | } |