package org.opendaylight.controller.cluster.datastore.messages;
import com.google.common.base.Preconditions;
-import org.opendaylight.controller.protobuff.messages.shard.ShardManagerMessages;
/**
* The FindPrimary message is used to locate the primary of any given shard
*
*/
public class FindPrimary implements SerializableMessage{
- public static final Class SERIALIZABLE_CLASS = ShardManagerMessages.FindPrimary.class;
+ public static final Class SERIALIZABLE_CLASS = FindPrimary.class;
private final String shardName;
public FindPrimary(String shardName){
@Override
public Object toSerializable() {
- return ShardManagerMessages.FindPrimary.newBuilder().setShardName(shardName).build();
+ return this;
}
public static FindPrimary fromSerializable(Object message){
- return new FindPrimary(((ShardManagerMessages.FindPrimary)message).getShardName());
+ return (FindPrimary) message;
}
}