2 * Copyright (c) 2015 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 java.util.Collection;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
13 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidateNode;
14 import org.opendaylight.yangtools.yang.data.tree.api.ModificationType;
17 * A deserialized {@link DataTreeCandidateNode} which represents a deletion.
19 abstract class DeletedDataTreeCandidateNode extends AbstractDataTreeCandidateNode {
20 private DeletedDataTreeCandidateNode() {
21 super(ModificationType.DELETE);
24 static DataTreeCandidateNode create() {
25 return new DeletedDataTreeCandidateNode() {
27 public PathArgument name() {
28 throw new UnsupportedOperationException("Root node does not have an identifier");
33 static DataTreeCandidateNode create(final PathArgument identifier) {
34 return new DeletedDataTreeCandidateNode() {
36 public PathArgument name() {
43 public final NormalizedNode dataAfter() {
48 public final Collection<DataTreeCandidateNode> childNodes() {
49 // We would require the before-image to reconstruct the list of nodes which were deleted.
50 throw new UnsupportedOperationException("Children not available after serialization");