import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.requests.segment.computation.P2p;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.requests.segment.computation.P2pBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.requests.segment.computation.p2p.ReportedRoute;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.pcreq.message.pcreq.message.requests.segment.computation.p2p.ReportedRouteBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.Rro;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.rp.object.Rp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.vendor.information.objects.VendorInformationObject;
import org.opendaylight.bgpcep.pcep.topology.provider.session.stats.TopologySessionStats;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.protocol.pcep.PCEPCloseTermination;
import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.PCEPTerminationReason;
this.triggeredResyncInProcess = true;
}
// All set, commit the modifications
- Futures.addCallback(ctx.trans.submit(), new FutureCallback<Void>() {
+ ctx.trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Pcc Internal state for session {} updated successfully",
AbstractTopologySessionListener.this.session);
}
if (onMessage(ctx, message)) {
LOG.warn("Unhandled message {} on session {}", message, psession);
//cancel not supported, submit empty transaction
- ctx.trans.submit();
+ ctx.trans.commit().addCallback(new FutureCallback<CommitInfo>() {
+ @Override
+ public void onSuccess(final CommitInfo result) {
+ LOG.trace("Successful commit");
+ }
+
+ @Override
+ public void onFailure(final Throwable trw) {
+ LOG.error("Failed commit", trw);
+ }
+ }, MoreExecutors.directExecutor());
return;
}
- Futures.addCallback(ctx.trans.submit(), new FutureCallback<Void>() {
+ ctx.trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Internal state for session {} updated successfully", psession);
ctx.notifyRequests();
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;
-import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.FluentFuture;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.protocol.pcep.PCEPCapability;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.topology.rev140113.NetworkTopologyContext;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.NetworkTopologyPcepProgrammingService;
this.channel = channelFuture.channel();
}
- public ListenableFuture<Void> closeServiceInstance() {
+ public FluentFuture<? extends CommitInfo> closeServiceInstance() {
//FIXME return also channelClose once ListenableFuture implements wildcard
this.channel.close().addListener((ChannelFutureListener) future ->
checkArgument(future.isSuccess(), "Channel failed to close: %s", future.cause()));
import static java.util.Objects.requireNonNull;
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import org.opendaylight.bgpcep.pcep.topology.spi.stats.TopologySessionStatsRegistry;
import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
import org.opendaylight.protocol.pcep.PCEPPeerProposal;
import org.opendaylight.protocol.pcep.PCEPSession;
return listener.tearDownSession(input);
}
- @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
- synchronized ListenableFuture<Void> closeServiceInstance() {
+ synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
if (this.isClosed.getAndSet(true)) {
LOG.error("Session Manager has already been closed.");
- return Futures.immediateFuture(null);
+ return CommitInfo.emptyFluentFuture();
}
for (final TopologySessionListener node : this.nodes.values()) {
node.close();
final WriteTransaction t = this.dependenciesProvider.getDataBroker().newWriteOnlyTransaction();
t.delete(LogicalDatastoreType.OPERATIONAL, this.topology);
- final ListenableFuture<Void> future = t.submit();
- Futures.addCallback(future, new FutureCallback<Void>() {
+ final FluentFuture<? extends CommitInfo> future = t.commit();
+ future.addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Topology {} removed", ServerSessionManager.this.topology);
}
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.Collection;
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.common.api.CommitInfo;
import org.opendaylight.protocol.pcep.PCEPSession;
import org.opendaylight.protocol.pcep.TerminationReason;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.Node1;
if (!persist) {
final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
trans.delete(LogicalDatastoreType.OPERATIONAL, this.nodeId);
- Futures.addCallback(trans.submit(), new FutureCallback<Void>() {
+ trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Internal state for node {} cleaned up successfully", TopologyNodeState.this.nodeId);
}
final WriteTransaction t = this.chain.newWriteOnlyTransaction();
LOG.trace("Put topology Node {}, value {}", this.nodeId, node);
t.merge(LogicalDatastoreType.OPERATIONAL, this.nodeId, node);
- Futures.addCallback(t.submit(), new FutureCallback<Void>() {
+ t.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Topology Node stored {}, value {}", TopologyNodeState.this.nodeId, node);
}
}, MoreExecutors.directExecutor());
}
- public synchronized void storeNode(final InstanceIdentifier<Node1> topologyAugment, final Node1 ta,
+ synchronized void storeNode(final InstanceIdentifier<Node1> topologyAugment, final Node1 ta,
final PCEPSession session) {
LOG.trace("Peer data {} set to {}", topologyAugment, ta);
final WriteTransaction trans = this.chain.newWriteOnlyTransaction();
trans.put(LogicalDatastoreType.OPERATIONAL, topologyAugment, ta);
// All set, commit the modifications
- Futures.addCallback(trans.submit(), new FutureCallback<Void>() {
+ trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Node stored {} for session {} updated successfully", topologyAugment, session);
}
import static java.util.Objects.requireNonNull;
import com.google.common.base.Preconditions;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import com.google.common.util.concurrent.FluentFuture;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.List;
import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
}
}
- @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
- synchronized ListenableFuture<Void> closeServiceInstance() {
+ synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
if (this.pcepTopoProviderCSS != null) {
return this.pcepTopoProviderCSS.closeServiceInstance();
}
- return Futures.immediateFuture(null);
+ return CommitInfo.emptyFluentFuture();
}
@Override
}
@Override
- @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
- public synchronized ListenableFuture<Void> closeServiceInstance() {
+ public synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
LOG.info("Close PCEP Topology Provider Singleton Service {}", getIdentifier().getValue());
if (this.serviceInstantiated) {
this.serviceInstantiated = false;
return this.pcepTopoProvider.closeServiceInstance();
}
- return Futures.immediateFuture(null);
+ return CommitInfo.emptyFluentFuture();
}
@Nonnull
import static java.util.concurrent.TimeUnit.SECONDS;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.HashMap;
import java.util.Map;
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.common.api.CommitInfo;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.PcepSessionState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.grouping.PcepSessionStateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.stats.rev171113.PcepTopologyNodeStatsAug;
entry.getKey().augmentation(PcepTopologyNodeStatsAug.class);
tx.put(LogicalDatastoreType.OPERATIONAL, statId, nodeStatsAug);
}
- Futures.addCallback(tx.submit(), new FutureCallback<Void>() {
+ tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(Void result) {
+ public void onSuccess(CommitInfo result) {
LOG.debug("Successfully committed Topology stats update");
}
final WriteTransaction wTx = this.transactionChain.newWriteOnlyTransaction();
wTx.delete(LogicalDatastoreType.OPERATIONAL, nodeId);
try {
- wTx.submit().get();
+ wTx.commit().get();
} catch (final InterruptedException | ExecutionException e) {
LOG.warn("Failed to remove Pcep Node stats {}.", nodeId.getKey().getNodeId());
}
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.JdkFutureAdapters;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.ArrayList;
import java.util.Collection;
import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.AdministrativeStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev171025.Path1;
// We now have list of all affected LSPs. Walk them create/remove them
updateTransaction(trans, lsps, original, updated, created);
- Futures.addCallback(JdkFutureAdapters.listenInPoolThread(trans.submit()), new FutureCallback<Void>() {
+ trans.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.trace("Topology change committed successfully");
}
import static java.util.Objects.requireNonNull;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import com.google.common.util.concurrent.FluentFuture;
import java.util.Dictionary;
import java.util.Hashtable;
import javax.annotation.Nonnull;
import org.opendaylight.bgpcep.topology.DefaultTopologyReference;
import org.opendaylight.controller.config.api.osgi.WaitingServiceTracker;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
}
@Override
- @SuppressFBWarnings(value = "NP_NONNULL_PARAM_VIOLATION", justification = "Unrecognised NullableDecl")
- public synchronized ListenableFuture<Void> closeServiceInstance() {
+ public synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
LOG.info("Close Service Instance PCEP Tunnel Topology Provider Singleton Service {}",
getIdentifier().getValue());
this.reg.close();
this.tp.close();
this.ttp.close();
- return Futures.immediateFuture(null);
+ return CommitInfo.emptyFluentFuture();
}
@Nonnull
import com.google.common.collect.Lists;
import java.util.Collections;
+import java.util.concurrent.ExecutionException;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.opendaylight.controller.md.sal.binding.test.AbstractConcurrentDataBrokerTest;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth;
private ListenerRegistration<NodeChangedListener> listenerRegistration;
@Before
- public void setUp() throws TransactionCommitFailedException {
+ public void setUp() throws InterruptedException, ExecutionException {
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID, new TopologyBuilder()
.setKey(new TopologyKey(PCEP_TOPOLOGY_ID)).setNode(Lists.newArrayList())
.setTopologyId(PCEP_TOPOLOGY_ID).build(), true);
wTx.put(LogicalDatastoreType.OPERATIONAL, TUNNEL_TOPO_IID, new TopologyBuilder()
.setKey(new TopologyKey(TUNNEL_TOPOLOGY_ID)).setTopologyId(TUNNEL_TOPOLOGY_ID).build(), true);
- wTx.submit().checkedGet();
+ wTx.commit().get();
final NodeChangedListener nodeListener = new NodeChangedListener(getDataBroker(),
PCEP_TOPOLOGY_ID, TUNNEL_TOPO_IID);
this.listenerRegistration = getDataBroker().registerDataTreeChangeListener(new DataTreeIdentifier<>(
}
@Test
- public void testNodeChangedListener() throws ReadFailedException, TransactionCommitFailedException {
+ public void testNodeChangedListener() throws ReadFailedException, InterruptedException, ExecutionException {
// add node -> create two nodes with TPs and link
createNode(NODE1_ID, NODE1_IPV4, LSP1_NAME, LSP1_ID, NODE2_IPV4);
final Topology tunnelTopo = readDataOperational(getDataBroker(), TUNNEL_TOPO_IID, tunnelTopo1 -> {
}
private void createNode(final NodeId nodeId, final String ipv4Address, final String lspName, final long lspId,
- final String dstIpv4Address) throws TransactionCommitFailedException {
+ final String dstIpv4Address) throws InterruptedException, ExecutionException {
final NodeBuilder nodeBuilder = new NodeBuilder();
nodeBuilder.setKey(new NodeKey(nodeId));
nodeBuilder.setNodeId(nodeId);
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder().child(Node.class,
new NodeKey(nodeId)).build(), nodeBuilder.build());
- wTx.submit().checkedGet();
+ wTx.commit().get();
}
- private void removeNode(final NodeId nodeId) throws TransactionCommitFailedException {
+ private void removeNode(final NodeId nodeId) throws InterruptedException, ExecutionException {
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.delete(LogicalDatastoreType.OPERATIONAL, PCEP_TOPO_IID.builder()
.child(Node.class, new NodeKey(nodeId)).build());
- wTx.submit().checkedGet();
+ wTx.commit().get();
}
}
}
@Test
- public void testTunnelProgramming() throws TransactionCommitFailedException {
+ public void testTunnelProgramming() throws InterruptedException, ExecutionException {
final Bandwidth bwd = new Bandwidth(new byte[]{0x00, 0x00, 0x00, (byte) 0xff});
final ClassType classType = new ClassType((short) 1);
final String tunnelName = "create-tunnel";
Assert.assertEquals(NODE1_ID.getValue(), this.removeLspInput.getNode().getValue());
}
- private void createInitialTopology() throws TransactionCommitFailedException {
+ private void createInitialTopology() throws InterruptedException, ExecutionException {
final TopologyBuilder topologyBuilder = new TopologyBuilder();
topologyBuilder.setKey(new TopologyKey(TOPOLOGY_ID));
topologyBuilder.setServerProvided(true);
createNode(NODE2_ID, TP2_ID, NODE2_IPV4)));
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID, topologyBuilder.build(), true);
- wTx.submit().checkedGet();
+ wTx.commit().get();
}
- private void createLink() throws TransactionCommitFailedException {
+ private void createLink() throws InterruptedException, ExecutionException {
final LinkBuilder linkBuilder = new LinkBuilder();
linkBuilder.setSource(new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology
.rev131021.link.attributes.SourceBuilder().setSourceNode(NODE1_ID).setSourceTp(TP1_ID).build());
final WriteTransaction wTx = getDataBroker().newWriteOnlyTransaction();
wTx.put(LogicalDatastoreType.OPERATIONAL, TOPO_IID.builder().child(Link.class, new LinkKey(LINK1_ID)).build(),
linkBuilder.build(), true);
- wTx.submit().checkedGet();
+ wTx.commit().get();
}
}
import static java.util.Objects.requireNonNull;
+import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
+import org.opendaylight.mdsal.common.api.CommitInfo;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonService;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming
.rev150720.instruction.queue.Instruction.class,
new InstructionKey(this.builder.getId())), this.builder.build());
- Futures.addCallback(wt.submit(), new FutureCallback<Void>() {
+ wt.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Instruction Queue {} updated", ProgrammingServiceImpl.this.qid);
}
org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.instruction
.queue.Instruction.class,
new InstructionKey(this.builder.getId())));
- Futures.addCallback(wt.submit(), new FutureCallback<Void>() {
+ wt.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Instruction Queue {} removed", ProgrammingServiceImpl.this.qid);
}
final WriteTransaction wt = this.dataProvider.newWriteOnlyTransaction();
wt.put(LogicalDatastoreType.OPERATIONAL, this.qid, new InstructionsQueueBuilder()
.setKey(new InstructionsQueueKey(this.instructionId)).setInstruction(Collections.emptyList()).build());
- Futures.addCallback(wt.submit(), new FutureCallback<Void>() {
+ wt.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Instruction Queue {} added", ProgrammingServiceImpl.this.qid);
}
}
@Override
- public synchronized ListenableFuture<Void> closeServiceInstance() {
+ public synchronized FluentFuture<? extends CommitInfo> closeServiceInstance() {
LOG.info("Closing Instruction Queue service {}", this.sgi.getValue());
if (this.reg != null) {
final WriteTransaction wt = this.dataProvider.newWriteOnlyTransaction();
wt.delete(LogicalDatastoreType.OPERATIONAL, this.qid);
- final ListenableFuture<Void> future = wt.submit();
- Futures.addCallback(future, new FutureCallback<Void>() {
+ final FluentFuture<? extends CommitInfo> future = wt.commit();
+ future.addCallback(new FutureCallback<CommitInfo>() {
@Override
- public void onSuccess(final Void result) {
+ public void onSuccess(final CommitInfo result) {
LOG.debug("Instruction Queue {} removed", ProgrammingServiceImpl.this.qid);
}