/*
* 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;
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;
}
}
@Override
- public DOMRpcResult checkedGet() throws DOMRpcException {
+ public DOMRpcResult checkedGet() {
try {
return get();
} catch (InterruptedException | ExecutionException e) {
}
@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) {