-
- future = Futures.withFallback(future, new FutureFallback<Void>() {
-
- @Override
- public ListenableFuture<Void> create(final Throwable t) throws Exception {
- LOG.debug("Last ShuttingDown Transaction for node {} fail. Put empty FlowCapableNode", nodeId());
- final ReadOnlyTransaction readWriteTx = dataBroker.newReadOnlyTransaction();
- final CheckedFuture<Optional<FlowCapableNode>, ReadFailedException> readFlowNode = readWriteTx
- .read(LogicalDatastoreType.OPERATIONAL, nodeII.augmentation(FlowCapableNode.class));
- return Futures.transform(readFlowNode, new AsyncFunction<Optional<FlowCapableNode>, Void>() {
-
- @Override
- public ListenableFuture<Void> apply(final Optional<FlowCapableNode> input) {
- if (input.isPresent()) {
- final WriteTransaction delWtx = dataBroker.newWriteOnlyTransaction();
- nodeBuilder.addAugmentation(FlowCapableNode.class, new FlowCapableNodeBuilder().build());
- delWtx.put(LogicalDatastoreType.OPERATIONAL, nodeII, nodeBuilder.build());
- return delWtx.submit();
- }
- return Futures.immediateFuture(null);
- }
- });
- }
- });