3f092e936e2e8aa8de392b3af088858c9e18f2f3
[hc2vpp.git] /
1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.japi.cfg.rev160406;
2
3 import java.io.IOException;
4 import org.openvpp.vppjapi.vppApi;
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7
8 public class VppJapiImplModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.vpp.japi.cfg.rev160406.AbstractVppJapiImplModule {
9
10     private static final Logger LOG = LoggerFactory.getLogger(VppJapiImplModule.class);
11
12     public VppJapiImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
13         super(identifier, dependencyResolver);
14     }
15
16     public VppJapiImplModule(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.vpp.japi.cfg.rev160406.VppJapiImplModule oldModule, java.lang.AutoCloseable oldInstance) {
17         super(identifier, dependencyResolver, oldModule, oldInstance);
18     }
19
20     @Override
21     public void customValidation() {
22         // add custom validation form module attributes here.
23     }
24
25     @Override
26     public java.lang.AutoCloseable createInstance() {
27         try {
28             final vppApi vppApi = new vppApi(getName());
29             LOG.info("VPP-INFO: VPP api client connection established");
30             return vppApi;
31         } catch (IOException e) {
32             LOG.error("VPP-ERROR: VPP api client connection failed", e);
33             throw new IllegalStateException("Unable to open vpp API", e);
34         }
35     }
36
37 }