1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406;
3 import com.google.common.base.Optional;
4 import io.fd.honeycomb.v3po.translate.impl.read.CompositeChildReader;
5 import io.fd.honeycomb.v3po.translate.impl.read.CompositeListReader;
6 import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader;
7 import io.fd.honeycomb.v3po.translate.read.ChildReader;
8 import io.fd.honeycomb.v3po.translate.read.ReadContext;
9 import io.fd.honeycomb.v3po.translate.read.ReadFailedException;
10 import io.fd.honeycomb.v3po.translate.read.Reader;
11 import io.fd.honeycomb.v3po.translate.util.RWUtils;
12 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer;
13 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer;
14 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VppInterfaceStateCustomizer;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder;
19 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceAugmentation;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
22 import org.opendaylight.yangtools.yang.binding.DataObject;
23 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
24 import org.openvpp.vppjapi.vppApi;
26 import javax.annotation.Nonnull;
28 public class InterfacesStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule {
29 public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
30 super(identifier, dependencyResolver);
33 public InterfacesStateHoneycombReaderModule(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.v3po2vpp.rev160406.InterfacesStateHoneycombReaderModule oldModule, java.lang.AutoCloseable oldInstance) {
34 super(identifier, dependencyResolver, oldModule, oldInstance);
38 public void customValidation() {
39 // add custom validation form module attributes here.
43 public java.lang.AutoCloseable createInstance() {
44 final vppApi vppApi = getVppJapiDependency();
46 final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader =
47 new CompositeChildReader<>(VppInterfaceStateAugmentation.class,
48 new VppInterfaceStateCustomizer(vppApi));
50 final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader =
51 new CompositeListReader<>(Interface.class,
52 RWUtils.<Interface>emptyChildReaderList(),
53 RWUtils.<Interface>singletonAugReaderList(vppInterfaceStateAugmentationChildReader),
54 new InterfaceCustomizer(vppApi));
56 return new CloseableReader(new CompositeRootReader<>(
57 InterfacesState.class,
58 RWUtils.singletonChildReaderList(interfaceReader),
59 RWUtils.<InterfacesState>emptyAugReaderList(),
60 new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class)));
64 private static final class CloseableReader implements Reader<InterfacesState>, AutoCloseable {
66 private CompositeRootReader<InterfacesState, InterfacesStateBuilder> compositeRootReader;
68 public CloseableReader(
69 final CompositeRootReader<InterfacesState, InterfacesStateBuilder> compositeRootReader) {
70 this.compositeRootReader = compositeRootReader;
75 public Optional<? extends DataObject> read(@Nonnull InstanceIdentifier<? extends DataObject> id,
76 @Nonnull ReadContext ctx) throws ReadFailedException {
77 return compositeRootReader.read(id, ctx);
82 public InstanceIdentifier<InterfacesState> getManagedDataObjectType() {
83 return compositeRootReader.getManagedDataObjectType();
87 public String toString() {
88 return compositeRootReader.toString();
92 public void close() throws Exception {