tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net; |
| 2 | |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame^] | 3 | import java.util.Set; |
| 4 | |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 5 | /** |
| 6 | * Abstraction of a network port. |
| 7 | */ |
| 8 | public interface Port { |
| 9 | |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame^] | 10 | /** |
| 11 | * Port state. |
| 12 | */ |
| 13 | enum State { |
| 14 | UP, DOWN, BLOCKED, UNKNOWN |
| 15 | } |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 16 | |
| 17 | /** |
| 18 | * Returns the port number. |
| 19 | * |
| 20 | * @return port number |
| 21 | */ |
| 22 | PortNumber number(); |
| 23 | |
| 24 | /** |
tom | ca20e0c | 2014-09-03 23:22:24 -0700 | [diff] [blame^] | 25 | * Returns the port state(s). |
| 26 | * |
| 27 | * @return port state set |
| 28 | */ |
| 29 | Set<State> state(); |
| 30 | |
| 31 | /** |
| 32 | * Indicates whether or not the port is currently up and active. |
| 33 | * |
| 34 | * @return true if the port is operational |
| 35 | */ |
| 36 | boolean isEnabled(); |
| 37 | |
| 38 | /** |
| 39 | * Indicates whether or not the port is administratively blocked. |
| 40 | * |
| 41 | * @return true if the port is blocked |
| 42 | */ |
| 43 | boolean isBlocked(); |
| 44 | |
| 45 | /** |
tom | b36046e | 2014-08-27 00:22:24 -0700 | [diff] [blame] | 46 | * Returns the identifier of the network element to which this port belongs. |
| 47 | * |
| 48 | * @return parent network element |
| 49 | */ |
| 50 | Element parent(); |
| 51 | |
| 52 | // set of port attributes |
| 53 | |
| 54 | } |