Reduce use of deprecated methods
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / legacy / sharded / adapter / ShardedDOMDataBrokerDelegatingReadWriteTransaction.java
index 380f9d5..5ee9c43 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.controller.md.sal.dom.broker.impl.legacy.sharded.adapte
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
-import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -29,7 +28,6 @@ import javax.annotation.Nonnull;
 import javax.annotation.concurrent.NotThreadSafe;
 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.controller.md.sal.dom.api.DOMDataReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataReadWriteTransaction;
 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
@@ -108,11 +106,6 @@ class ShardedDOMDataBrokerDelegatingReadWriteTransaction implements DOMDataReadW
         writeTxDelegate.delete(store, path);
     }
 
-    @Override
-    public CheckedFuture<Void, TransactionCommitFailedException> submit() {
-        return writeTxDelegate.submit();
-    }
-
     @Override
     public FluentFuture<? extends CommitInfo> commit() {
         return writeTxDelegate.commit();
@@ -150,10 +143,8 @@ class ShardedDOMDataBrokerDelegatingReadWriteTransaction implements DOMDataReadW
                                                               final YangInstanceIdentifier path) {
         checkState(root != null,
                    "A modify operation (put, merge or delete) must be performed prior to an exists operation");
-        return Futures.makeChecked(Futures.transform(read(store, path),
-                                                     (Function<Optional<NormalizedNode<?, ?>>, Boolean>)
-                                                             Optional::isPresent),
-                                   ReadFailedException.MAPPER);
+        return Futures.makeChecked(Futures.transform(read(store, path), Optional::isPresent,
+            MoreExecutors.directExecutor()), ReadFailedException.MAPPER);
     }
 
     @Override

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.