145fc43456ad94fadcfeb0131445d587b5aed706
[hc2vpp.git] /
1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411;
2
3 import java.nio.file.InvalidPathException;
4 import java.nio.file.Paths;
5 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
6
7 public class PersistingDataTreeAdapterModule extends
8     org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractPersistingDataTreeAdapterModule {
9     public PersistingDataTreeAdapterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
10                                            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
11         super(identifier, dependencyResolver);
12     }
13
14     public PersistingDataTreeAdapterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
15                                            org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
16                                            org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.PersistingDataTreeAdapterModule oldModule,
17                                            java.lang.AutoCloseable oldInstance) {
18         super(identifier, dependencyResolver, oldModule, oldInstance);
19     }
20
21     @Override
22     public void customValidation() {
23         try {
24             Paths.get(getPersistFilePath());
25         } catch (InvalidPathException e) {
26             throw new JmxAttributeValidationException("Invalid persist path", e, persistFilePathJmxAttribute);
27         }
28     }
29
30     @Override
31     public java.lang.AutoCloseable createInstance() {
32         return new io.fd.honeycomb.v3po.data.impl.PersistingDataTreeAdapter(
33             getDelegateDependency(),
34             getSchemaServiceDependency(),
35             Paths.get(getPersistFilePath()));
36     }
37
38 }