Disconnect {Lithium,NeonSR2} implementations
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / LithiumNormalizedNodeOutputStreamWriter.java
1 /*
2  * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
9
10 import java.io.DataOutput;
11 import java.io.IOException;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.common.QNameModule;
14
15 /**
16  * NormalizedNodeOutputStreamWriter will be used by distributed datastore to send normalized node in
17  * a stream.
18  * A stream writer wrapper around this class will write node objects to stream in recursive manner.
19  * for example - If you have a ContainerNode which has a two LeafNode as children, then
20  * you will first call
21  * {@link #startContainerNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, int)},
22  * then will call
23  * {@link #leafNode(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier, Object)} twice
24  * and then, {@link #endNode()} to end container node.
25  *
26  * <p>Based on the each node, the node type is also written to the stream, that helps in reconstructing the object,
27  * while reading.
28  */
29 final class LithiumNormalizedNodeOutputStreamWriter extends AbstractLithiumDataOutput {
30     LithiumNormalizedNodeOutputStreamWriter(final DataOutput output) {
31         super(output);
32     }
33
34     @Override
35     protected short streamVersion() {
36         return TokenTypes.LITHIUM_VERSION;
37     }
38
39     @Override
40     public void writeQName(final QName qname) throws IOException {
41         defaultWriteQName(qname);
42     }
43
44     @Override
45     void writeModule(final QNameModule module) throws IOException {
46         defaultWriteModule(module);
47     }
48 }