Merge "Bug 1029: Remove dead code: sal-dom-it"
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / store / impl / tree / data / AlwaysFailOperation.java
1 package org.opendaylight.controller.md.sal.dom.store.impl.tree.data;
2
3 import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNode;
4 import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.Version;
5 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
6 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument;
7
8 import com.google.common.base.Optional;
9
10 /**
11  * An implementation of apply operation which fails to do anything,
12  * consistently. An instance of this class is used by the data tree
13  * if it does not have a SchemaContext attached and hence cannot
14  * perform anything meaningful.
15  */
16 final class AlwaysFailOperation implements ModificationApplyOperation {
17     @Override
18     public Optional<TreeNode> apply(final ModifiedNode modification,
19             final Optional<TreeNode> storeMeta, final Version subtreeVersion) {
20         throw new IllegalStateException("Schema Context is not available.");
21     }
22
23     @Override
24     public void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional<TreeNode> storeMetadata) {
25         throw new IllegalStateException("Schema Context is not available.");
26     }
27
28     @Override
29     public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
30         throw new IllegalStateException("Schema Context is not available.");
31     }
32
33     @Override
34     public void verifyStructure(final ModifiedNode modification) {
35         throw new IllegalStateException("Schema Context is not available.");
36     }
37 }