X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2Ftree%2FNodeModification.java;h=4f650c171107abdbffd552a11f7e5531a1f1f8b8;hp=04fb3b7c6c50499ad0b96b220c2685b597bdcb9d;hb=refs%2Fchanges%2F38%2F6338%2F3;hpb=4427fbd42ca70cd6477539196fd8ad6252544b61 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java index 04fb3b7c6c..4f650c1711 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/NodeModification.java @@ -20,7 +20,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; import com.google.common.base.Optional; import com.google.common.base.Predicate; -import com.google.common.primitives.UnsignedLong; /** * Node Modification Node and Tree @@ -37,7 +36,9 @@ public class NodeModification implements StoreTreeNode, Identi public static final Predicate IS_TERMINAL_PREDICATE = new Predicate() { @Override public boolean apply(final NodeModification input) { - return input.getModificationType() == ModificationType.WRITE || input.getModificationType() == ModificationType.DELETE; + return input.getModificationType() == ModificationType.WRITE // + || input.getModificationType() == ModificationType.DELETE // + || input.getModificationType() == ModificationType.MERGE; } }; private final PathArgument identifier; @@ -48,7 +49,6 @@ public class NodeModification implements StoreTreeNode, Identi private NormalizedNode value; - private UnsignedLong subtreeVersion; private Optional snapshotCache; private final Map childModification; @@ -176,6 +176,14 @@ public class NodeModification implements StoreTreeNode, Identi this.value = value; } + public synchronized void merge(final NormalizedNode data) { + checkSealed(); + clearSnapshot(); + updateModificationType(ModificationType.MERGE); + // FIXME: Probably merge with previous value. + this.value = data; + } + @GuardedBy("this") private void checkSealed() { checkState(!sealed, "Node Modification is sealed. No further changes allowed.");