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.DataTree;
5 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
6 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
7 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
8 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
9 import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
10 import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
11 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 public class InMemoryConfigDataTreeModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractInMemoryConfigDataTreeModule {
17 private static final Logger LOG = LoggerFactory.getLogger(InMemoryConfigDataTreeModule.class);
19 public InMemoryConfigDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
20 super(identifier, dependencyResolver);
23 public InMemoryConfigDataTreeModule(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.InMemoryConfigDataTreeModule oldModule, java.lang.AutoCloseable oldInstance) {
24 super(identifier, dependencyResolver, oldModule, oldInstance);
28 public void customValidation() {
29 // add custom validation form module attributes here.
33 public java.lang.AutoCloseable createInstance() {
34 LOG.debug("InMemoryConfigDataTreeModule.createInstance()");
35 return new CloseableConfigDataTree(getSchemaServiceDependency().getGlobalContext());
38 private static class CloseableConfigDataTree implements AutoCloseable, DataTree {
39 private final DataTree dataTree;
41 public CloseableConfigDataTree(final SchemaContext schemaContext) {
42 this.dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.CONFIGURATION);
43 dataTree.setSchemaContext(schemaContext);
47 public void close() throws Exception {
52 public DataTreeSnapshot takeSnapshot() {
53 return dataTree.takeSnapshot();
57 public void setSchemaContext(final SchemaContext newSchemaContext) {
58 dataTree.setSchemaContext(newSchemaContext);
62 public void commit(final DataTreeCandidate candidate) {
63 dataTree.commit(candidate);
67 public YangInstanceIdentifier getRootPath() {
68 return dataTree.getRootPath();
72 public void validate(final DataTreeModification modification) throws DataValidationFailedException {
73 dataTree.validate(modification);
77 public DataTreeCandidate prepare(final DataTreeModification modification) {
78 return dataTree.prepare(modification);