Removed the TopologyElement.switchPorts container, because it is not
needed/used. Now each port for a switch is self contained in its
own TopologyElement, so it can be easily added/deleted on its own.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
index d5ceb6a..7d7d739 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/Topology.java
@@ -213,14 +213,6 @@
node = addNode(topologyElement.getSwitch());
isModified = true;
}
- // Add the ports for the switch
- for (Integer portId : topologyElement.getSwitchPorts().values()) {
- Integer port = node.getPort(portId);
- if (port == null) {
- node.addPort(portId);
- isModified = true;
- }
- }
break;
}
case ELEMENT_PORT: {
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
index 574946d..b01c7d3 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyElement.java
@@ -24,9 +24,6 @@
private long toSwitchDpid = 0; // The Neighbor Switch DPID
private int toSwitchPort = 0; // The Neighbor Switch Port
- // All (known) ports for a Switch
- private Map<Integer, Integer> switchPorts = new TreeMap<Integer, Integer>();
-
/**
* Default constructor.
*/
@@ -95,28 +92,6 @@
}
/**
- * Get the Switch Ports.
- *
- * NOTE: Applies for Type.ELEMENT_SWITCH
- *
- * @return the collection of Switch Ports.
- */
- public Map<Integer, Integer> getSwitchPorts() {
- return switchPorts;
- }
-
- /**
- * Add a Switch Port.
- *
- * NOTE: Applies for Type.ELEMENT_SWITCH
- *
- * @param switchPort the Switch Port to add.
- */
- public void addSwitchPort(int switchPort) {
- switchPorts.put(switchPort, switchPort);
- }
-
- /**
* Get the Switch Port.
*
* NOTE: Applies for Type.ELEMENT_PORT