Do not use protobuf serialization for FindPrimary and it's responses
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / FindPrimary.java
index f2497e6517f376e4d7173efdbd4aeb21596d3990..f5a6a348415308377d755011b133796659d3f27d 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.base.Preconditions;
 /**
  * The FindPrimary message is used to locate the primary of any given shard
  *
- * TODO : Make this serializable
  */
-public class FindPrimary{
+public class FindPrimary implements SerializableMessage{
+  public static final Class SERIALIZABLE_CLASS = FindPrimary.class;
     private final String shardName;
 
     public FindPrimary(String shardName){
@@ -28,4 +28,13 @@ public class FindPrimary{
     public String getShardName() {
         return shardName;
     }
+
+  @Override
+  public Object toSerializable() {
+    return this;
+  }
+
+  public static FindPrimary fromSerializable(Object message){
+    return (FindPrimary) message;
+  }
 }