summaryrefslogtreecommitdiffstats
path: root/infra/data-impl/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/data/impl/rev160411/PersistingDataTreeAdapterModule.java
blob: c15feace91314a5e5d374551c8b64a05221a7c04 (plain)
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
package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411;

import java.nio.file.InvalidPathException;
import java.nio.file.Paths;
import org.opendaylight.controller.config.api.JmxAttributeValidationException;

public class PersistingDataTreeAdapterModule extends
    org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.data.impl.rev160411.AbstractPersistingDataTreeAdapterModule {
    public PersistingDataTreeAdapterModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
                                           org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
        super(identifier, dependencyResolver);
    }

    public PersistingDataTreeAdapterModule(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.PersistingDataTreeAdapterModule oldModule,
                                           java.lang.AutoCloseable oldInstance) {
        super(identifier, dependencyResolver, oldModule, oldInstance);
    }

    @Override
    public void customValidation() {
        try {
            Paths.get(getPersistFilePath());
        } catch (InvalidPathException e) {
            throw new JmxAttributeValidationException("Invalid persist path", e, persistFilePathJmxAttribute);
        }
    }

    @Override
    public java.lang.AutoCloseable createInstance() {
        return new io.fd.honeycomb.data.impl.PersistingDataTreeAdapter(
            getDelegateDependency(),
            getSchemaServiceDependency(),
            Paths.get(getPersistFilePath()));
    }

}