blob: 7bea4651ff8c0cf62b8e49847eb794808e031090 [file] [log] [blame]
Toshio Koide5f260652014-01-30 14:41:12 -08001package net.onrc.onos.ofcontroller.app;
2
3/**
4 * This code is valid for the architectural study purpose only.
5 * @author Toshio Koide (t-koide@onlab.us)
6 */
7public class SwitchPort extends NetworkGraphEntity {
8 protected Switch parentSwitch;
9 protected Integer portNumber;
10 protected Link outgoingLink;
11 protected Link incomingLink;
12
13 public SwitchPort(Switch parentSwitch, Integer portNumber) {
14 super(parentSwitch.getNetworkGraph());
15 this.parentSwitch = parentSwitch;
16 this.portNumber = portNumber;
17 }
18
19 public Switch getSwitch() {
20 return parentSwitch;
21 }
22
23 public void setOutgoingLink(Link link) {
24 outgoingLink = link;
25 }
26
27 public Link getOutgointLink() {
28 return outgoingLink;
29 }
30
31 public void setIncomingLink(Link link) {
32 incomingLink = link;
33 }
34
35 public Link getIncomingLink() {
36 return incomingLink;
37 }
38
39 public Integer getPortNumber() {
40 return portNumber;
41 }
42
43 @Override
44 public String toString() {
45 return String.format("%s:%d",
46 getSwitch().getName(),
47 getPortNumber());
48 }
49}