2 * Copyright (c) 2015 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 java.io.Externalizable;
11 import java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
16 * Abstract base class for a versioned Externalizable message.
18 * @author Thomas Pantelis
20 public abstract class VersionedExternalizableMessage implements Externalizable, SerializableMessage {
21 private static final long serialVersionUID = 1L;
23 private short version;
25 public VersionedExternalizableMessage() {
28 public VersionedExternalizableMessage(short version) {
29 this.version = version;
32 public short getVersion() {
37 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
38 version = in.readShort();
42 public void writeExternal(ObjectOutput out) throws IOException {
43 out.writeShort(version);