blob: 24fd533b59dfe15fb902a3add52b0318552cce65 [file] [log] [blame]
tomb36046e2014-08-27 00:22:24 -07001package org.onlab.onos.net;
2
tomca20e0c2014-09-03 23:22:24 -07003import java.util.Set;
4
tomb36046e2014-08-27 00:22:24 -07005/**
6 * Abstraction of a network port.
7 */
8public interface Port {
9
tomca20e0c2014-09-03 23:22:24 -070010 /**
11 * Port state.
12 */
13 enum State {
14 UP, DOWN, BLOCKED, UNKNOWN
15 }
tomb36046e2014-08-27 00:22:24 -070016
17 /**
18 * Returns the port number.
19 *
20 * @return port number
21 */
22 PortNumber number();
23
24 /**
tomca20e0c2014-09-03 23:22:24 -070025 * 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 /**
tomb36046e2014-08-27 00:22:24 -070046 * 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}