tom | 9c94c5b | 2014-09-17 13:14:42 -0700 | [diff] [blame] | 1 | package org.onlab.onos.openflow.controller; |
tom | 7ef8ff9 | 2014-09-17 13:08:06 -0700 | [diff] [blame] | 2 | |
| 3 | import org.projectfloodlight.openflow.protocol.OFControllerRole; |
| 4 | |
| 5 | /** |
| 6 | * The role of the controller as it pertains to a particular switch. |
| 7 | * Note that this definition of the role enum is different from the |
| 8 | * OF1.3 definition. It is maintained here to be backward compatible to |
| 9 | * earlier versions of the controller code. This enum is translated |
| 10 | * to the OF1.3 enum, before role messages are sent to the switch. |
| 11 | * See sendRoleRequestMessage method in OFSwitchImpl |
| 12 | */ |
| 13 | public enum RoleState { |
| 14 | EQUAL(OFControllerRole.ROLE_EQUAL), |
| 15 | MASTER(OFControllerRole.ROLE_MASTER), |
| 16 | SLAVE(OFControllerRole.ROLE_SLAVE); |
| 17 | |
| 18 | private RoleState(OFControllerRole nxRole) { |
| 19 | nxRole.ordinal(); |
| 20 | } |
| 21 | |
| 22 | } |
| 23 | |
| 24 | |
| 25 | |