BUG-4684: validate changes against effective state
[yangtools.git] / yang / yang-data-impl / src / main / java / org / opendaylight / yangtools / yang / data / impl / schema / tree / AlwaysFailOperation.java
index 8c167905230f2b054799db729b97111893501b57..42bef4314a12b588f3f081116d597498908cfa9f 100644 (file)
@@ -1,9 +1,16 @@
+/*
+ * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
 
-
 import com.google.common.base.Optional;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
 
@@ -13,21 +20,22 @@ import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
  * if it does not have a SchemaContext attached and hence cannot
  * perform anything meaningful.
  */
-final class AlwaysFailOperation implements ModificationApplyOperation {
-    public static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
+final class AlwaysFailOperation extends ModificationApplyOperation {
+    static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
 
     private AlwaysFailOperation() {
 
     }
 
     @Override
-    public Optional<TreeNode> apply(final ModifiedNode modification,
+    Optional<TreeNode> apply(final ModifiedNode modification,
             final Optional<TreeNode> storeMeta, final Version version) {
         throw new IllegalStateException("Schema Context is not available.");
     }
 
     @Override
-    public void checkApplicable(final YangInstanceIdentifier path,final NodeModification modification, final Optional<TreeNode> storeMetadata) {
+    void checkApplicable(final YangInstanceIdentifier path, final NodeModification modification,
+            final Optional<TreeNode> storeMetadata, final Version version) {
         throw new IllegalStateException("Schema Context is not available.");
     }
 
@@ -37,7 +45,22 @@ final class AlwaysFailOperation implements ModificationApplyOperation {
     }
 
     @Override
-    public void verifyStructure(final ModifiedNode modification) {
+    void verifyStructure(final NormalizedNode<?, ?> modification, final boolean verifyChildren) {
+        throw new IllegalStateException("Schema Context is not available.");
+    }
+
+    @Override
+    ChildTrackingPolicy getChildPolicy() {
+        throw new IllegalStateException("Schema Context is not available.");
+    }
+
+    @Override
+    void mergeIntoModifiedNode(final ModifiedNode node, final NormalizedNode<?, ?> value, final Version version) {
+        throw new IllegalStateException("Schema Context is not available.");
+    }
+
+    @Override
+    void recursivelyVerifyStructure(NormalizedNode<?, ?> value) {
         throw new IllegalStateException("Schema Context is not available.");
     }
 }
\ No newline at end of file