1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411;
3 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
4 import org.opendaylight.yangtools.yang.data.api.schema.tree.*;
5 import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
6 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
10 public class InMemoryDataTreeModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractInMemoryDataTreeModule {
12 private static final Logger LOG = LoggerFactory.getLogger(InMemoryDataTreeModule.class);
14 public InMemoryDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
15 super(identifier, dependencyResolver);
18 public InMemoryDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.InMemoryDataTreeModule oldModule, java.lang.AutoCloseable oldInstance) {
19 super(identifier, dependencyResolver, oldModule, oldInstance);
23 public void customValidation() {
24 // add custom validation form module attributes here.
28 public java.lang.AutoCloseable createInstance() {
29 LOG.debug("InMemoryConfigDataTreeModule.createInstance()");
30 return new CloseableConfigDataTree(getSchemaServiceDependency().getGlobalContext(), getType());
33 private static class CloseableConfigDataTree implements AutoCloseable,
34 org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree {
35 private final org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree dataTree;
37 public CloseableConfigDataTree(final SchemaContext schemaContext, final DatatreeType type) {
38 this.dataTree = InMemoryDataTreeFactory.getInstance().create(
39 type == DatatreeType.Config ? TreeType.CONFIGURATION : TreeType.OPERATIONAL
41 dataTree.setSchemaContext(schemaContext);
45 public void close() throws Exception {
50 public DataTreeSnapshot takeSnapshot() {
51 return dataTree.takeSnapshot();
55 public void setSchemaContext(final SchemaContext newSchemaContext) {
56 dataTree.setSchemaContext(newSchemaContext);
60 public void commit(final DataTreeCandidate candidate) {
61 dataTree.commit(candidate);
65 public YangInstanceIdentifier getRootPath() {
66 return dataTree.getRootPath();
70 public void validate(final DataTreeModification modification) throws DataValidationFailedException {
71 dataTree.validate(modification);
75 public DataTreeCandidate prepare(final DataTreeModification modification) {
76 return dataTree.prepare(modification);