blob: 9a0c06ef48166d03f1d64fb2d47145976737fcd5 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Jonathan Hart25bd53e2014-04-30 23:44:09 -07003import net.onrc.onos.core.util.SwitchPort;
4
5//TODO Everything returned by these interfaces must be either Unmodifiable view,
6//immutable object, or a copy of the original "SB" In-memory Topology.
7
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08008/**
Jonathan Harte37e4e22014-05-13 19:12:02 -07009 * Interface of Port object in the topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080010 */
Jonathan Hart062a2e82014-02-03 09:41:57 -080011public interface Port {
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070012
13 /**
14 * Gets the data path ID (dpid) of the switch, which this port is on.
15 *
16 * @return data path ID (dpid)
17 */
Ray Milkey269ffb92014-04-03 14:43:30 -070018 public Long getDpid();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080019
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070020 /**
21 * Gets the port number of this port.
22 *
23 * @return port number
24 */
Ray Milkey269ffb92014-04-03 14:43:30 -070025 public Long getNumber();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080026
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070027 /**
Jonathan Hart25bd53e2014-04-30 23:44:09 -070028 * Gets a {@link SwitchPort} that represents this Port's dpid and port
29 * number.
30 *
31 * @return a SwitchPort representing the Port
32 */
33 public SwitchPort asSwitchPort();
34
35 /**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070036 * Gets the hardware address of this port.
37 * <p/>
38 * TODO Not implemented yet.
39 * TODO Should return value type be Long?
40 *
41 * @return hardware address
42 */
Ray Milkey269ffb92014-04-03 14:43:30 -070043 public Long getHardwareAddress();
Yuta HIGUCHI4bfdd532014-02-07 13:47:36 -080044
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070045 /**
46 * Description of this port.
47 * <p/>
48 * TODO Not implemented yet.
49 *
50 * @return description of this port
51 */
Ray Milkey269ffb92014-04-03 14:43:30 -070052 public String getDescription();
53
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070054 /**
55 * Gets the parent switch.
56 *
57 * @return {@link Switch} instance
58 */
Ray Milkey269ffb92014-04-03 14:43:30 -070059 public Switch getSwitch();
60
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070061 /**
62 * Gets the outgoing link from this port.
63 *
64 * @return {@link Link} if there exist a outgoing link from this,
65 * {@code null} otherwise.
66 */
Ray Milkey269ffb92014-04-03 14:43:30 -070067 public Link getOutgoingLink();
68
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070069 /**
70 * Gets the incoming link to this port.
71 *
72 * @return {@link Link} if there exist a incoming link to this, {@code null}
73 * otherwise.
74 */
Ray Milkey269ffb92014-04-03 14:43:30 -070075 public Link getIncomingLink();
76
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070077 // XXX Iterable or Collection?
78 /**
79 * Gets all the devices attached to this port.
80 *
81 * @return {@link Device}s attached to this port
82 */
Ray Milkey269ffb92014-04-03 14:43:30 -070083 public Iterable<Device> getDevices();
Jonathan Hart062a2e82014-02-03 09:41:57 -080084}