X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FCreateTransactionReply.java;h=43ce2ec19b40b2f489cfc5f7f9b9046dfc78165e;hp=4faf9d370d56a4dc4bb3edf97de469fb33f95362;hb=24c074a4b32ac97980a652b78824b7c2f97ffb78;hpb=ebfbda49205e6ccb0eb559517decaf7a9c3398a7 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java index 4faf9d370d..43ce2ec19b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java @@ -8,16 +8,62 @@ package org.opendaylight.controller.cluster.datastore.messages; -import akka.actor.ActorPath; +import com.google.common.base.Preconditions; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; -public class CreateTransactionReply { - private final ActorPath transactionPath; +public class CreateTransactionReply extends VersionedExternalizableMessage { + private static final long serialVersionUID = 1L; - public CreateTransactionReply(ActorPath transactionPath) { - this.transactionPath = transactionPath; - } + private String transactionPath; + private String transactionId; - public ActorPath getTransactionPath() { - return transactionPath; - } + public CreateTransactionReply() { + } + + public CreateTransactionReply(final String transactionPath, final String transactionId, final short version) { + super(version); + this.transactionPath = transactionPath; + this.transactionId = transactionId; + } + + public String getTransactionPath() { + return transactionPath; + } + + public String getTransactionId() { + return transactionId; + } + + @Override + public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { + super.readExternal(in); + transactionId = in.readUTF(); + transactionPath = in.readUTF(); + } + + @Override + public void writeExternal(ObjectOutput out) throws IOException { + super.writeExternal(out); + out.writeUTF(transactionId); + out.writeUTF(transactionPath); + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + builder.append("CreateTransactionReply [transactionPath=").append(transactionPath).append(", transactionId=") + .append(transactionId).append(", version=").append(getVersion()).append("]"); + return builder.toString(); + } + + public static CreateTransactionReply fromSerializable(Object serializable) { + Preconditions.checkNotNull(serializable instanceof CreateTransactionReply); + return (CreateTransactionReply)serializable; + } + + public static boolean isSerializedType(Object message) { + return message instanceof CreateTransactionReply; + } }