1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411;
import io.fd.honeycomb.v3po.data.DataTreeSnapshot;
import io.fd.honeycomb.v3po.data.ModifiableDataTree;
import io.fd.honeycomb.v3po.data.impl.ConfigDataTree;
import io.fd.honeycomb.v3po.translate.TranslationException;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConfigDataTreeModule extends
org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractConfigDataTreeModule {
private static final Logger LOG = LoggerFactory.getLogger(ConfigDataTreeModule.class);
public ConfigDataTreeModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
super(identifier, dependencyResolver);
}
public ConfigDataTreeModule(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.ConfigDataTreeModule oldModule,
java.lang.AutoCloseable oldInstance) {
super(identifier, dependencyResolver, oldModule, oldInstance);
}
@Override
public void customValidation() {
// add custom validation form module attributes here.
}
@Override
public java.lang.AutoCloseable createInstance() {
LOG.debug("ConfigDataTreeModule.createInstance()");
return new CloseableConfigDataTree(
new ConfigDataTree(getSerializerDependency(), getDataTreeDependency(), getWriterRegistryDependency()));
}
private static final class CloseableConfigDataTree implements ModifiableDataTree, AutoCloseable {
private final ConfigDataTree delegate;
CloseableConfigDataTree(final ConfigDataTree delegate) {
this.delegate = delegate;
}
@Override
public void close() throws Exception {
LOG.debug("CloseableConfigDataTree.close()");
// NOP
}
@Override
public void modify(final DataTreeModification modification)
throws DataValidationFailedException, TranslationException {
LOG.trace("CloseableConfigDataTree.modify modification={}", modification);
delegate.modify(modification);
}
@Override
public DataTreeSnapshot takeSnapshot() {
LOG.trace("CloseableConfigDataTree.takeSnapshot");
return delegate.takeSnapshot();
}
}
}
|