Introduce ReadTransaction.exists()
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / RpcServiceAdapter.java
index daf502cdffa072bc8df99e6fbb4ac1a78649ae14..a9b1cc5cc49c08313e828b7c4f2758dd61710e25 100644 (file)
@@ -18,6 +18,7 @@ import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.util.Collection;
 import java.util.Map.Entry;
+import java.util.concurrent.Future;
 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.api.DOMRpcService;
@@ -70,8 +71,8 @@ class RpcServiceAdapter implements InvocationHandler {
         if (result instanceof BindingRpcFutureAware) {
             return ((BindingRpcFutureAware) result).getBindingFuture();
         } else if (result instanceof LegacyDOMRpcResultFutureAdapter) {
-            CheckedFuture<org.opendaylight.mdsal.dom.api.DOMRpcResult, org.opendaylight.mdsal.dom.api.DOMRpcException>
-                    delegateFuture = ((LegacyDOMRpcResultFutureAdapter)result).delegate();
+            Future<org.opendaylight.mdsal.dom.api.DOMRpcResult> delegateFuture =
+                    ((LegacyDOMRpcResultFutureAdapter)result).delegate();
             if (delegateFuture instanceof BindingRpcFutureAware) {
                 return ((BindingRpcFutureAware) delegateFuture).getBindingFuture();
             }
@@ -93,7 +94,7 @@ class RpcServiceAdapter implements InvocationHandler {
     }
 
     @Override
-    public Object invoke(final Object proxyObj, final Method method, final Object[] args) throws Throwable {
+    public Object invoke(final Object proxyObj, final Method method, final Object[] args) {
 
         final RpcInvocationStrategy rpc = rpcNames.get(method);
         if (rpc != null) {
@@ -153,7 +154,7 @@ class RpcServiceAdapter implements InvocationHandler {
 
             // DOMRpcResult does not have a notion of success, hence we have to reverse-engineer it by looking
             // at reported errors and checking whether they are just warnings.
-            final Collection<RpcError> errors = input.getErrors();
+            final Collection<? extends RpcError> errors = input.getErrors();
             return RpcResult.class.cast(RpcResultBuilder.status(errors.stream()
                 .noneMatch(error -> error.getSeverity() == ErrorSeverity.ERROR))
                 .withResult(bindingResult).withRpcErrors(errors).build());