2 * Copyright (c) 2016 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.persisted;
10 import com.google.common.annotations.Beta;
11 import java.io.IOException;
12 import java.io.ObjectOutput;
13 import java.util.Optional;
14 import javax.annotation.Nullable;
15 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 * Legacy data tree snapshot used in versions prior to Boron, which contains only the data.
21 * @author Robert Varga
24 public final class PreBoronShardDataTreeSnapshot extends ShardDataTreeSnapshot {
25 private final NormalizedNode<?, ?> rootNode;
28 public PreBoronShardDataTreeSnapshot(final @Nullable NormalizedNode<?, ?> rootNode) {
29 this.rootNode = rootNode;
33 public Optional<NormalizedNode<?, ?>> getRootNode() {
34 return Optional.ofNullable(rootNode);
38 public void serialize(ObjectOutput out) throws IOException {
39 SerializationUtils.serializeNormalizedNode(rootNode, out);