Merge branch 'master' into fix_findbug_issues
diff --git a/conf/onos-embedded.properties b/conf/onos-embedded.properties
index 5e09059..8bbf25d 100644
--- a/conf/onos-embedded.properties
+++ b/conf/onos-embedded.properties
@@ -8,6 +8,7 @@
net.floodlightcontroller.perfmon.PktInProcessingTime,\
net.floodlightcontroller.ui.web.StaticWebRoutable,\
net.onrc.onos.datagrid.HazelcastDatagrid,\
+net.onrc.onos.ofcontroller.flowmanager.FlowManager,\
net.onrc.onos.registry.controller.ZookeeperRegistry
net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
diff --git a/conf/onos.properties b/conf/onos.properties
index 4920744..c67b340 100644
--- a/conf/onos.properties
+++ b/conf/onos.properties
@@ -7,6 +7,8 @@
net.floodlightcontroller.counter.CounterStore,\
net.floodlightcontroller.perfmon.PktInProcessingTime,\
net.floodlightcontroller.ui.web.StaticWebRoutable,\
+net.onrc.onos.datagrid.HazelcastDatagrid,\
+net.onrc.onos.ofcontroller.flowmanager.FlowManager,\
net.onrc.onos.registry.controller.ZookeeperRegistry
net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
diff --git a/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java b/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
index c821339..95daf96 100644
--- a/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
+++ b/src/main/java/net/floodlightcontroller/core/FloodlightProvider.java
@@ -15,7 +15,6 @@
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.storage.IStorageSourceService;
import net.floodlightcontroller.threadpool.IThreadPoolService;
-import net.onrc.onos.ofcontroller.flowmanager.IFlowService;
import net.onrc.onos.registry.controller.IControllerRegistryService;
public class FloodlightProvider implements IFloodlightModule {
@@ -52,7 +51,6 @@
dependencies.add(ICounterStoreService.class);
dependencies.add(IThreadPoolService.class);
// Following added by ONOS
- dependencies.add(IFlowService.class);
dependencies.add(IControllerRegistryService.class);
return dependencies;
@@ -71,7 +69,6 @@
controller.setThreadPoolService(
context.getServiceImpl(IThreadPoolService.class));
// Following added by ONOS
- controller.setFlowService(context.getServiceImpl(IFlowService.class));
controller.setMastershipService(
context.getServiceImpl(IControllerRegistryService.class));
diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
index 8d74a0f..44510a7 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java
@@ -75,7 +75,6 @@
import net.floodlightcontroller.storage.StorageException;
import net.floodlightcontroller.threadpool.IThreadPoolService;
import net.onrc.onos.ofcontroller.core.IOFSwitchPortListener;
-import net.onrc.onos.ofcontroller.flowmanager.IFlowService;
import net.onrc.onos.registry.controller.IControllerRegistryService;
import net.onrc.onos.registry.controller.IControllerRegistryService.ControlChangeCallback;
import net.onrc.onos.registry.controller.RegistryException;
@@ -146,7 +145,7 @@
* - Detailed Port event: PORTCHANGED -> {PORTCHANGED, PORTADDED, PORTREMOVED}
* Available as net.onrc.onos.ofcontroller.core.IOFSwitchPortListener
* - Distributed ownership control of switch through RegistryService(IControllerRegistryService)
- * - Register ONOS services. (IFlowService, IControllerRegistryService)
+ * - Register ONOS services. (IControllerRegistryService)
* - Additional DEBUG logs
* - Try using hostname as controller ID, when ID was not explicitly given.
*/
@@ -188,7 +187,6 @@
protected IStorageSourceService storageSource;
protected IPktInProcessingTimeService pktinProcTime;
protected IThreadPoolService threadPool;
- protected IFlowService flowService;
protected IControllerRegistryService registryService;
// Configuration options
@@ -405,10 +403,6 @@
this.threadPool = tp;
}
- public void setFlowService(IFlowService serviceImpl) {
- this.flowService = serviceImpl;
- }
-
public void setMastershipService(IControllerRegistryService serviceImpl) {
this.registryService = serviceImpl;
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index 826fd93..9b6ac53 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -34,7 +34,6 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.ofcontroller.bgproute.RibUpdate.Operation;
import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoLinkService;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
import net.onrc.onos.ofcontroller.core.internal.TopoLinkServiceImpl;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery.LDUpdate;
@@ -42,7 +41,8 @@
import net.onrc.onos.ofcontroller.proxyarp.IArpRequester;
import net.onrc.onos.ofcontroller.proxyarp.IProxyArpService;
import net.onrc.onos.ofcontroller.proxyarp.ProxyArpManager;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.ITopologyNetService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.FlowEntry;
@@ -83,7 +83,7 @@
protected IFloodlightProviderService floodlightProvider;
protected ITopologyService topology;
- protected ITopoRouteService topoRouteService;
+ protected ITopologyNetService topologyNetService;
protected ILinkDiscoveryService linkDiscoveryService;
protected IRestApiService restApi;
@@ -142,7 +142,7 @@
private FlowCache flowCache;
- protected volatile Map<Long, ?> topoRouteTopology = null;
+ protected volatile Map<Long, ?> shortestPathTopo = null;
protected class TopologyChangeDetector implements Runnable {
@Override
@@ -272,7 +272,7 @@
ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
topologyChangeDetectorTask = new SingletonTask(executor, new TopologyChangeDetector());
- topoRouteService = new TopoRouteService("");
+ topologyNetService = new TopologyManager("");
pathsWaitingOnArp = new HashMap<InetAddress, Path>();
prefixesWaitingOnArp = Multimaps.synchronizedSetMultimap(
@@ -498,14 +498,14 @@
//Add a flow to rewrite mac for this prefix to all other border switches
for (Interface srcInterface : srcInterfaces.values()) {
DataPath shortestPath;
- if (topoRouteTopology == null) {
- shortestPath = topoRouteService.getShortestPath(
+ if (shortestPathTopo == null) {
+ shortestPath = topologyNetService.getShortestPath(
srcInterface.getSwitchPort(),
egressInterface.getSwitchPort());
}
else {
- shortestPath = topoRouteService.getTopoShortestPath(
- topoRouteTopology, srcInterface.getSwitchPort(),
+ shortestPath = topologyNetService.getTopoShortestPath(
+ shortestPathTopo, srcInterface.getSwitchPort(),
egressInterface.getSwitchPort());
}
@@ -697,12 +697,12 @@
}
DataPath shortestPath;
- if (topoRouteTopology == null) {
- shortestPath = topoRouteService.getShortestPath(
+ if (shortestPathTopo == null) {
+ shortestPath = topologyNetService.getShortestPath(
srcInterface.getSwitchPort(), dstInterface.getSwitchPort());
}
else {
- shortestPath = topoRouteService.getTopoShortestPath(topoRouteTopology,
+ shortestPath = topologyNetService.getTopoShortestPath(shortestPathTopo,
srcInterface.getSwitchPort(), dstInterface.getSwitchPort());
}
@@ -771,7 +771,7 @@
for (BgpPeer bgpPeer : bgpPeers.values()){
Interface peerInterface = interfaces.get(bgpPeer.getInterfaceName());
- DataPath path = topoRouteService.getShortestPath(
+ DataPath path = topologyNetService.getShortestPath(
peerInterface.getSwitchPort(), bgpdAttachmentPoint);
if (path == null){
@@ -1046,7 +1046,7 @@
private void beginRouting(){
log.debug("Topology is now ready, beginning routing function");
- topoRouteTopology = topoRouteService.prepareShortestPathTopo();
+ shortestPathTopo = topologyNetService.prepareShortestPathTopo();
setupArpFlows();
setupDefaultDropFlows();
@@ -1086,7 +1086,7 @@
continue;
}
- DataPath shortestPath = topoRouteService.getShortestPath(
+ DataPath shortestPath = topologyNetService.getShortestPath(
srcInterface.getSwitchPort(), dstInterface.getSwitchPort());
if (shortestPath == null){
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
index 954515b..f5ccc49 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyService.java
@@ -1,16 +1,11 @@
package net.onrc.onos.ofcontroller.core;
import java.util.List;
-import java.util.Map;
-import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.routing.Link;
-import net.floodlightcontroller.topology.NodePortTuple;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
-import net.onrc.onos.ofcontroller.util.DataPath;
-import net.onrc.onos.ofcontroller.util.SwitchPort;
public interface INetMapTopologyService extends INetMapService {
@@ -34,90 +29,4 @@
Iterable<IDeviceObject> getDevicesOnSwitch(String dpid);
Iterable<IDeviceObject> getDevicesOnSwitch(String dpid, short port_num);
}
-
- public interface ITopoRouteService extends IFloodlightService {
- /**
- * Get the shortest path from a source to a destination.
- *
- * @param src the source in the shortest path computation.
- * @param dest the destination in the shortest path computation.
- * @return the data path with the computed shortest path if
- * found, otherwise null.
- */
- DataPath getShortestPath(SwitchPort src, SwitchPort dest);
-
- /**
- * Fetch the Switch and Ports info from the Titan Graph
- * and return it for fast access during the shortest path
- * computation.
- *
- * After fetching the state, method @ref getTopoShortestPath()
- * can be used for fast shortest path computation.
- *
- * Note: There is certain cost to fetch the state, hence it should
- * be used only when there is a large number of shortest path
- * computations that need to be done on the same topology.
- * Typically, a single call to @ref prepareShortestPathTopo()
- * should be followed by a large number of calls to
- * method @ref getTopoShortestPath().
- * After the last @ref getTopoShortestPath() call,
- * method @ref dropShortestPathTopo() should be used to release
- * the internal state that is not needed anymore:
- *
- * Map<Long, ?> shortestPathTopo;
- * shortestPathTopo = prepareShortestPathTopo();
- * for (int i = 0; i < 10000; i++) {
- * dataPath = getTopoShortestPath(shortestPathTopo, ...);
- * ...
- * }
- * dropShortestPathTopo(shortestPathTopo);
- *
- * @return the Shortest Path info handler stored in a map.
- */
- Map<Long, ?> prepareShortestPathTopo();
-
- /**
- * Release the state that was populated by
- * method @ref prepareShortestPathTopo().
- *
- * See the documentation for method @ref prepareShortestPathTopo()
- * for additional information and usage.
- *
- * @param shortestPathTopo the Shortest Path info handler to release.
- */
- void dropShortestPathTopo(Map<Long, ?> shortestPathTopo);
-
- /**
- * Get the shortest path from a source to a destination by
- * using the pre-populated local topology state prepared
- * by method @ref prepareShortestPathTopo().
- *
- * See the documentation for method @ref prepareShortestPathTopo()
- * for additional information and usage.
- *
- * @param shortestPathTopo the Shortest Path info handler
- * to use.
- * @param src the source in the shortest path computation.
- * @param dest the destination in the shortest path computation.
- * @return the data path with the computed shortest path if
- * found, otherwise null.
- */
- DataPath getTopoShortestPath(Map<Long, ?> shortestPathTopo,
- SwitchPort src, SwitchPort dest);
-
- /**
- * Test whether a route exists from a source to a destination.
- *
- * @param src the source node for the test.
- * @param dest the destination node for the test.
- * @return true if a route exists, otherwise false.
- */
- Boolean routeExists(SwitchPort src, SwitchPort dest);
- }
-
- public interface ITopoFlowService {
- Boolean flowExists(NodePortTuple src, NodePortTuple dest);
- List<NodePortTuple> getShortestFlowPath(NodePortTuple src, NodePortTuple dest);
-
- }
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 8e4d81a..2c5f4ba 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -33,9 +33,9 @@
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
import net.onrc.onos.ofcontroller.flowmanager.web.FlowWebRoutable;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.ITopologyNetService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.CallerId;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.DataPathEndpoints;
@@ -73,7 +73,7 @@
protected IRestApiService restApi;
protected volatile IFloodlightProviderService floodlightProvider;
- protected volatile ITopoRouteService topoRouteService;
+ protected volatile ITopologyNetService topologyNetService;
protected FloodlightModuleContext context;
protected OFMessageDamper messageDamper;
@@ -294,7 +294,7 @@
// Flow Paths this controller is responsible for.
//
Map<Long, ?> shortestPathTopo =
- topoRouteService.prepareShortestPathTopo();
+ topologyNetService.prepareShortestPathTopo();
Iterable<IFlowPath> allFlowPaths = op.getAllFlowPaths();
for (IFlowPath flowPathObj : allFlowPaths) {
counterAllFlowPaths++;
@@ -368,9 +368,9 @@
// to avoid closing the transaction.
//
DataPath dataPath =
- topoRouteService.getTopoShortestPath(shortestPathTopo,
- srcSwitchPort,
- dstSwitchPort);
+ topologyNetService.getTopoShortestPath(shortestPathTopo,
+ srcSwitchPort,
+ dstSwitchPort);
if (dataPath == null) {
// We need the DataPath to compare the paths
dataPath = new DataPath();
@@ -395,7 +395,7 @@
op.removeFlowPath(flowPathObj);
}
- topoRouteService.dropShortestPathTopo(shortestPathTopo);
+ topologyNetService.dropShortestPathTopo(shortestPathTopo);
op.commit();
@@ -429,7 +429,7 @@
@Override
public void init(String conf) {
op = new GraphDBOperation(conf);
- topoRouteService = new TopoRouteService(conf);
+ topologyNetService = new TopologyManager(conf);
}
/**
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java b/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java
new file mode 100644
index 0000000..bd0ca38
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/ITopologyNetService.java
@@ -0,0 +1,90 @@
+package net.onrc.onos.ofcontroller.topology;
+
+import java.util.Map;
+
+import net.floodlightcontroller.core.module.IFloodlightService;
+import net.onrc.onos.ofcontroller.util.DataPath;
+import net.onrc.onos.ofcontroller.util.SwitchPort;
+
+/**
+ * Interface for providing Topology Network Service to other modules.
+ */
+public interface ITopologyNetService extends IFloodlightService {
+ /**
+ * Get the shortest path from a source to a destination.
+ *
+ * @param src the source in the shortest path computation.
+ * @param dest the destination in the shortest path computation.
+ * @return the data path with the computed shortest path if
+ * found, otherwise null.
+ */
+ DataPath getShortestPath(SwitchPort src, SwitchPort dest);
+
+ /**
+ * Fetch the Switch and Ports info from the Titan Graph
+ * and return it for fast access during the shortest path
+ * computation.
+ *
+ * After fetching the state, method @ref getTopoShortestPath()
+ * can be used for fast shortest path computation.
+ *
+ * Note: There is certain cost to fetch the state, hence it should
+ * be used only when there is a large number of shortest path
+ * computations that need to be done on the same topology.
+ * Typically, a single call to @ref prepareShortestPathTopo()
+ * should be followed by a large number of calls to
+ * method @ref getTopoShortestPath().
+ * After the last @ref getTopoShortestPath() call,
+ * method @ref dropShortestPathTopo() should be used to release
+ * the internal state that is not needed anymore:
+ *
+ * Map<Long, ?> shortestPathTopo;
+ * shortestPathTopo = prepareShortestPathTopo();
+ * for (int i = 0; i < 10000; i++) {
+ * dataPath = getTopoShortestPath(shortestPathTopo, ...);
+ * ...
+ * }
+ * dropShortestPathTopo(shortestPathTopo);
+ *
+ * @return the Shortest Path info handler stored in a map.
+ */
+ Map<Long, ?> prepareShortestPathTopo();
+
+ /**
+ * Release the state that was populated by
+ * method @ref prepareShortestPathTopo().
+ *
+ * See the documentation for method @ref prepareShortestPathTopo()
+ * for additional information and usage.
+ *
+ * @param shortestPathTopo the Shortest Path info handler to release.
+ */
+ void dropShortestPathTopo(Map<Long, ?> shortestPathTopo);
+
+ /**
+ * Get the shortest path from a source to a destination by
+ * using the pre-populated local topology state prepared
+ * by method @ref prepareShortestPathTopo().
+ *
+ * See the documentation for method @ref prepareShortestPathTopo()
+ * for additional information and usage.
+ *
+ * @param shortestPathTopo the Shortest Path info handler
+ * to use.
+ * @param src the source in the shortest path computation.
+ * @param dest the destination in the shortest path computation.
+ * @return the data path with the computed shortest path if
+ * found, otherwise null.
+ */
+ DataPath getTopoShortestPath(Map<Long, ?> shortestPathTopo,
+ SwitchPort src, SwitchPort dest);
+
+ /**
+ * Test whether a route exists from a source to a destination.
+ *
+ * @param src the source node for the test.
+ * @param dest the destination node for the test.
+ * @return true if a route exists, otherwise false.
+ */
+ Boolean routeExists(SwitchPort src, SwitchPort dest);
+}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
similarity index 97%
rename from src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
rename to src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
index 7ccf207..618ae39 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/routing/TopoRouteService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/TopologyManager.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.ofcontroller.routing;
+package net.onrc.onos.ofcontroller.topology;
import java.util.Collections;
import java.util.HashMap;
@@ -11,7 +11,6 @@
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
import net.onrc.onos.ofcontroller.core.ISwitchStorage.SwitchState;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.Dpid;
@@ -87,13 +86,12 @@
};
/**
- * A class for implementing Topology Route Service.
+ * A class for implementing Topology Network Service.
*/
-public class TopoRouteService implements ITopoRouteService {
+public class TopologyManager implements ITopologyNetService {
/** The logger. */
- private static Logger log =
- LoggerFactory.getLogger(TopoRouteService.class);
+ private static Logger log = LoggerFactory.getLogger(TopologyManager.class);
protected GraphDBOperation op;
@@ -101,7 +99,7 @@
/**
* Default constructor.
*/
- public TopoRouteService() {
+ public TopologyManager() {
}
/**
@@ -110,7 +108,7 @@
* @param config the database configuration file to use for
* the initialization.
*/
- public TopoRouteService(String config) {
+ public TopologyManager(String config) {
this.init(config);
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
index 659609d..a730719 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/topology/web/RouteResource.java
@@ -1,7 +1,7 @@
package net.onrc.onos.ofcontroller.topology.web;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.ITopologyNetService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.Port;
@@ -18,9 +18,9 @@
@Get("json")
public DataPath retrieve() {
- ITopoRouteService topoRouteService = new TopoRouteService("");
- if (topoRouteService == null) {
- log.debug("Topology Route Service not found");
+ ITopologyNetService topologyNetService = new TopologyManager("");
+ if (topologyNetService == null) {
+ log.debug("Topology Net Service not found");
return null;
}
@@ -37,8 +37,8 @@
Port dstPort = new Port(Short.parseShort(dstPortStr));
DataPath result =
- topoRouteService.getShortestPath(new SwitchPort(srcDpid, srcPort),
- new SwitchPort(dstDpid, dstPort));
+ topologyNetService.getShortestPath(new SwitchPort(srcDpid, srcPort),
+ new SwitchPort(dstDpid, dstPort));
if (result != null) {
return result;
} else {
diff --git a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
index d3508ff..99ded31 100644
--- a/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
+++ b/src/main/resources/META-INF/services/net.floodlightcontroller.core.module.IFloodlightModule
@@ -20,7 +20,7 @@
net.floodlightcontroller.core.test.MockThreadPoolService
net.onrc.onos.datagrid.HazelcastDatagrid
net.onrc.onos.ofcontroller.flowmanager.FlowManager
-net.onrc.onos.ofcontroller.routing.TopoRouteService
+net.onrc.onos.ofcontroller.topology.TopologyManager
net.onrc.onos.ofcontroller.bgproute.BgpRoute
net.onrc.onos.registry.controller.ZookeeperRegistry
net.onrc.onos.registry.controller.StandaloneRegistry
diff --git a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
index 4516ece..21788af 100644
--- a/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
+++ b/src/test/java/net/floodlightcontroller/core/internal/ControllerTest.java
@@ -70,10 +70,10 @@
import net.floodlightcontroller.test.FloodlightTestCase;
import net.floodlightcontroller.threadpool.IThreadPoolService;
import net.onrc.onos.ofcontroller.core.IOFSwitchPortListener;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyService.ITopoRouteService;
import net.onrc.onos.ofcontroller.flowmanager.FlowManager;
import net.onrc.onos.ofcontroller.flowmanager.IFlowService;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.ITopologyNetService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.registry.controller.IControllerRegistryService;
import net.onrc.onos.registry.controller.StandaloneRegistry;
@@ -139,7 +139,7 @@
// Following added by ONOS
// TODO replace with mock if further testing is needed.
fmc.addService(IFlowService.class, new FlowManager() );
- fmc.addService(ITopoRouteService.class, new TopoRouteService() );
+ fmc.addService(ITopologyNetService.class, new TopologyManager() );
StandaloneRegistry sr = new StandaloneRegistry();
fmc.addService(IControllerRegistryService.class, sr );
diff --git a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
index 83a5fab..68e31ba 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
@@ -19,7 +19,7 @@
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
import net.onrc.onos.ofcontroller.flowmanager.web.FlowWebRoutable;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.*;
import org.easymock.EasyMock;
@@ -43,7 +43,7 @@
public class FlowManagerTest {
private static FloodlightModuleContext context;
private static IFloodlightProviderService floodlightProvider;
- private static TopoRouteService topoRouteService;
+ private static TopologyManager topologyManager;
private static IRestApiService restApi;
private static GraphDBOperation op;
@@ -68,7 +68,7 @@
// create mock objects
context = createMock(FloodlightModuleContext.class);
floodlightProvider = createMock(IFloodlightProviderService.class);
- topoRouteService = createMock(TopoRouteService.class);
+ topologyManager = createMock(TopologyManager.class);
restApi = createMock(IRestApiService.class);
op = createMock(GraphDBOperation.class);
@@ -76,7 +76,7 @@
expect(context.getServiceImpl(IFloodlightProviderService.class)).andReturn(floodlightProvider);
expect(context.getServiceImpl(IRestApiService.class)).andReturn(restApi);
expectNew(GraphDBOperation.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(op);
- expectNew(TopoRouteService.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(topoRouteService);
+ expectNew(TopologyManager.class, new Class<?>[] {String.class}, EasyMock.isA(String.class)).andReturn(topologyManager);
}
private IFlowPath createIFlowPathMock(long flowId, String installerID,
diff --git a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java b/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
similarity index 81%
rename from src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
rename to src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
index 7929eb1..fbec59e 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/routing/TopoRouteServiceTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/topology/TopologyManagerTest.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.ofcontroller.routing;
+package net.onrc.onos.ofcontroller.topology;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
@@ -20,7 +20,7 @@
import net.onrc.onos.graph.GraphDBConnection;
import net.onrc.onos.graph.GraphDBOperation;
import net.onrc.onos.ofcontroller.core.internal.TestDatabaseManager;
-import net.onrc.onos.ofcontroller.routing.TopoRouteService;
+import net.onrc.onos.ofcontroller.topology.TopologyManager;
import net.onrc.onos.ofcontroller.util.DataPath;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.FlowPathFlags;
@@ -28,17 +28,17 @@
import net.onrc.onos.ofcontroller.util.SwitchPort;
/**
- * A class for testing the TopoRouteService class.
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService
+ * A class for testing the TopologyManager class.
+ * @see net.onrc.onos.ofcontroller.topology.TopologyManager
*/
@RunWith(PowerMockRunner.class)
-@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, TopoRouteService.class})
-public class TopoRouteServiceTest {
+@PrepareForTest({TitanFactory.class, GraphDBConnection.class, GraphDBOperation.class, TopologyManager.class})
+public class TopologyManagerTest {
String conf;
private GraphDBConnection conn = null;
private GraphDBOperation oper = null;
private TitanGraph titanGraph = null;
- private TopoRouteService topoRouteService = null;
+ private TopologyManager topologyManager = null;
/**
* Setup the tests.
@@ -63,9 +63,9 @@
// Populate the database
TestDatabaseManager.populateTestData(titanGraph);
- // Prepare the TopoRouteService instance
- topoRouteService = new TopoRouteService();
- topoRouteService.setDbOperationHandler(oper);
+ // Prepare the TopologyManager instance
+ topologyManager = new TopologyManager();
+ topologyManager.setDbOperationHandler(oper);
}
/**
@@ -78,9 +78,9 @@
}
/**
- * Test method TopoRouteService.getTopoShortestPath()
+ * Test method TopologyManager.getTopoShortestPath()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#getTopoShortestPath
+ * @see net.onrc.onos.ofcontroller.topology.TopologyManager#getTopoShortestPath
*/
@Test
public void test_getTopoShortestPath() {
@@ -104,10 +104,10 @@
// Test a valid Shortest-Path computation
//
Map<Long, ?> shortestPathTopo =
- topoRouteService.prepareShortestPathTopo();
- dataPath = topoRouteService.getTopoShortestPath(shortestPathTopo,
- srcSwitchPort,
- dstSwitchPort);
+ topologyManager.prepareShortestPathTopo();
+ dataPath = topologyManager.getTopoShortestPath(shortestPathTopo,
+ srcSwitchPort,
+ dstSwitchPort);
assertTrue(dataPath != null);
String dataPathSummaryStr = dataPath.dataPathSummary();
// System.out.println(dataPathSummaryStr);
@@ -134,18 +134,18 @@
String noSuchDpidStr = "ff:ff:00:00:00:00:0a:06";
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- dataPath = topoRouteService.getTopoShortestPath(shortestPathTopo,
- srcSwitchPort,
- noSuchDstSwitchPort);
+ dataPath = topologyManager.getTopoShortestPath(shortestPathTopo,
+ srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(dataPath == null);
- topoRouteService.dropShortestPathTopo(shortestPathTopo);
+ topologyManager.dropShortestPathTopo(shortestPathTopo);
}
/**
- * Test method TopoRouteService.getShortestPath()
+ * Test method TopologyManager.getShortestPath()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#getShortestPath
+ * @see net.onrc.onos.ofcontroller.routing.TopologyManager#getShortestPath
*/
@Test
public void test_getShortestPath() {
@@ -168,8 +168,8 @@
//
// Test a valid Shortest-Path computation
//
- dataPath = topoRouteService.getShortestPath(srcSwitchPort,
- dstSwitchPort);
+ dataPath = topologyManager.getShortestPath(srcSwitchPort,
+ dstSwitchPort);
assertTrue(dataPath != null);
String dataPathSummaryStr = dataPath.dataPathSummary();
// System.out.println(dataPathSummaryStr);
@@ -197,15 +197,15 @@
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- dataPath = topoRouteService.getShortestPath(srcSwitchPort,
- noSuchDstSwitchPort);
+ dataPath = topologyManager.getShortestPath(srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(dataPath == null);
}
/**
- * Test method TopoRouteService.routeExists()
+ * Test method TopologyManager.routeExists()
*
- * @see net.onrc.onos.ofcontroller.routing.TopoRouteService#routeExists
+ * @see net.onrc.onos.ofcontroller.routing.TopologyManager#routeExists
*/
@Test
public void test_routeExists() {
@@ -228,7 +228,7 @@
//
// Test a valid route
//
- result = topoRouteService.routeExists(srcSwitchPort, dstSwitchPort);
+ result = topologyManager.routeExists(srcSwitchPort, dstSwitchPort);
assertTrue(result == true);
//
@@ -237,8 +237,8 @@
String noSuchDpidStr = "ff:ff:00:00:00:00:0a:06";
Dpid noSuchDstDpid = new Dpid(noSuchDpidStr);
SwitchPort noSuchDstSwitchPort = new SwitchPort(noSuchDstDpid, dstPort);
- result = topoRouteService.routeExists(srcSwitchPort,
- noSuchDstSwitchPort);
+ result = topologyManager.routeExists(srcSwitchPort,
+ noSuchDstSwitchPort);
assertTrue(result != true);
}
}
diff --git a/start-onos.sh b/start-onos.sh
index 7005985..495141d 100755
--- a/start-onos.sh
+++ b/start-onos.sh
@@ -34,6 +34,7 @@
-Dcom.sun.management.jmxremote.port=7189 \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=false"
+JVM_OPTS="$JVM_OPTS -Dhazelcast.logging.type=slf4j"
# Set ONOS core main class
MAIN_CLASS="net.onrc.onos.ofcontroller.core.Main"