Teach sal-remoterpc-connector to route actions
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / messages / RpcResponse.java
index 6f1b44b..f141f09 100644 (file)
@@ -7,33 +7,23 @@
  */
 package org.opendaylight.controller.remote.rpc.messages;
 
  */
 package org.opendaylight.controller.remote.rpc.messages;
 
-import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.Externalizable;
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
-import java.io.Serializable;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-public class RpcResponse implements Serializable {
+public class RpcResponse extends AbstractResponse<NormalizedNode<?, ?>> {
     private static final long serialVersionUID = -4211279498688989245L;
 
     private static final long serialVersionUID = -4211279498688989245L;
 
-    @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but this class "
-            + "implements writeReplace to delegate serialization to a Proxy class and thus instances of this class "
-            + "aren't serialized. FindBugs does not recognize this.")
-    private final NormalizedNode<?, ?> resultNormalizedNode;
-
-    public RpcResponse(final @Nullable NormalizedNode<?, ?> inputNormalizedNode) {
-        resultNormalizedNode = inputNormalizedNode;
-    }
-
-    public @Nullable NormalizedNode<?, ?> getResultNormalizedNode() {
-        return resultNormalizedNode;
+    public RpcResponse(final @Nullable NormalizedNode<?, ?> output) {
+        super(output);
     }
 
     }
 
-    private Object writeReplace() {
+    @Override
+    Object writeReplace() {
         return new Proxy(this);
     }
 
         return new Proxy(this);
     }
 
@@ -54,7 +44,7 @@ public class RpcResponse implements Serializable {
 
         @Override
         public void writeExternal(final ObjectOutput out) throws IOException {
 
         @Override
         public void writeExternal(final ObjectOutput out) throws IOException {
-            SerializationUtils.writeNormalizedNode(out, rpcResponse.getResultNormalizedNode());
+            SerializationUtils.writeNormalizedNode(out, rpcResponse.getOutput());
         }
 
         @Override
         }
 
         @Override

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