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.mdsal.dom.spi.shard;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
13 import com.google.common.collect.ImmutableMap;
15 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
19 * Writable node that is located at a boundary to a subshard.
21 * @deprecated This interface is scheduled for removal in the next major release.
23 @Deprecated(forRemoval = true)
25 public class WriteableSubshardBoundaryNode extends WriteableModificationNode {
27 private final ForeignShardModificationContext boundary;
29 WriteableSubshardBoundaryNode(final ForeignShardModificationContext boundary) {
30 this.boundary = requireNonNull(boundary);
33 public static WriteableSubshardBoundaryNode from(final ForeignShardModificationContext value) {
34 return new WriteableSubshardBoundaryNode(value);
38 public PathArgument getIdentifier() {
39 return boundary.getIdentifier().getRootIdentifier().getLastPathArgument();
43 public WriteCursorStrategy createOperation(final DOMDataTreeWriteCursor parentCursor) {
44 return new DelegatingWriteCursorStrategy() {
51 protected DelegatingWriteCursorStrategy childStrategy() {
52 return new DelegatingWriteCursorStrategy() {
54 protected DOMDataTreeWriteCursor delegate() {
55 return boundary.getCursor();
61 protected DOMDataTreeWriteCursor delegate() {
62 return boundary.getCursor();
68 public WriteableModificationNode getChild(final PathArgument node) {
69 // Another level of nesting should be taken care of by underlying cursor.
74 public void markDeleted() {
75 // FIXME: Should we delete all data or disconnect?
79 public Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards() {
80 return ImmutableMap.of();