2 * Copyright (c) 2016 Brocade Communications 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
8 package org.opendaylight.controller.cluster.datastore.messages;
10 import static java.util.Objects.requireNonNull;
12 import java.io.IOException;
13 import java.io.ObjectInput;
14 import java.io.ObjectOutput;
15 import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier;
18 * Base class for a 3PC message.
20 * @author Thomas Pantelis
22 @Deprecated(since = "9.0.0", forRemoval = true)
23 public abstract class AbstractThreePhaseCommitMessage extends VersionedExternalizableMessage {
24 private static final long serialVersionUID = 1L;
26 private TransactionIdentifier transactionId;
28 protected AbstractThreePhaseCommitMessage() {
31 protected AbstractThreePhaseCommitMessage(final TransactionIdentifier transactionId, final short version) {
33 this.transactionId = requireNonNull(transactionId);
36 public TransactionIdentifier getTransactionId() {
41 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
42 super.readExternal(in);
43 transactionId = TransactionIdentifier.readFrom(in);
47 public void writeExternal(final ObjectOutput out) throws IOException {
48 super.writeExternal(out);
49 transactionId.writeTo(out);
53 public String toString() {
54 return getClass().getSimpleName() + " [transactionId=" + transactionId + ", version=" + getVersion() + "]";