Renamed *NetworkGraph* references to *Topology*.
Change-Id: Iec01c47086e1518592c0753e75395d3fe5abcde3
diff --git a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
index e2f9d21..c1c631c 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/BroadcastPacketOutNotification.java
@@ -2,7 +2,7 @@
import java.util.Map;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
import net.onrc.onos.core.topology.Port;
import com.google.common.collect.HashMultimap;
@@ -82,17 +82,17 @@
@Override
public Multimap<Long, Short> calculateOutPorts(
- Multimap<Long, Short> localPorts, NetworkGraph networkGraph) {
+ Multimap<Long, Short> localPorts, Topology topology) {
Multimap<Long, Short> outPorts = HashMultimap.create();
for (Map.Entry<Long, Short> entry : localPorts.entries()) {
Port globalPort;
- networkGraph.acquireReadLock();
+ topology.acquireReadLock();
try {
- globalPort = networkGraph.getPort(entry.getKey(),
+ globalPort = topology.getPort(entry.getKey(),
entry.getValue().longValue());
} finally {
- networkGraph.releaseReadLock();
+ topology.releaseReadLock();
}
if ((!entry.getKey().equals(inSwitch) ||
diff --git a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
index 6bdf874..2bed639 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
@@ -22,10 +22,10 @@
import net.onrc.onos.core.datagrid.IEventChannelListener;
import net.onrc.onos.core.flowprogrammer.IFlowPusherService;
import net.onrc.onos.core.packet.Ethernet;
-import net.onrc.onos.core.topology.INetworkGraphService;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.ITopologyService;
import net.onrc.onos.core.topology.Port;
import net.onrc.onos.core.topology.Switch;
+import net.onrc.onos.core.topology.Topology;
import net.onrc.onos.core.util.SwitchPort;
import org.openflow.protocol.OFMessage;
@@ -49,7 +49,7 @@
private final CopyOnWriteArrayList<IPacketListener> listeners;
private IFloodlightProviderService floodlightProvider;
- private NetworkGraph networkGraph;
+ private Topology topology;
private IDatagridService datagrid;
private IFlowPusherService flowPusher;
@@ -74,7 +74,7 @@
}
}
Multimap<Long, Short> outPorts = value.calculateOutPorts(
- localPorts, networkGraph);
+ localPorts, topology);
sendPacketToSwitches(outPorts, value.getPacketData());
}
@@ -159,24 +159,24 @@
Ethernet eth = IFloodlightProviderService.bcStore.
get(cntx, IFloodlightProviderService.CONTEXT_PI_PAYLOAD);
- Switch networkGraphSwitch;
+ Switch topologySwitch;
Port inPort;
try {
- networkGraph.acquireReadLock();
- networkGraphSwitch = networkGraph.getSwitch(sw.getId());
- inPort = networkGraph.getPort(sw.getId(), (long) pi.getInPort());
+ topology.acquireReadLock();
+ topologySwitch = topology.getSwitch(sw.getId());
+ inPort = topology.getPort(sw.getId(), (long) pi.getInPort());
} finally {
- networkGraph.releaseReadLock();
+ topology.releaseReadLock();
}
- if (networkGraphSwitch == null || inPort == null) {
+ if (topologySwitch == null || inPort == null) {
// We can't send packets for switches or ports that aren't in the
- // network graph yet
+ // topology yet
return Command.CONTINUE;
}
for (IPacketListener listener : listeners) {
- listener.receive(networkGraphSwitch, inPort, eth);
+ listener.receive(topologySwitch, inPort, eth);
}
return Command.CONTINUE;
@@ -202,7 +202,7 @@
public Collection<Class<? extends IFloodlightService>> getModuleDependencies() {
List<Class<? extends IFloodlightService>> dependencies = new ArrayList<>();
dependencies.add(IFloodlightProviderService.class);
- dependencies.add(INetworkGraphService.class);
+ dependencies.add(ITopologyService.class);
dependencies.add(IDatagridService.class);
dependencies.add(IFlowPusherService.class);
return dependencies;
@@ -213,8 +213,8 @@
throws FloodlightModuleException {
floodlightProvider =
context.getServiceImpl(IFloodlightProviderService.class);
- networkGraph = context.getServiceImpl(INetworkGraphService.class)
- .getNetworkGraph();
+ topology = context.getServiceImpl(ITopologyService.class)
+ .getTopology();
datagrid = context.getServiceImpl(IDatagridService.class);
flowPusher = context.getServiceImpl(IFlowPusherService.class);
}
diff --git a/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
index 0307d2f..b92518a 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/PacketOutNotification.java
@@ -3,7 +3,7 @@
import java.io.Serializable;
import java.util.Arrays;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
import com.google.common.collect.Multimap;
@@ -54,11 +54,11 @@
* instance.
*
* @param localPorts the map of locally-controlled ports
- * @param networkGraph an instance of the global network graph
+ * @param topology an instance of the global topology
* @return a multimap of ports that the packet should be sent out,
* in the form
* {@code {dpid1 => {portnum1, portnum2, ...}, dpid2 => {portnum1}, ...}}
*/
public abstract Multimap<Long, Short> calculateOutPorts(
- Multimap<Long, Short> localPorts, NetworkGraph networkGraph);
+ Multimap<Long, Short> localPorts, Topology topology);
}
diff --git a/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java b/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
index edf017b..0521434 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/SinglePacketOutNotification.java
@@ -1,6 +1,6 @@
package net.onrc.onos.core.packetservice;
-import net.onrc.onos.core.topology.NetworkGraph;
+import net.onrc.onos.core.topology.Topology;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
@@ -72,7 +72,7 @@
@Override
public Multimap<Long, Short> calculateOutPorts(
- Multimap<Long, Short> localPorts, NetworkGraph networkGraph) {
+ Multimap<Long, Short> localPorts, Topology topology) {
Multimap<Long, Short> outPorts = HashMultimap.create();
if (localPorts.containsEntry(outSwitch, outPort)) {