Merge "BUG-704 Remove pax from netconf identity-ref test."
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / implementation / src / main / java / org / opendaylight / controller / sal / connector / remoterpc / dto / Message.java
index 95fe99c81c7da67e52b8274ffd37eddea8753aa2..21d02be7d7295b5514b4819310f74a744fcb0ae0 100644 (file)
@@ -8,15 +8,21 @@
 
 package org.opendaylight.controller.sal.connector.remoterpc.dto;
 
-import org.opendaylight.controller.sal.connector.api.RpcRouter;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
 
-import java.io.*;
+import org.opendaylight.controller.sal.connector.api.RpcRouter;
 
 public class Message implements Serializable {
+    private static final long serialVersionUID = 1L;
 
  public static enum MessageType {
-    ANNOUNCE((byte) 0),  //TODO: Remove announce, add rpc registration and deregistration
-    HEARTBEAT((byte) 1),
+    PING((byte) 0),
+    PONG((byte) 1),
     REQUEST((byte) 2),
     RESPONSE((byte) 3),
     ERROR((byte)4);
@@ -77,6 +83,7 @@ public class Message implements Serializable {
   public void setRecipient(String recipient) {
     this.recipient = recipient;
   }
+
   @Override
   public String toString() {
     return "Message{" +
@@ -117,12 +124,13 @@ public class Message implements Serializable {
   }
 
   public static class Response extends Message implements RpcRouter.RpcReply {
+    private static final long serialVersionUID = 1L;
     private ResponseCode code; // response code
 
     public static enum ResponseCode {
       SUCCESS(200), BADREQUEST(400), TIMEOUT(408), GONE(410), SERVERERROR(500), SERVICEUNAVAILABLE(503);
 
-      private int code;
+      private final int code;
 
       ResponseCode(int code) {
         this.code = code;
@@ -143,7 +151,7 @@ public class Message implements Serializable {
    */
   public static class MessageBuilder{
 
-    private Message message;
+    private final Message message;
 
     public MessageBuilder(){
       message = new Message();