Move createProxy()
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / LazyDOMRpcResultFuture.java
index fc493659b0df3d6085af627a8efc01283f963fc3..636f0b88b795d12afc9cf9d70650056eec388362 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
  *
- * This program and the accompanying materials are made available under the terms of the Eclipse
- * Public License v1.0 which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
+ * This program and the accompanying materials are made available under the
+ * 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.md.sal.binding.impl;
 
@@ -18,29 +18,32 @@ import java.util.concurrent.TimeoutException;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcException;
 import org.opendaylight.controller.md.sal.dom.api.DOMRpcResult;
 import org.opendaylight.controller.md.sal.dom.spi.DefaultDOMRpcResult;
-import org.opendaylight.yangtools.binding.data.codec.impl.BindingNormalizedNodeCodecRegistry;
+import org.opendaylight.mdsal.binding.dom.adapter.BindingRpcFutureAware;
+import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.yangtools.yang.binding.DataContainer;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-final class LazyDOMRpcResultFuture implements CheckedFuture<DOMRpcResult, DOMRpcException> {
+@Deprecated
+final class LazyDOMRpcResultFuture implements CheckedFuture<DOMRpcResult, DOMRpcException>, BindingRpcFutureAware {
 
     private final ListenableFuture<RpcResult<?>> bindingFuture;
-    private final BindingNormalizedNodeCodecRegistry codec;
+    private final BindingNormalizedNodeSerializer codec;
     private volatile DOMRpcResult result;
 
     private LazyDOMRpcResultFuture(final ListenableFuture<RpcResult<?>> delegate,
-            final BindingNormalizedNodeCodecRegistry codec) {
+            final BindingNormalizedNodeSerializer codec) {
         this.bindingFuture = Preconditions.checkNotNull(delegate, "delegate");
         this.codec = Preconditions.checkNotNull(codec, "codec");
     }
 
-    static CheckedFuture<DOMRpcResult, DOMRpcException> create(final BindingNormalizedNodeCodecRegistry codec,
+    static CheckedFuture<DOMRpcResult, DOMRpcException> create(final BindingNormalizedNodeSerializer codec,
             final ListenableFuture<RpcResult<?>> bindingResult) {
         return new LazyDOMRpcResultFuture(bindingResult, codec);
     }
 
-    ListenableFuture<RpcResult<?>> getBindingFuture() {
+    @Override
+    public ListenableFuture<RpcResult<?>> getBindingFuture() {
         return bindingFuture;
     }
 
@@ -72,7 +75,7 @@ final class LazyDOMRpcResultFuture implements CheckedFuture<DOMRpcResult, DOMRpc
     }
 
     @Override
-    public DOMRpcResult checkedGet() throws DOMRpcException {
+    public DOMRpcResult checkedGet() {
         try {
             return get();
         } catch (InterruptedException | ExecutionException e) {
@@ -82,7 +85,7 @@ final class LazyDOMRpcResultFuture implements CheckedFuture<DOMRpcResult, DOMRpc
     }
 
     @Override
-    public DOMRpcResult checkedGet(final long timeout, final TimeUnit unit) throws TimeoutException, DOMRpcException {
+    public DOMRpcResult checkedGet(final long timeout, final TimeUnit unit) throws TimeoutException {
         try {
             return get(timeout, unit);
         } catch (InterruptedException | ExecutionException e) {