2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore.messages;
11 import org.opendaylight.controller.protobuff.messages.transaction.ShardTransactionMessages;
13 public class CreateTransactionReply implements SerializableMessage {
15 public static final Class SERIALIZABLE_CLASS = ShardTransactionMessages.CreateTransactionReply.class;
16 private final String transactionPath;
17 private final String transactionId;
19 public CreateTransactionReply(String transactionPath,
20 String transactionId) {
21 this.transactionPath = transactionPath;
22 this.transactionId = transactionId;
25 public String getTransactionPath() {
26 return transactionPath;
29 public String getTransactionId() {
33 public Object toSerializable(){
34 return ShardTransactionMessages.CreateTransactionReply.newBuilder()
35 .setTransactionActorPath(transactionPath)
36 .setTransactionId(transactionId)
40 public static CreateTransactionReply fromSerializable(Object serializable){
41 ShardTransactionMessages.CreateTransactionReply o = (ShardTransactionMessages.CreateTransactionReply) serializable;
42 return new CreateTransactionReply(o.getTransactionActorPath(), o.getTransactionId());