Adjust to mdsal CursorAware API changes
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / provider / src / main / java / org / opendaylight / controller / clustering / it / provider / MdsalLowLevelTestProvider.java
index da6df6b85584f88faea634346f8eed3b18f35fff..4198441329ce5635c1a0b369215671c13c7c6d67 100644 (file)
@@ -5,7 +5,6 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.controller.clustering.it.provider;
 
 import static akka.actor.ActorRef.noSender;
@@ -59,12 +58,12 @@ import org.opendaylight.controller.md.sal.dom.api.DOMRpcImplementationRegistrati
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
-import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeLoopException;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeService;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.yang.gen.v1.tag.opendaylight.org._2017.controller.yang.lowlevel.control.rev170215.AddShardReplicaInput;
@@ -170,7 +169,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
     private final DOMDataBroker domDataBroker;
     private final NotificationPublishService notificationPublishService;
     private final NotificationService notificationService;
-    private final SchemaService schemaService;
+    private final DOMSchemaService schemaService;
     private final ClusterSingletonServiceProvider singletonService;
     private final DOMRpcProviderService domRpcService;
     private final PrefixLeaderHandler prefixLeaderHandler;
@@ -197,7 +196,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
     public MdsalLowLevelTestProvider(final RpcProviderRegistry rpcRegistry,
                                      final DOMRpcProviderService domRpcService,
                                      final ClusterSingletonServiceProvider singletonService,
-                                     final SchemaService schemaService,
+                                     final DOMSchemaService schemaService,
                                      final BindingNormalizedNodeSerializer bindingNormalizedNodeSerializer,
                                      final NotificationPublishService notificationPublishService,
                                      final NotificationService notificationService,
@@ -682,7 +681,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
 
         context.findLocalShardAsync(shardName).onComplete(new OnComplete<ActorRef>() {
             @Override
-            public void onComplete(final Throwable throwable, final ActorRef actorRef) throws Throwable {
+            public void onComplete(final Throwable throwable, final ActorRef actorRef) {
                 if (throwable != null) {
                     shutdownShardAsk.failure(throwable);
                 } else {
@@ -693,7 +692,7 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
 
         shutdownShardAsk.future().onComplete(new OnComplete<Boolean>() {
             @Override
-            public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) throws Throwable {
+            public void onComplete(final Throwable throwable, final Boolean gracefulStopResult) {
                 if (throwable != null) {
                     final RpcResult<T> failedResult = RpcResultBuilder.<T>failed()
                             .withError(ErrorType.APPLICATION, "Failed to gracefully shutdown shard", throwable).build();
@@ -794,13 +793,13 @@ public class MdsalLowLevelTestProvider implements OdlMdsalLowlevelControlService
 
         final ClientLocalHistory localHistory = distributedDataStoreClient.createLocalHistory();
         final ClientTransaction tx = localHistory.createTransaction();
-        final ListenableFuture<Optional<NormalizedNode<?, ?>>> read =
+        final ListenableFuture<java.util.Optional<NormalizedNode<?, ?>>> read =
                 tx.read(YangInstanceIdentifier.of(ProduceTransactionsHandler.ID_INT));
 
         tx.abort();
         localHistory.close();
         try {
-            final Optional<NormalizedNode<?, ?>> optional = read.get();
+            final java.util.Optional<NormalizedNode<?, ?>> optional = read.get();
             if (!optional.isPresent()) {
                 LOG.warn("Final read from client is empty.");
                 final RpcError error = RpcResultBuilder.newError(