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.util.Optional;
12 import javax.annotation.Nullable;
13 import org.opendaylight.controller.cluster.datastore.node.utils.stream.SerializationUtils;
14 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
17 * Legacy data tree snapshot used in versions prior to Boron, which contains only the data.
19 * @author Robert Varga
22 public final class PreBoronShardDataTreeSnapshot extends ShardDataTreeSnapshot {
23 private final NormalizedNode<?, ?> rootNode;
26 public PreBoronShardDataTreeSnapshot(final @Nullable NormalizedNode<?, ?> rootNode) {
27 this.rootNode = rootNode;
31 public Optional<NormalizedNode<?, ?>> getRootNode() {
32 return Optional.ofNullable(rootNode);
36 public byte[] serialize() {
37 return SerializationUtils.serializeNormalizedNode(rootNode);