blob: 75aac524eef1249ffbeabd004fe4ffbf40e39310 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -07003// TODO Everything returned by these interfaces must be either Unmodifiable view,
4// immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08005/**
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -07006 * Interface of Port object in Network Graph topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08007 */
Jonathan Hart062a2e82014-02-03 09:41:57 -08008public interface Port {
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -07009
10 /**
11 * Gets the data path ID (dpid) of the switch, which this port is on.
12 *
13 * @return data path ID (dpid)
14 */
Ray Milkey269ffb92014-04-03 14:43:30 -070015 public Long getDpid();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080016
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070017 /**
18 * Gets the port number of this port.
19 *
20 * @return port number
21 */
Ray Milkey269ffb92014-04-03 14:43:30 -070022 public Long getNumber();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080023
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070024 /**
25 * Gets the hardware address of this port.
26 * <p/>
27 * TODO Not implemented yet.
28 * TODO Should return value type be Long?
29 *
30 * @return hardware address
31 */
Ray Milkey269ffb92014-04-03 14:43:30 -070032 public Long getHardwareAddress();
Yuta HIGUCHI4bfdd532014-02-07 13:47:36 -080033
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070034 /**
35 * Description of this port.
36 * <p/>
37 * TODO Not implemented yet.
38 *
39 * @return description of this port
40 */
Ray Milkey269ffb92014-04-03 14:43:30 -070041 public String getDescription();
42
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070043 /**
44 * Gets the parent switch.
45 *
46 * @return {@link Switch} instance
47 */
Ray Milkey269ffb92014-04-03 14:43:30 -070048 public Switch getSwitch();
49
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070050 /**
51 * Gets the outgoing link from this port.
52 *
53 * @return {@link Link} if there exist a outgoing link from this,
54 * {@code null} otherwise.
55 */
Ray Milkey269ffb92014-04-03 14:43:30 -070056 public Link getOutgoingLink();
57
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070058 /**
59 * Gets the incoming link to this port.
60 *
61 * @return {@link Link} if there exist a incoming link to this, {@code null}
62 * otherwise.
63 */
Ray Milkey269ffb92014-04-03 14:43:30 -070064 public Link getIncomingLink();
65
Yuta HIGUCHIce4a06b2014-04-25 19:37:57 -070066 // XXX Iterable or Collection?
67 /**
68 * Gets all the devices attached to this port.
69 *
70 * @return {@link Device}s attached to this port
71 */
Ray Milkey269ffb92014-04-03 14:43:30 -070072 public Iterable<Device> getDevices();
Jonathan Hart062a2e82014-02-03 09:41:57 -080073}