Renamed class PathComputation to FlowEventHandler to reflect better
its purpose.
diff --git a/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java b/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
index 484bb14..41b4957 100644
--- a/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
+++ b/src/main/java/net/onrc/onos/datagrid/HazelcastDatagrid.java
@@ -18,7 +18,7 @@
import net.floodlightcontroller.core.module.IFloodlightModule;
import net.floodlightcontroller.core.module.IFloodlightService;
-import net.onrc.onos.ofcontroller.flowmanager.IPathComputationService;
+import net.onrc.onos.ofcontroller.flowmanager.IFlowEventHandlerService;
import net.onrc.onos.ofcontroller.topology.TopologyElement;
import net.onrc.onos.ofcontroller.util.FlowEntry;
import net.onrc.onos.ofcontroller.util.FlowEntryId;
@@ -54,7 +54,7 @@
private Config hazelcastConfig = null;
private KryoFactory kryoFactory = new KryoFactory();
- private IPathComputationService pathComputationService = null;
+ private IFlowEventHandlerService flowEventHandlerService = null;
// State related to the Flow map
protected static final String mapFlowName = "mapFlow";
@@ -98,7 +98,7 @@
Input input = new Input(valueBytes);
FlowPath flowPath = kryo.readObject(input, FlowPath.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowAdded(flowPath);
+ flowEventHandlerService.notificationRecvFlowAdded(flowPath);
}
/**
@@ -117,7 +117,7 @@
Input input = new Input(valueBytes);
FlowPath flowPath = kryo.readObject(input, FlowPath.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowRemoved(flowPath);
+ flowEventHandlerService.notificationRecvFlowRemoved(flowPath);
}
/**
@@ -136,7 +136,7 @@
Input input = new Input(valueBytes);
FlowPath flowPath = kryo.readObject(input, FlowPath.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowUpdated(flowPath);
+ flowEventHandlerService.notificationRecvFlowUpdated(flowPath);
}
/**
@@ -173,7 +173,7 @@
Input input = new Input(valueBytes);
FlowEntry flowEntry = kryo.readObject(input, FlowEntry.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowEntryAdded(flowEntry);
+ flowEventHandlerService.notificationRecvFlowEntryAdded(flowEntry);
}
/**
@@ -192,7 +192,7 @@
Input input = new Input(valueBytes);
FlowEntry flowEntry = kryo.readObject(input, FlowEntry.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowEntryRemoved(flowEntry);
+ flowEventHandlerService.notificationRecvFlowEntryRemoved(flowEntry);
}
/**
@@ -211,7 +211,7 @@
Input input = new Input(valueBytes);
FlowEntry flowEntry = kryo.readObject(input, FlowEntry.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvFlowEntryUpdated(flowEntry);
+ flowEventHandlerService.notificationRecvFlowEntryUpdated(flowEntry);
}
/**
@@ -249,7 +249,7 @@
TopologyElement topologyElement =
kryo.readObject(input, TopologyElement.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvTopologyElementAdded(topologyElement);
+ flowEventHandlerService.notificationRecvTopologyElementAdded(topologyElement);
}
/**
@@ -269,7 +269,7 @@
TopologyElement topologyElement =
kryo.readObject(input, TopologyElement.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvTopologyElementRemoved(topologyElement);
+ flowEventHandlerService.notificationRecvTopologyElementRemoved(topologyElement);
}
/**
@@ -289,7 +289,7 @@
TopologyElement topologyElement =
kryo.readObject(input, TopologyElement.class);
kryoFactory.deleteKryo(kryo);
- pathComputationService.notificationRecvTopologyElementUpdated(topologyElement);
+ flowEventHandlerService.notificationRecvTopologyElementUpdated(topologyElement);
}
/**
@@ -415,16 +415,16 @@
}
/**
- * Register Path Computation Service for receiving Flow-related
+ * Register Flow Event Handler Service for receiving Flow-related
* notifications.
*
- * NOTE: Only a single Path Computation Service can be registered.
+ * NOTE: Only a single Flow Event Handler Service can be registered.
*
- * @param pathComputationService the Path Computation Service to register.
+ * @param flowEventHandlerService the Flow Event Handler Service to register.
*/
@Override
- public void registerPathComputationService(IPathComputationService pathComputationService) {
- this.pathComputationService = pathComputationService;
+ public void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService) {
+ this.flowEventHandlerService = flowEventHandlerService;
// Initialize the Flow-related map state
mapFlowListener = new MapFlowListener();
@@ -443,16 +443,16 @@
}
/**
- * De-register Path Computation Service for receiving Flow-related
+ * De-register Flow Event Handler Service for receiving Flow-related
* notifications.
*
- * NOTE: Only a single Path Computation Service can be registered.
+ * NOTE: Only a single Flow Event Handler Service can be registered.
*
- * @param pathComputationService the Path Computation Service to
+ * @param flowEventHandlerService the Flow Event Handler Service to
* de-register.
*/
@Override
- public void deregisterPathComputationService(IPathComputationService pathComputationService) {
+ public void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService) {
// Clear the Flow-related map state
mapFlow.removeEntryListener(mapFlowListenerId);
mapFlow = null;
@@ -468,7 +468,7 @@
mapTopology = null;
mapTopologyListener = null;
- this.pathComputationService = null;
+ this.flowEventHandlerService = null;
}
/**
diff --git a/src/main/java/net/onrc/onos/datagrid/IDatagridService.java b/src/main/java/net/onrc/onos/datagrid/IDatagridService.java
index 7735033..1bcf601 100644
--- a/src/main/java/net/onrc/onos/datagrid/IDatagridService.java
+++ b/src/main/java/net/onrc/onos/datagrid/IDatagridService.java
@@ -4,7 +4,7 @@
import net.floodlightcontroller.core.module.IFloodlightService;
-import net.onrc.onos.ofcontroller.flowmanager.IPathComputationService;
+import net.onrc.onos.ofcontroller.flowmanager.IFlowEventHandlerService;
import net.onrc.onos.ofcontroller.topology.TopologyElement;
import net.onrc.onos.ofcontroller.util.FlowEntry;
import net.onrc.onos.ofcontroller.util.FlowEntryId;
@@ -16,25 +16,25 @@
*/
public interface IDatagridService extends IFloodlightService {
/**
- * Register Path Computation Service for receiving Flow-related
+ * Register Flow Event Handler Service for receiving Flow-related
* notifications.
*
- * NOTE: Only a single Path Computation Service can be registered.
+ * NOTE: Only a single Flow Event Handler Service can be registered.
*
- * @param pathComputationService the Path Computation Service to register.
+ * @param flowEventHandlerService the Flow Event Handler Service to register.
*/
- void registerPathComputationService(IPathComputationService pathComputationService);
+ void registerFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
/**
- * De-register Path Computation Service for receiving Flow-related
+ * De-register Flow Event Handler Service for receiving Flow-related
* notifications.
*
- * NOTE: Only a single Path Computation Service can be registered.
+ * NOTE: Only a single Flow Event Handler Service can be registered.
*
- * @param pathComputationService the Path Computation Service to
+ * @param flowEventHandlerService the Flow Event Handler Service to
* de-register.
*/
- void deregisterPathComputationService(IPathComputationService pathComputationService);
+ void deregisterFlowEventHandlerService(IFlowEventHandlerService flowEventHandlerService);
/**
* Get all Flows that are currently in the datagrid.
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/PathComputation.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
similarity index 98%
rename from src/main/java/net/onrc/onos/ofcontroller/flowmanager/PathComputation.java
rename to src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
index b9806b5..08f57ed 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/PathComputation.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
@@ -33,9 +33,9 @@
/**
* Class for implementing the Path Computation and Path Maintenance.
*/
-class PathComputation extends Thread implements IPathComputationService {
+class FlowEventHandler extends Thread implements IFlowEventHandlerService {
/** The logger. */
- private final static Logger log = LoggerFactory.getLogger(PathComputation.class);
+ private final static Logger log = LoggerFactory.getLogger(FlowEventHandler.class);
private FlowManager flowManager; // The Flow Manager to use
private IDatagridService datagridService; // The Datagrid Service to use
@@ -60,8 +60,8 @@
* @param flowManager the Flow Manager to use.
* @param datagridService the Datagrid Service to use.
*/
- PathComputation(FlowManager flowManager,
- IDatagridService datagridService) {
+ FlowEventHandler(FlowManager flowManager,
+ IDatagridService datagridService) {
this.flowManager = flowManager;
this.datagridService = datagridService;
this.topology = new Topology();
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 ecbb49c..c14772d 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -48,7 +48,7 @@
protected volatile IDatagridService datagridService;
protected IRestApiService restApi;
protected FloodlightModuleContext context;
- protected PathComputation pathComputation;
+ protected FlowEventHandler flowEventHandler;
protected OFMessageDamper messageDamper;
@@ -385,7 +385,7 @@
*/
@Override
public void close() {
- datagridService.deregisterPathComputationService(pathComputation);
+ datagridService.deregisterFlowEventHandlerService(flowEventHandler);
dbHandler.close();
}
@@ -495,14 +495,14 @@
nextFlowEntryIdPrefix = randomGenerator.nextInt();
//
- // Create the Path Computation thread and register it with the
+ // Create the Flow Event Handler thread and register it with the
// Datagrid Service
//
- pathComputation = new PathComputation(this, datagridService);
- datagridService.registerPathComputationService(pathComputation);
+ flowEventHandler = new FlowEventHandler(this, datagridService);
+ datagridService.registerFlowEventHandlerService(flowEventHandler);
// Schedule the threads and periodic tasks
- pathComputation.start();
+ flowEventHandler.start();
mapReaderScheduler.scheduleAtFixedRate(
mapReader, 3, 3, TimeUnit.SECONDS);
shortestPathReconcileScheduler.scheduleAtFixedRate(
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IPathComputationService.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowEventHandlerService.java
similarity index 94%
rename from src/main/java/net/onrc/onos/ofcontroller/flowmanager/IPathComputationService.java
rename to src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowEventHandlerService.java
index 1966683..78562e1 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IPathComputationService.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/IFlowEventHandlerService.java
@@ -5,9 +5,9 @@
import net.onrc.onos.ofcontroller.util.FlowPath;
/**
- * Interface for providing Path Computation Service to other modules.
+ * Interface for providing Flow Event Handler Service to other modules.
*/
-public interface IPathComputationService {
+public interface IFlowEventHandlerService {
/**
* Receive a notification that a Flow is added.
*