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 com.google.common.base.Preconditions;
12 import java.io.IOException;
13 import java.io.ObjectInput;
14 import java.io.ObjectOutput;
16 public class CloseTransactionChain extends VersionedExternalizableMessage {
17 private static final long serialVersionUID = 1L;
19 private String transactionChainId;
21 public CloseTransactionChain() {
24 public CloseTransactionChain(final String transactionChainId, final short version) {
26 this.transactionChainId = transactionChainId;
29 public String getTransactionChainId() {
30 return transactionChainId;
34 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
35 super.readExternal(in);
36 transactionChainId = in.readUTF();
40 public void writeExternal(ObjectOutput out) throws IOException {
41 super.writeExternal(out);
42 out.writeUTF(transactionChainId);
45 public static CloseTransactionChain fromSerializable(final Object serializable){
46 Preconditions.checkArgument(serializable instanceof CloseTransactionChain);
47 return (CloseTransactionChain)serializable;
50 public static boolean isSerializedType(Object message) {
51 return message instanceof CloseTransactionChain;