X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FReadData.java;h=cb6347f3e54909330ea924956029f895f44f69e1;hb=c6618cb0df8fc41ccfcb7578b11f5ecfa0403f39;hp=2f56a9740b2d4872a116dbccc31ceeb33e6425f1;hpb=bef0749bb2517eaae6a501be501e16a7d3905045;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ReadData.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ReadData.java index 2f56a9740b..cb6347f3e5 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ReadData.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/ReadData.java @@ -8,9 +8,12 @@ package org.opendaylight.controller.cluster.datastore.messages; +import org.opendaylight.controller.cluster.datastore.utils.InstanceIdentifierUtils; +import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; public class ReadData { + public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.ReadData.class; private final InstanceIdentifier path; public ReadData(InstanceIdentifier path) { @@ -20,4 +23,15 @@ public class ReadData { public InstanceIdentifier getPath() { return path; } + + public Object toSerializable(){ + return ShardTransactionMessages.ReadData.newBuilder() + .setInstanceIdentifierPathArguments(path.toString()) + .build(); + } + + public static ReadData fromSerializable(Object serializable){ + ShardTransactionMessages.ReadData o = (ShardTransactionMessages.ReadData) serializable; + return new ReadData(InstanceIdentifierUtils.from(o.getInstanceIdentifierPathArguments())); + } }