package org.opendaylight.controller.md.sal.dom.store.impl.tree.data; import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.TreeNode; import org.opendaylight.controller.md.sal.dom.store.impl.tree.spi.Version; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier.PathArgument; import com.google.common.base.Optional; /** * An implementation of apply operation which fails to do anything, * consistently. An instance of this class is used by the data tree * if it does not have a SchemaContext attached and hence cannot * perform anything meaningful. */ final class AlwaysFailOperation implements ModificationApplyOperation { @Override public Optional apply(final ModifiedNode modification, final Optional storeMeta, final Version subtreeVersion) { throw new IllegalStateException("Schema Context is not available."); } @Override public void checkApplicable(final InstanceIdentifier path,final NodeModification modification, final Optional storeMetadata) { throw new IllegalStateException("Schema Context is not available."); } @Override public Optional getChild(final PathArgument child) { throw new IllegalStateException("Schema Context is not available."); } @Override public void verifyStructure(final ModifiedNode modification) { throw new IllegalStateException("Schema Context is not available."); } }