package org.opendaylight.openflowplugin.applications.frsync.impl;
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.ListenableFuture;
import java.util.Collection;
-
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.ListenableFuture;
-
/**
* Listens to config changes and delegates add/remove/update/barrier to {@link SyncReactor}.
*/
public class SimplifiedConfigListener extends AbstractFrmSyncListener<FlowCapableNode> {
private static final Logger LOG = LoggerFactory.getLogger(SimplifiedConfigListener.class);
- protected final SyncReactor reactor;
+ private final SyncReactor reactor;
private final FlowCapableNodeSnapshotDao configSnaphot;
private final FlowCapableNodeDao operationalDao;
final Optional<FlowCapableNode> operationalNode = operationalDao.loadByNodeId(nodeId);
if (!operationalNode.isPresent()) {
LOG.info("Skip syncup, {} operational is not present", nodeId.getValue());
- return Optional.absent();// we try to reconfigure switch is alive
+ return Optional.absent();
}
final DataObjectModification<FlowCapableNode> configModification = modification.getRootNode();
FlowCapableNode dataBefore, FlowCapableNode dataAfter, FlowCapableNode operationalNode)
throws InterruptedException {
LOG.trace("onNodeAdded {}", nodePath);
-
- final ListenableFuture<Boolean> endResult =
- reactor.syncup(nodePath, dataAfter, operationalNode);
+ final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, dataAfter, operationalNode, dsType());
return endResult;
}
FlowCapableNode dataBefore, FlowCapableNode dataAfter, FlowCapableNode operationalNodeNode)
throws InterruptedException {
LOG.trace("onNodeUpdated {}", nodePath);
-
- final ListenableFuture<Boolean> endResult =
- reactor.syncup(nodePath, dataAfter, dataBefore);
+ final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, dataAfter, dataBefore, dsType());
return endResult;
}
protected ListenableFuture<Boolean> onNodeDeleted(InstanceIdentifier<FlowCapableNode> nodePath,
FlowCapableNode dataBefore, FlowCapableNode operationalNode) throws InterruptedException {
LOG.trace("onNodeDeleted {}", nodePath);
-
- final ListenableFuture<Boolean> endResult =
- reactor.syncup(nodePath, null, dataBefore);
+ final ListenableFuture<Boolean> endResult = reactor.syncup(nodePath, null, dataBefore, dsType());
return endResult;
}