import org.apache.commons.lang3.tuple.Pair;
import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
+import org.opendaylight.controller.protocol_plugin.openflow.IDiscoveryListener;
import org.opendaylight.controller.protocol_plugin.openflow.IInventoryShimExternalListener;
import org.opendaylight.controller.protocol_plugin.openflow.IOFStatisticsManager;
import org.opendaylight.controller.protocol_plugin.openflow.IRefreshInternalProvider;
import org.opendaylight.controller.sal.core.Property;
import org.opendaylight.controller.sal.core.State;
import org.opendaylight.controller.sal.core.UpdateType;
-import org.opendaylight.controller.sal.discovery.IDiscoveryService;
import org.opendaylight.controller.sal.topology.TopoEdgeUpdate;
import org.opendaylight.controller.sal.utils.GlobalConstants;
* OpenFlow core to various listeners. The notifications are filtered based on
* container configurations.
*/
-public class TopologyServiceShim implements IDiscoveryService,
+public class TopologyServiceShim implements IDiscoveryListener,
IContainerListener, CommandProvider, IRefreshInternalProvider,
IInventoryShimExternalListener {
protected static final Logger logger = LoggerFactory
teuMap.put(entry.container, teuList);
notifyListeners = true;
}
-
+
if (notifyListeners) {
for (String container : teuMap.keySet()) {
// notify the listener
/**
* Function called by the dependency manager when all the required
* dependencies are satisfied
- *
+ *
*/
void init() {
logger.trace("Init called");
* Function called by the dependency manager when at least one dependency
* become unsatisfied or when the component is shutting down because for
* example bundle is being stopped.
- *
+ *
*/
void destroy() {
logger.trace("DESTROY called!");
/**
* Function called by dependency manager after "init ()" is called and after
* the services provided by the class are registered in the service registry
- *
+ *
*/
void start() {
logger.trace("START called!");
* Function called by the dependency manager before the services exported by
* the component are unregistered, this will be followed by a "destroy ()"
* calls
- *
+ *
*/
void stop() {
logger.trace("STOP called!");
/**
* Update local cache and return true if it needs to notify upper layer
* Topology listeners.
- *
+ *
* @param container
* The network container
* @param edge
"notifyLocalEdgeMap: {} for Edge {} in container {}",
new Object[] { type.getName(), edge, container });
}
-
+
return rv;
}
private void notifyEdge(String container, Edge edge, UpdateType type,
Set<Property> props) {
boolean notifyListeners;
-
+
// Update local cache
notifyListeners = updateLocalEdgeMap(container, edge, type, props);
if (notifyListeners) {
notifyQ.add(new NotifyEntry(container, new TopoEdgeUpdate(edge, props,
type)));
- logger.debug("notifyEdge: {} Edge {} in container {}",
+ logger.debug("notifyEdge: {} Edge {} in container {}",
new Object[] { type.getName(), edge, container });
}
}
* pushes the updates to ALL the applications that have registered as
* listeners for this service. SAL has no way of knowing which application
* requested for the refresh.
- *
+ *
* As an example of this case, is stopping and starting the Topology
* Manager. When the topology Manager is stopped, and restarted, it will no
* longer have the latest topology. Hence, a request is sent here.
- *
+ *
* @param containerName
* @return void
*/
* Reading the current topology database, the method will replay all the
* edge updates for the ITopologyServiceShimListener instance in the given
* container, which will in turn publish them toward SAL.
- *
+ *
* @param containerName
*/
private void TopologyBulkUpdate(String containerName) {