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
8 package org.opendaylight.controller.cluster.datastore.messages;
10 import static com.google.common.base.Preconditions.checkArgument;
11 import static java.util.Objects.requireNonNull;
13 import java.io.IOException;
14 import java.io.ObjectInput;
15 import java.io.ObjectOutput;
16 import org.opendaylight.controller.cluster.access.concepts.LocalHistoryIdentifier;
17 import org.opendaylight.yangtools.concepts.Identifiable;
19 @Deprecated(since = "9.0.0", forRemoval = true)
20 public final class CloseTransactionChain extends VersionedExternalizableMessage
21 implements Identifiable<LocalHistoryIdentifier> {
23 private static final long serialVersionUID = 1L;
25 private LocalHistoryIdentifier transactionChainId;
27 public CloseTransactionChain() {
30 public CloseTransactionChain(final LocalHistoryIdentifier transactionChainId, final short version) {
32 this.transactionChainId = requireNonNull(transactionChainId);
36 public LocalHistoryIdentifier getIdentifier() {
37 return transactionChainId;
41 public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
42 super.readExternal(in);
43 transactionChainId = LocalHistoryIdentifier.readFrom(in);
47 public void writeExternal(final ObjectOutput out) throws IOException {
48 super.writeExternal(out);
49 transactionChainId.writeTo(out);
52 public static CloseTransactionChain fromSerializable(final Object serializable) {
53 checkArgument(serializable instanceof CloseTransactionChain);
54 return (CloseTransactionChain)serializable;
57 public static boolean isSerializedType(final Object message) {
58 return message instanceof CloseTransactionChain;