Added an interface for the TopologyPublisher to publish operations to
the Topology Replication Writer
ONOS-1906
* Added new interface ITopologyReplicationWriter that should be implemented
by the (forthcoming) Topology Replication Writer. After this
writer is implemented, it should be created inside class
TopologyModule (similar to class TopologyManager), and
method TopologyModule.publish() should be modified to make the appropriate
call.
* Added new interface ITopologyPublisherService that exposes the
TopologyPublisher to other modules.
Currently, it includes only method publish() that can be used to
pre-populate the topology (e.g., by topology operations from a
configuration file).
* Updated class TopologyBatchOperation:
- The object type is TopologyEvent
- Renamed methods addAddTopologyOperation and addRemoveTopologyOperation
to appendAddOperation() and appendRemoveOperation() respectively
* Updated the TopologyPublisher internals to generalize the publishing
operation inside method TopologyPublisher.publishTopologyOperations()
NOTE: Inside that method that is a temporary flag "isGlobalLogWriter"
(set to false by default) that can be used to start experimenting with
the forthcoming Global Log-based mechanism (when the rest of the components
are ready).
NOTE: As a short-term solution, added class DelayedOperationsHandler
as a hack to deal with Link Events that need to be delayed
(in case of GlobalLog mechanism).
Change-Id: I72bd3c4bea46020be283e3bd518ba3bf900d6f0a
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java b/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java
index f05e9d0..f7d7049 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyBatchOperation.java
@@ -7,7 +7,7 @@
* A list of topology operations.
*/
public class TopologyBatchOperation extends
- BatchOperation<BatchOperationEntry<TopologyBatchOperation.Operator, TopologyBatchTarget>> {
+ BatchOperation<BatchOperationEntry<TopologyBatchOperation.Operator, TopologyEvent>> {
/**
* The topology operations' operators.
@@ -25,28 +25,28 @@
}
/**
- * Adds an add-TopologyEvent operation.
+ * Appends an ADD-TopologyEvent operation.
*
- * @param topologyEvent the Topology Event to be added
+ * @param topologyEvent the Topology Event to be appended
* @return the TopologyBatchOperation object
*/
- public TopologyBatchOperation addAddTopologyOperation(
+ public TopologyBatchOperation appendAddOperation(
TopologyEvent topologyEvent) {
return (TopologyBatchOperation) addOperation(
- new BatchOperationEntry<Operator, TopologyBatchTarget>(
+ new BatchOperationEntry<Operator, TopologyEvent>(
Operator.ADD, topologyEvent));
}
/**
- * Adds a remove-TopologyEvent operation.
+ * Appends a REMOVE-TopologyEvent operation.
*
- * @param topologyEvent the Topology Event to be removed
+ * @param topologyEvent the Topology Event to be appended
* @return the TopologyBatchOperation object
*/
- public TopologyBatchOperation addRemoveTopologyOperation(
+ public TopologyBatchOperation appendRemoveOperation(
TopologyEvent topologyEvent) {
return (TopologyBatchOperation) addOperation(
- new BatchOperationEntry<Operator, TopologyBatchTarget>(
+ new BatchOperationEntry<Operator, TopologyEvent>(
Operator.REMOVE, topologyEvent));
}
}