1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411;
3 import io.fd.honeycomb.v3po.data.DataTreeSnapshot;
4 import io.fd.honeycomb.v3po.data.ModifiableDataTree;
5 import io.fd.honeycomb.v3po.data.impl.ConfigDataTree;
6 import io.fd.honeycomb.v3po.translate.TranslationException;
7 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
8 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
9 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
10 import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
11 import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
15 public class ConfigDataTreeModule extends
16 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractConfigDataTreeModule {
18 private static final Logger LOG = LoggerFactory.getLogger(ConfigDataTreeModule.class);
20 public ConfigDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
21 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
22 super(identifier, dependencyResolver);
25 public ConfigDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
26 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
27 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.ConfigDataTreeModule oldModule,
28 java.lang.AutoCloseable oldInstance) {
29 super(identifier, dependencyResolver, oldModule, oldInstance);
33 public void customValidation() {
34 // add custom validation form module attributes here.
38 public java.lang.AutoCloseable createInstance() {
39 LOG.info("ConfigDataTreeModule.createInstance()");
40 final DataTree dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.CONFIGURATION);
41 dataTree.setSchemaContext(getSchemaServiceDependency().getGlobalContext());
42 return new CloseableConfigDataTree(
43 new ConfigDataTree(getSerializerDependency(), dataTree, getWriterRegistryDependency()));
46 private static final class CloseableConfigDataTree implements ModifiableDataTree, AutoCloseable {
48 private final ConfigDataTree delegate;
50 CloseableConfigDataTree(final ConfigDataTree delegate) {
51 this.delegate = delegate;
55 public void close() throws Exception {
56 LOG.info("CloseableConfigDataTree.close()");
61 public void modify(final DataTreeModification modification)
62 throws DataValidationFailedException, TranslationException {
63 LOG.trace("CloseableConfigDataTree.modify modification={}", modification);
64 delegate.modify(modification);
68 public void initialize(final DataTreeModification modification) throws DataValidationFailedException {
69 LOG.trace("CloseableConfigDataTree.initialize modification={}", modification);
70 delegate.initialize(modification);
74 public DataTreeSnapshot takeSnapshot() {
75 LOG.trace("CloseableConfigDataTree.takeSnapshot");
76 return delegate.takeSnapshot();