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.node.utils.stream;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 import java.io.IOException;
15 import java.io.ObjectInputStream;
16 import java.io.ObjectOutputStream;
17 import java.io.Serializable;
18 import java.net.URISyntaxException;
20 public class SampleNormalizedNodeSerializable implements Serializable {
22 private NormalizedNode<?, ?> input;
24 public SampleNormalizedNodeSerializable(NormalizedNode<?, ?> input) {
28 public NormalizedNode<?, ?> getInput() {
32 private void readObject(final ObjectInputStream stream) throws IOException, ClassNotFoundException, URISyntaxException {
33 NormalizedNodeStreamReader reader = new NormalizedNodeInputStreamReader(stream);
34 this.input = reader.readNormalizedNode();
37 private void writeObject(final ObjectOutputStream stream) throws IOException {
38 NormalizedNodeStreamWriter writer = new NormalizedNodeOutputStreamWriter(stream);
39 NormalizedNodeWriter normalizedNodeWriter = NormalizedNodeWriter.forStreamWriter(writer);
41 normalizedNodeWriter.write(this.input);