1 package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406;
4 import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyAugReaderList;
5 import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyChildReaderList;
6 import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonAugReaderList;
7 import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonChildReaderList;
9 import com.google.common.collect.Lists;
10 import io.fd.honeycomb.v3po.translate.impl.read.CompositeChildReader;
11 import io.fd.honeycomb.v3po.translate.impl.read.CompositeListReader;
12 import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader;
13 import io.fd.honeycomb.v3po.translate.read.ChildReader;
14 import io.fd.honeycomb.v3po.translate.util.read.CloseableReader;
15 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveAugmentReaderCustomizer;
16 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer;
17 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.EthernetCustomizer;
18 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer;
19 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.TapCustomizer;
20 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VhostUserCustomizer;
21 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VxlanCustomizer;
22 import java.util.List;
23 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
24 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
25 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
26 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder;
27 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
31 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap;
32 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan;
34 import org.opendaylight.yangtools.yang.binding.ChildOf;
36 public class InterfacesStateHoneycombReaderModule extends
37 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule {
38 public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
39 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
40 super(identifier, dependencyResolver);
43 public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
44 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
45 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.InterfacesStateHoneycombReaderModule oldModule,
46 java.lang.AutoCloseable oldInstance) {
47 super(identifier, dependencyResolver, oldModule, oldInstance);
51 public void customValidation() {
52 // add custom validation form module attributes here.
56 public java.lang.AutoCloseable createInstance() {
58 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> ethernetReader =
59 new CompositeChildReader<>(Ethernet.class,
60 new EthernetCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
62 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> tapReader =
63 new CompositeChildReader<>(Tap.class,
64 new TapCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
66 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> vhostUserReader =
67 new CompositeChildReader<>(VhostUser.class,
68 new VhostUserCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
70 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> vxlanReader =
71 new CompositeChildReader<>(Vxlan.class,
72 new VxlanCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
74 final List<ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>>> childReaders = Lists.newArrayList();
75 childReaders.add(ethernetReader);
76 childReaders.add(tapReader);
77 childReaders.add(vhostUserReader);
78 childReaders.add(vxlanReader);
80 final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader =
81 new CompositeChildReader<>(VppInterfaceStateAugmentation.class,
83 new ReflexiveAugmentReaderCustomizer<>(VppInterfaceStateAugmentationBuilder.class,
84 VppInterfaceStateAugmentation.class));
86 final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader =
87 new CompositeListReader<>(Interface.class,
88 emptyChildReaderList(),
89 singletonAugReaderList(vppInterfaceStateAugmentationChildReader),
90 new InterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
92 return new CloseableReader<>(new CompositeRootReader<>(
93 InterfacesState.class,
94 singletonChildReaderList(interfaceReader),
96 new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class)));