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.RWUtils;
15 import io.fd.honeycomb.v3po.translate.util.read.CloseableReader;
16 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveAugmentReaderCustomizer;
17 import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer;
18 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.EthernetCustomizer;
19 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer;
20 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.L2Customizer;
21 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.SubInterfaceCustomizer;
22 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.TapCustomizer;
23 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VhostUserCustomizer;
24 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VlanTagRewriteCustomizer;
25 import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.VxlanCustomizer;
26 import java.util.Collections;
27 import java.util.List;
28 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
29 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesStateBuilder;
30 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
31 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder;
32 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey;
33 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentationBuilder;
35 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Ethernet;
36 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.L2;
37 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.SubInterface;
38 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Tap;
39 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.VhostUser;
40 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.interfaces.state._interface.Vxlan;
41 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.l2.attributes.VlanTagRewrite;
42 import org.opendaylight.yangtools.yang.binding.ChildOf;
44 public class InterfacesStateHoneycombReaderModule extends
45 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule {
46 public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
47 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
48 super(identifier, dependencyResolver);
51 public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier,
52 org.opendaylight.controller.config.api.DependencyResolver dependencyResolver,
53 org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.InterfacesStateHoneycombReaderModule oldModule,
54 java.lang.AutoCloseable oldInstance) {
55 super(identifier, dependencyResolver, oldModule, oldInstance);
59 public void customValidation() {
60 // add custom validation form module attributes here.
64 public java.lang.AutoCloseable createInstance() {
66 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> ethernetReader =
67 new CompositeChildReader<>(Ethernet.class,
68 new EthernetCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
70 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> tapReader =
71 new CompositeChildReader<>(Tap.class,
72 new TapCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
74 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> vhostUserReader =
75 new CompositeChildReader<>(VhostUser.class,
76 new VhostUserCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
78 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> vxlanReader =
79 new CompositeChildReader<>(Vxlan.class,
80 new VxlanCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
82 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> subInterfaceReader =
83 new CompositeChildReader<>(SubInterface.class,
84 new SubInterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
86 final ChildReader<VlanTagRewrite> vlanTagReader =
87 new CompositeChildReader<>(VlanTagRewrite.class,
88 new VlanTagRewriteCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
91 final List<ChildReader<? extends ChildOf<L2>>> l2ChildReaders =
92 Collections.singletonList((ChildReader)vlanTagReader); // TODO can we get rid of the cast?
93 final ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>> l2Reader =
94 new CompositeChildReader<>(L2.class,
96 RWUtils.emptyAugReaderList(),
97 new L2Customizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency(), getBridgeDomainContextIfcStateDependency()));
99 final List<ChildReader<? extends ChildOf<VppInterfaceStateAugmentation>>> childReaders = Lists.newArrayList();
100 childReaders.add(ethernetReader);
101 childReaders.add(tapReader);
102 childReaders.add(vhostUserReader);
103 childReaders.add(vxlanReader);
104 childReaders.add(subInterfaceReader);
105 childReaders.add(l2Reader);
107 final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader =
108 new CompositeChildReader<>(VppInterfaceStateAugmentation.class,
110 new ReflexiveAugmentReaderCustomizer<>(VppInterfaceStateAugmentationBuilder.class,
111 VppInterfaceStateAugmentation.class));
113 final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader =
114 new CompositeListReader<>(Interface.class,
115 emptyChildReaderList(),
116 singletonAugReaderList(vppInterfaceStateAugmentationChildReader),
117 new InterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency()));
119 return new CloseableReader<>(new CompositeRootReader<>(
120 InterfacesState.class,
121 singletonChildReaderList(interfaceReader),
122 emptyAugReaderList(),
123 new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class)));