}
@Override
- protected final void verifyWrittenStructure(final NormalizedNode<?, ?> writtenValue) {
+ protected final void verifyStructure(final NormalizedNode<?, ?> writtenValue, final boolean verifyChildren) {
checkArgument(nodeClass.isInstance(writtenValue), "Node should must be of type %s", nodeClass);
}
}
@Override
- protected final TreeNode applySubtreeChange(final ModifiedNode modification,
+ protected final TreeNode applyTouch(final ModifiedNode modification,
final TreeNode currentMeta, final Version version) {
throw new UnsupportedOperationException("Node " + schema.getPath()
+ "is leaf type node. Subtree change is not allowed.");
@Override
protected final void checkTouchApplicable(final YangInstanceIdentifier path, final NodeModification modification,
- final Optional<TreeNode> current) throws IncorrectDataStructureException {
+ final Optional<TreeNode> current, final Version version) throws IncorrectDataStructureException {
throw new IncorrectDataStructureException(path, "Subtree modification is not allowed.");
}
-}
\ No newline at end of file
+
+ @Override
+ void mergeIntoModifiedNode(final ModifiedNode node, final NormalizedNode<?, ?> value, final Version version) {
+
+ switch (node.getOperation()) {
+ // Delete performs a data dependency check on existence of the node. Performing a merge
+ // on DELETE means we
+ // are really performing a write.
+ case DELETE:
+ case WRITE:
+ node.write(value);
+ break;
+ default:
+ node.updateValue(LogicalOperation.MERGE, value);
+ }
+ }
+
+ @Override
+ void recursivelyVerifyStructure(NormalizedNode<?, ?> value) {
+ verifyStructure(value, false);
+ }
+}