package org.opendaylight.openflowplugin.learningswitch.multi;
-import org.opendaylight.openflowplugin.learningswitch.DataChangeListenerRegistrationHolder;
-import org.opendaylight.openflowplugin.learningswitch.InstanceIdentifierUtils;
+import org.opendaylight.openflowplugin.learningswitch.DataTreeChangeListenerRegistrationHolder;
import org.opendaylight.openflowplugin.learningswitch.FlowCommitWrapper;
+import org.opendaylight.openflowplugin.learningswitch.InstanceIdentifierUtils;
import org.opendaylight.openflowplugin.learningswitch.LearningSwitchHandler;
import org.opendaylight.openflowplugin.learningswitch.LearningSwitchHandlerSimpleImpl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-/**
- *
- */
public class MultipleLearningSwitchHandlerFacadeImpl implements LearningSwitchHandler {
-
- private static final Logger LOG = LoggerFactory
- .getLogger(MultipleLearningSwitchHandlerFacadeImpl.class);
-
+
+ private static final Logger LOG = LoggerFactory.getLogger(MultipleLearningSwitchHandlerFacadeImpl.class);
private FlowCommitWrapper dataStoreAccessor;
private PacketProcessingService packetProcessingService;
private PacketInDispatcherImpl packetInDispatcher;
@Override
public synchronized void onSwitchAppeared(InstanceIdentifier<Table> appearedTablePath) {
LOG.debug("expected table acquired, learning ..");
-
+
/**
* appearedTablePath is in form of /nodes/node/node-id/table/table-id
* so we shorten it to /nodes/node/node-id to get identifier of switch.
- *
*/
InstanceIdentifier<Node> nodePath = InstanceIdentifierUtils.getNodePath(appearedTablePath);
-
+
/**
* We check if we already initialized dispatcher for that node,
* if not we create new handler for switch.
- *
*/
if (!packetInDispatcher.getHandlerMapping().containsKey(nodePath)) {
- // delegate this node (owning appearedTable) to SimpleLearningSwitchHandler
+ // delegate this node (owning appearedTable) to SimpleLearningSwitchHandler
LearningSwitchHandlerSimpleImpl simpleLearningSwitch = new LearningSwitchHandlerSimpleImpl();
/**
* We set runtime dependencies
*/
simpleLearningSwitch.setDataStoreAccessor(dataStoreAccessor);
simpleLearningSwitch.setPacketProcessingService(packetProcessingService);
-
+
/**
* We propagate table event to newly instantiated instance of learning switch
*/
@Override
public void setRegistrationPublisher(
- DataChangeListenerRegistrationHolder registrationPublisher) {
+ DataTreeChangeListenerRegistrationHolder registrationPublisher) {
//NOOP
}
-
+
@Override
public void setDataStoreAccessor(FlowCommitWrapper dataStoreAccessor) {
this.dataStoreAccessor = dataStoreAccessor;
}
-
+
@Override
public void setPacketProcessingService(
PacketProcessingService packetProcessingService) {