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 java.io.IOException;
12 import java.io.ObjectInput;
13 import java.io.ObjectOutput;
14 import org.opendaylight.controller.cluster.datastore.utils.SerializationUtils;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 public class ReadDataReply extends VersionedExternalizableMessage {
18 private static final long serialVersionUID = 1L;
20 private NormalizedNode<?, ?> normalizedNode;
22 public ReadDataReply() {
25 public ReadDataReply(NormalizedNode<?, ?> normalizedNode, short version) {
27 this.normalizedNode = normalizedNode;
30 public NormalizedNode<?, ?> getNormalizedNode() {
31 return normalizedNode;
35 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
36 super.readExternal(in);
37 normalizedNode = SerializationUtils.deserializeNormalizedNode(in);
41 public void writeExternal(ObjectOutput out) throws IOException {
42 super.writeExternal(out);
43 SerializationUtils.serializeNormalizedNode(normalizedNode, out);
47 protected Object newLegacySerializedInstance() {
48 // no legacy serialized type for this class; return self
52 public static ReadDataReply fromSerializable(Object serializable) {
53 return (ReadDataReply) serializable;
56 public static boolean isSerializedType(Object message) {
57 return message instanceof ReadDataReply;