2 * Copyright (c) 2014 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
8 package org.opendaylight.yangtools.yang.data.impl.schema.tree;
10 import com.google.common.base.Optional;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.TreeNode;
14 import org.opendaylight.yangtools.yang.data.api.schema.tree.spi.Version;
17 * An implementation of apply operation which fails to do anything,
18 * consistently. An instance of this class is used by the data tree
19 * if it does not have a SchemaContext attached and hence cannot
20 * perform anything meaningful.
22 final class AlwaysFailOperation extends ModificationApplyOperation {
23 static final ModificationApplyOperation INSTANCE = new AlwaysFailOperation();
25 private AlwaysFailOperation() {
30 Optional<TreeNode> apply(final ModifiedNode modification,
31 final Optional<TreeNode> storeMeta, final Version version) {
32 throw new IllegalStateException("Schema Context is not available.");
36 void checkApplicable(final YangInstanceIdentifier path,final NodeModification modification, final Optional<TreeNode> storeMetadata) {
37 throw new IllegalStateException("Schema Context is not available.");
41 public Optional<ModificationApplyOperation> getChild(final PathArgument child) {
42 throw new IllegalStateException("Schema Context is not available.");
46 void verifyStructure(final ModifiedNode modification) {
47 throw new IllegalStateException("Schema Context is not available.");
51 ChildTrackingPolicy getChildPolicy() {
52 throw new IllegalStateException("Schema Context is not available.");