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
9 package org.opendaylight.mdsal.dom.store.inmemory;
11 import com.google.common.base.Preconditions;
12 import com.google.common.collect.ImmutableMap;
14 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteCursor;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
17 final class WriteableSubshardBoundaryNode extends WriteableModificationNode {
19 private final ForeignShardModificationContext boundary;
21 private WriteableSubshardBoundaryNode(final ForeignShardModificationContext boundary) {
22 this.boundary = Preconditions.checkNotNull(boundary);
25 public static WriteableSubshardBoundaryNode from(final ForeignShardModificationContext value) {
26 return new WriteableSubshardBoundaryNode(value);
30 public PathArgument getIdentifier() {
31 return boundary.getIdentifier().getRootIdentifier().getLastPathArgument();
35 WriteCursorStrategy createOperation(final DOMDataTreeWriteCursor parentCursor) {
36 return new DelegatingWriteCursorStrategy() {
43 protected DelegatingWriteCursorStrategy childStrategy() {
44 return new DelegatingWriteCursorStrategy() {
46 protected DOMDataTreeWriteCursor delegate() {
47 return boundary.getCursor();
53 protected DOMDataTreeWriteCursor delegate() {
54 return boundary.getCursor();
60 WriteableModificationNode getChild(final PathArgument node) {
61 // Another level of nesting should be taken care of by underlying cursor.
67 // FIXME: Should we delete all data or disconnect?
71 Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards() {
72 return ImmutableMap.of();