import java.util.stream.Collectors;
import org.checkerframework.checker.lock.qual.GuardedBy;
import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.controller.md.sal.binding.api.BindingTransactionChain;
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.AsyncTransaction;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChain;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
+import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.binding.api.Transaction;
+import org.opendaylight.mdsal.binding.api.TransactionChain;
+import org.opendaylight.mdsal.binding.api.TransactionChainListener;
+import org.opendaylight.mdsal.binding.api.WriteTransaction;
import org.opendaylight.mdsal.common.api.CommitInfo;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
import org.opendaylight.protocol.bgp.openconfig.spi.BGPTableTypeRegistryConsumer;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPPeerState;
import org.opendaylight.protocol.bgp.rib.spi.state.BGPRibState;
@GuardedBy("this")
private final Map<String, InstanceIdentifier<Bgp>> instanceIdentifiersCache = new HashMap<>();
@GuardedBy("this")
- private BindingTransactionChain transactionChain;
+ private TransactionChain transactionChain;
@GuardedBy("this")
private ScheduledFuture<?> scheduleTask;
private final ScheduledExecutorService scheduler;
}
public synchronized void init() {
- this.transactionChain = this.dataBroker.createTransactionChain(this);
+ this.transactionChain = this.dataBroker.createMergingTransactionChain(this);
final TimerTask task = new TimerTask() {
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
wTx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(CommitInfo result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Successfully committed BGP stats update");
}
@Override
- public void onFailure(Throwable ex) {
+ public void onFailure(final Throwable ex) {
LOG.error("Failed to commit BGP stats update", ex);
}
}, MoreExecutors.directExecutor());
}
@Override
- public synchronized void onTransactionChainFailed(final TransactionChain<?, ?> chain,
- final AsyncTransaction<?, ?> transaction, final Throwable cause) {
+ public synchronized void onTransactionChainFailed(final TransactionChain chain, final Transaction transaction,
+ final Throwable cause) {
LOG.error("Transaction chain {} failed for tx {}",
chain, transaction != null ? transaction.getIdentifier() : null, cause);
if (!closed.get()) {
transactionChain.close();
- transactionChain = dataBroker.createTransactionChain(this);
+ transactionChain = dataBroker.createMergingTransactionChain(this);
}
}
@Override
- public void onTransactionChainSuccessful(final TransactionChain<?, ?> chain) {
+ public void onTransactionChainSuccessful(final TransactionChain chain) {
LOG.debug("Transaction chain {} successful.", chain);
}
}