Partially revert "Adjust for RPCService methods changing" 20/89320/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 23 Apr 2020 18:53:28 +0000 (20:53 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 23 Apr 2020 19:01:19 +0000 (21:01 +0200)
This reverts commit ba6824307ad4b3c272abefe9682d623adc3b42d2,
as it was overzealous with regards to ContainerNode conversion.
This reverts parts of it, so that we arrive at something sane.

JIRA: MDSAL-303
Change-Id: I9bd61b6dd1c88b53c39ac1b8791edaf38cad7885
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 files changed:
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/AbstractRemoteImplementation.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/RemoteRpcImplementation.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/AbstractExecute.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/AbstractResponse.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ActionResponse.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteAction.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/ExecuteRpc.java
opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/messages/RpcResponse.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/OpsBrokerTest.java
opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/RemoteOpsImplementationTest.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/GetConstantService.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/RoutedGetConstantService.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/SingletonGetConstantService.java

index 9a5df49..6a8030f 100644 (file)
@@ -18,7 +18,7 @@ import scala.concurrent.Future;
 /**
  * An abstract base class for remote RPC/action implementations.
  */
-abstract class AbstractRemoteImplementation<T extends AbstractExecute> {
+abstract class AbstractRemoteImplementation<T extends AbstractExecute<?>> {
     // 0 for local, 1 for binding, 2 for remote
     static final long COST = 2;
 
index 3046f7e..a737049 100644 (file)
@@ -13,7 +13,7 @@ import org.opendaylight.controller.remote.rpc.messages.ExecuteRpc;
 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * A {@link DOMRpcImplementation} which routes invocation requests to a remote invoker actor.
@@ -26,7 +26,8 @@ final class RemoteRpcImplementation extends AbstractRemoteImplementation<Execute
     }
 
     @Override
-    public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) {
+    public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc,
+            final NormalizedNode<?, ?> input) {
         return new RemoteDOMRpcFuture(rpc.getType(), ask(ExecuteRpc.from(rpc, input)));
     }
 
index 9e50d03..a23bcb3 100644 (file)
@@ -13,28 +13,28 @@ import com.google.common.base.MoreObjects;
 import com.google.common.base.MoreObjects.ToStringHelper;
 import java.io.Serializable;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 /**
  * An abstract base class for invocation requests. Specialized via {@link ExecuteAction} and {@link ExecuteRpc}.
  */
-public abstract class AbstractExecute implements Serializable {
+public abstract class AbstractExecute<T extends NormalizedNode<?, ?>> implements Serializable {
     private static final long serialVersionUID = 1L;
 
     private final transient @NonNull SchemaPath type;
-    private final transient @NonNull ContainerNode input;
+    private final transient T input;
 
-    AbstractExecute(final @NonNull SchemaPath type, final ContainerNode input) {
+    AbstractExecute(final @NonNull SchemaPath type, final T input) {
         this.type = requireNonNull(type);
-        this.input = requireNonNull(input);
+        this.input = input;
     }
 
     public final @NonNull SchemaPath getType() {
         return type;
     }
 
-    public final @NonNull ContainerNode getInput() {
+    public final T getInput() {
         return input;
     }
 
index 6651853..1789753 100644 (file)
@@ -9,21 +9,21 @@ package org.opendaylight.controller.remote.rpc.messages;
 
 import java.io.Serializable;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * An abstract base class for invocation responses. Specialized via {@link ActionResponse} and {@link RpcResponse}.
  */
-public abstract class AbstractResponse implements Serializable {
+public abstract class AbstractResponse<T extends NormalizedNode<?, ?>> implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    private final transient @Nullable ContainerNode output;
+    private final transient @Nullable T output;
 
-    public AbstractResponse(final @Nullable ContainerNode output) {
+    public AbstractResponse(final @Nullable T output) {
         this.output = output;
     }
 
-    public final @Nullable ContainerNode getOutput() {
+    public final @Nullable T getOutput() {
         return output;
     }
 
index a1f2a7a..d6a2358 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 @SuppressFBWarnings({"SE_TRANSIENT_FIELD_NOT_RESTORED", "DMI_NONSERIALIZABLE_OBJECT_WRITTEN"})
-public class ActionResponse extends AbstractResponse {
+public class ActionResponse extends AbstractResponse<ContainerNode> {
     private static final long serialVersionUID = 1L;
 
     private final transient @NonNull ImmutableList<@NonNull RpcError> errors;
index 977734b..4fb9c61 100644 (file)
@@ -18,16 +18,14 @@ import java.io.ObjectOutput;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
-import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
-public final class ExecuteAction extends AbstractExecute {
+public final class ExecuteAction extends AbstractExecute<@NonNull ContainerNode> {
     private static final long serialVersionUID = 1128904894827335676L;
 
     private final @NonNull DOMDataTreeIdentifier path;
@@ -89,11 +87,7 @@ public final class ExecuteAction extends AbstractExecute {
             final SchemaPath name = stream.readSchemaPath();
             final LogicalDatastoreType type = LogicalDatastoreType.readFrom(in);
             final YangInstanceIdentifier path = stream.readYangInstanceIdentifier();
-            ContainerNode input = (ContainerNode) stream.readOptionalNormalizedNode().orElse(null);
-            if (input == null) {
-                input = ImmutableNodes.containerNode(
-                    YangConstants.operationInputQName(name.getLastComponent().getModule()));
-            }
+            final ContainerNode input = (ContainerNode) stream.readOptionalNormalizedNode().orElse(null);
 
             executeAction = new ExecuteAction(name, new DOMDataTreeIdentifier(type, path), input);
         }
index 3f0cc35..135111f 100644 (file)
@@ -14,23 +14,23 @@ import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.yangtools.yang.common.YangConstants;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataOutput;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeStreamVersion;
-import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
-public final class ExecuteRpc extends AbstractExecute {
+public final class ExecuteRpc extends AbstractExecute<@Nullable NormalizedNode<?, ?>> {
     private static final long serialVersionUID = 1128904894827335676L;
 
-    private ExecuteRpc(final @NonNull SchemaPath type, final @NonNull ContainerNode input) {
+    private ExecuteRpc(final @NonNull SchemaPath type, final @Nullable NormalizedNode<?, ?> input) {
         super(type, input);
     }
 
-    public static @NonNull ExecuteRpc from(final @NonNull DOMRpcIdentifier rpc, final @NonNull ContainerNode input) {
+    public static @NonNull ExecuteRpc from(final @NonNull DOMRpcIdentifier rpc,
+            final @Nullable NormalizedNode<?, ?> input) {
         return new ExecuteRpc(rpc.getType(), input);
     }
 
@@ -67,11 +67,7 @@ public final class ExecuteRpc extends AbstractExecute {
         public void readExternal(final ObjectInput in) throws IOException {
             final NormalizedNodeDataInput stream = NormalizedNodeDataInput.newDataInput(in);
             final SchemaPath type = SchemaPath.ROOT.createChild(stream.readQName());
-            ContainerNode input = (ContainerNode) stream.readOptionalNormalizedNode().orElse(null);
-            if (input == null) {
-                input = ImmutableNodes.containerNode(
-                    YangConstants.operationInputQName(type.getLastComponent().getModule()));
-            }
+            final NormalizedNode<?, ?> input = stream.readOptionalNormalizedNode().orElse(null);
             executeRpc = new ExecuteRpc(type, input);
         }
 
index a2f4f1f..f141f09 100644 (file)
@@ -13,12 +13,12 @@ import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-public class RpcResponse extends AbstractResponse {
+public class RpcResponse extends AbstractResponse<NormalizedNode<?, ?>> {
     private static final long serialVersionUID = -4211279498688989245L;
 
-    public RpcResponse(final @Nullable ContainerNode output) {
+    public RpcResponse(final @Nullable NormalizedNode<?, ?> output) {
         super(output);
     }
 
@@ -49,7 +49,7 @@ public class RpcResponse extends AbstractResponse {
 
         @Override
         public void readExternal(final ObjectInput in) throws IOException {
-            rpcResponse = new RpcResponse((ContainerNode) SerializationUtils.readNormalizedNode(in).orElse(null));
+            rpcResponse = new RpcResponse(SerializationUtils.readNormalizedNode(in).orElse(null));
         }
 
         private Object readResolve() {
index b8b5b7c..d99c5bb 100644 (file)
@@ -12,7 +12,7 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
 
 import akka.actor.Status.Failure;
 import java.time.Duration;
@@ -27,12 +27,14 @@ import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
 
 public class OpsBrokerTest extends AbstractOpsTest {
+
     @Test
     public void testExecuteRpc() {
-        final DOMRpcResult rpcResult = new DefaultDOMRpcResult(makeRPCOutput("bar"));
+        final ContainerNode invokeRpcResult = makeRPCOutput("bar");
+        final DOMRpcResult rpcResult = new DefaultDOMRpcResult(invokeRpcResult);
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService1)
             .invokeRpc(eq(TEST_RPC_TYPE), any());
-        final ExecuteRpc executeRpc = ExecuteRpc.from(TEST_RPC_ID, mock(ContainerNode.class));
+        final ExecuteRpc executeRpc = ExecuteRpc.from(TEST_RPC_ID, null);
 
         rpcInvoker1.tell(executeRpc, rpcRegistry1Probe.getRef());
 
@@ -43,10 +45,10 @@ public class OpsBrokerTest extends AbstractOpsTest {
 
     @Test
     public void testExecuteRpcFailureWithException() {
-        doReturn(FluentFutures.immediateFailedFluentFuture(new DOMRpcImplementationNotAvailableException("NOT FOUND")))
-            .when(domRpcService1).invokeRpc(eq(TEST_RPC_TYPE), any());
+        when(domRpcService1.invokeRpc(eq(TEST_RPC_TYPE), any())).thenReturn(FluentFutures.immediateFailedFluentFuture(
+            new DOMRpcImplementationNotAvailableException("NOT FOUND")));
 
-        final ExecuteRpc executeMsg = ExecuteRpc.from(TEST_RPC_ID, mock(ContainerNode.class));
+        final ExecuteRpc executeMsg = ExecuteRpc.from(TEST_RPC_ID, null);
 
         rpcInvoker1.tell(executeMsg, rpcRegistry1Probe.getRef());
 
index f2aeb2b..47ce52b 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.remote.rpc;
 
 import static org.junit.Assert.assertEquals;
@@ -33,6 +32,7 @@ import org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult;
 import org.opendaylight.mdsal.dom.spi.SimpleDOMActionResult;
 import org.opendaylight.yangtools.util.concurrent.FluentFutures;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 /**
@@ -50,8 +50,10 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final ContainerNode rpcOutput = makeRPCOutput("bar");
         final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
 
-        final ContainerNode invokeRpcInput = makeRPCInput("foo");
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+                ArgumentCaptor.forClass(NormalizedNode.class);
 
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
             .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
@@ -70,18 +72,42 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     public void testInvokeAction() throws Exception {
         final ContainerNode actionOutput = makeRPCOutput("bar");
         final DOMActionResult actionResult = new SimpleDOMActionResult(actionOutput, Collections.emptyList());
-        final ContainerNode invokeActionInput = makeRPCInput("foo");
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        final NormalizedNode<?, ?> invokeActionInput = makeRPCInput("foo");
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<ContainerNode> inputCaptor =
+                ArgumentCaptor.forClass(ContainerNode.class);
         doReturn(FluentFutures.immediateFluentFuture(actionResult)).when(domActionService2).invokeAction(
                 eq(TEST_RPC_TYPE), eq(TEST_DATA_TREE_ID), inputCaptor.capture());
         final ListenableFuture<DOMActionResult> frontEndFuture = remoteActionImpl1.invokeAction(TEST_RPC_TYPE,
-                TEST_DATA_TREE_ID, invokeActionInput);
+                TEST_DATA_TREE_ID, (ContainerNode) invokeActionInput);
         assertTrue(frontEndFuture instanceof RemoteDOMActionFuture);
         final DOMActionResult result = frontEndFuture.get(5, TimeUnit.SECONDS);
         assertEquals(actionOutput, result.getOutput().get());
 
     }
 
+    /**
+     * This test method invokes and executes the remote rpc.
+     */
+    @Test
+    public void testInvokeRpcWithNullInput() throws Exception {
+        final ContainerNode rpcOutput = makeRPCOutput("bar");
+        final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
+
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+                (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
+
+        doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
+            .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
+
+        ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, null);
+        assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
+
+        final DOMRpcResult result = frontEndFuture.get(5, TimeUnit.SECONDS);
+        assertEquals(rpcOutput, result.getResult());
+    }
+
     /**
      * This test method invokes and executes the remote action.
      */
@@ -90,7 +116,9 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final ContainerNode actionOutput = makeRPCOutput("bar");
         final DOMActionResult actionResult = new SimpleDOMActionResult(actionOutput);
 
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        @SuppressWarnings({"unchecked", "rawtypes"})
+            final ArgumentCaptor<ContainerNode> inputCaptor =
+                  ArgumentCaptor.forClass(ContainerNode.class);
         doReturn(FluentFutures.immediateFluentFuture(actionResult)).when(domActionService2).invokeAction(
                 eq(TEST_RPC_TYPE), eq(TEST_DATA_TREE_ID), inputCaptor.capture());
 
@@ -110,8 +138,10 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
         final ContainerNode rpcOutput = null;
         final DOMRpcResult rpcResult = new DefaultDOMRpcResult(rpcOutput);
 
-        final ContainerNode invokeRpcInput = makeRPCInput("foo");
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+                (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
 
         doReturn(FluentFutures.immediateFluentFuture(rpcResult)).when(domRpcService2)
             .invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture());
@@ -129,8 +159,10 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @SuppressWarnings({"checkstyle:AvoidHidingCauseException", "checkstyle:IllegalThrows"})
     @Test(expected = DOMRpcException.class)
     public void testInvokeRpcWithRemoteFailedFuture() throws Throwable {
-        final ContainerNode invokeRpcInput = makeRPCInput("foo");
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<NormalizedNode<?, ?>> inputCaptor =
+                (ArgumentCaptor) ArgumentCaptor.forClass(NormalizedNode.class);
 
         when(domRpcService2.invokeRpc(eq(TEST_RPC_TYPE), inputCaptor.capture())).thenReturn(
                 FluentFutures.immediateFailedFluentFuture(new RemoteDOMRpcException("Test Exception", null)));
@@ -152,7 +184,9 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @Test(expected = DOMActionException.class)
     public void testInvokeActionWithRemoteFailedFuture() throws Throwable {
         final ContainerNode invokeActionInput = makeRPCInput("foo");
-        final ArgumentCaptor<ContainerNode> inputCaptor = ArgumentCaptor.forClass(ContainerNode.class);
+        @SuppressWarnings({"unchecked", "rawtypes"})
+        final ArgumentCaptor<ContainerNode> inputCaptor =
+                ArgumentCaptor.forClass(ContainerNode.class);
 
         when(domActionService2.invokeAction(eq(TEST_RPC_TYPE), eq(TEST_DATA_TREE_ID),
                 inputCaptor.capture())).thenReturn(FluentFutures.immediateFailedFluentFuture(
@@ -176,7 +210,7 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @Ignore
     @Test(expected = RemoteDOMRpcException.class)
     public void testInvokeRpcWithAkkaTimeoutException() throws Exception {
-        final ContainerNode invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
 
@@ -190,10 +224,10 @@ public class RemoteOpsImplementationTest extends AbstractOpsTest {
     @Test(expected = DOMRpcException.class)
     @SuppressWarnings({"checkstyle:AvoidHidingCauseException", "checkstyle:IllegalThrows"})
     public void testInvokeRpcWithLookupException() throws Throwable {
-        final ContainerNode invokeRpcInput = makeRPCInput("foo");
+        final NormalizedNode<?, ?> invokeRpcInput = makeRPCInput("foo");
 
         doThrow(new RuntimeException("test")).when(domRpcService2).invokeRpc(any(SchemaPath.class),
-            any(ContainerNode.class));
+            any(NormalizedNode.class));
 
         final ListenableFuture<DOMRpcResult> frontEndFuture = remoteRpcImpl1.invokeRpc(TEST_RPC_ID, invokeRpcInput);
         assertTrue(frontEndFuture instanceof RemoteDOMRpcFuture);
index 94a685f..a800dc9 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -52,8 +52,7 @@ public final class GetConstantService implements DOMRpcImplementation {
     }
 
     @Override
-    public ListenableFuture<? extends DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc,
-            final ContainerNode input) {
+    public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode<?, ?> input) {
         LOG.debug("get-constant invoked, current value: {}", constant);
 
         return Futures.immediateFuture(new DefaultDOMRpcResult(ImmutableContainerNodeBuilder.create()
index 37d2972..64470b0 100644 (file)
@@ -24,7 +24,7 @@ import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -59,7 +59,7 @@ public final class RoutedGetConstantService implements DOMRpcImplementation {
     }
 
     @Override
-    public ListenableFuture<? extends DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) {
+    public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode<?, ?> input) {
         LOG.debug("get-contexted-constant invoked, current value: {}", constant);
 
         return Futures.immediateFuture(new DefaultDOMRpcResult(ImmutableContainerNodeBuilder.create()
index d69403a..ffa3b80 100644 (file)
@@ -25,7 +25,7 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.common.YangConstants;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableLeafNodeBuilder;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -65,7 +65,7 @@ public final class SingletonGetConstantService implements DOMRpcImplementation,
     }
 
     @Override
-    public ListenableFuture<? extends DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final ContainerNode input) {
+    public ListenableFuture<DOMRpcResult> invokeRpc(final DOMRpcIdentifier rpc, final NormalizedNode<?, ?> input) {
         LOG.debug("get-singleton-constant invoked, current value: {}", constant);
 
         return Futures.immediateFuture(new DefaultDOMRpcResult(ImmutableContainerNodeBuilder.create()

©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.