diff options
author | 2016-05-04 10:17:39 +0200 | |
---|---|---|
committer | 2016-05-05 08:41:23 +0200 | |
commit | ca361fd5bfe881014d0791fd9c3b13b66a2d13b2 (patch) | |
tree | 27f2424062bda7e1f4a5c90bc473877b0be1f2eb /v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1 | |
parent | bd1da232ce96416dfde5bb8a2a04afc070395678 (diff) |
HONEYCOMB-10: Porting v3po2vpp to the new Java API
Change-Id: Ic7166b0f578442165595aa44a587ebbc5db0e75c
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1')
4 files changed, 47 insertions, 38 deletions
diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java index e906167fd..769589b3d 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesHoneycombWriterModule.java @@ -54,9 +54,9 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v ifcAugmentations.add(getInterface1AugmentationWriter()); final ChildWriter<Interface> interfaceWriter = new CompositeListWriter<>(Interface.class, - RWUtils.<Interface>emptyChildWriterList(), + RWUtils.emptyChildWriterList(), ifcAugmentations, - new InterfaceCustomizer(getVppJapiIfcDependency()), + new InterfaceCustomizer(getVppJvppIfcDependency(), getInterfaceContextDependency()), // It's important that this customizer is handled in a postorder way, because you first have to handle child nodes // e.g. Vxlan before setting other interface or vppInterfaceAugmentation leaves TraversalType.POSTORDER); @@ -68,36 +68,36 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v // we loose the ordering information for root writers // Or can we rely to the order in which readers are configured ? return new CloseableWriter<>(new CompositeRootWriter<>(Interfaces.class, - childWriters, new NoopWriterCustomizer<Interfaces>())); + childWriters, new NoopWriterCustomizer<>())); } private ChildWriter<? extends Augmentation<Interface>> getInterface1AugmentationWriter() { final ChildWriter<Ipv4> ipv4Writer = new CompositeChildWriter<>(Ipv4.class, - new Ipv4Customizer(getVppJapiIfcDependency())); + new Ipv4Customizer(getVppJvppIfcDependency(), getInterfaceContextDependency())); final ChildWriter<Ipv6> ipv6Writer = new CompositeChildWriter<>(Ipv6.class, - new Ipv6Customizer(getVppJapiIfcDependency())); + new Ipv6Customizer(getVppJvppIfcDependency())); final List<ChildWriter<? extends ChildOf<Interface1>>> interface1ChildWriters = Lists.newArrayList(); interface1ChildWriters.add(ipv4Writer); interface1ChildWriters.add(ipv6Writer); return new CompositeChildWriter<>(Interface1.class, - interface1ChildWriters, new ReflexiveAugmentWriterCustomizer<Interface1>()); + interface1ChildWriters, new ReflexiveAugmentWriterCustomizer<>()); } private ChildWriter<VppInterfaceAugmentation> getVppIfcAugmentationWriter() { final ChildWriter<Ethernet> ethernetWriter = new CompositeChildWriter<>(Ethernet.class, - new EthernetCustomizer(getVppJapiIfcDependency())); + new EthernetCustomizer(getVppJvppIfcDependency())); final ChildWriter<Routing> routingWriter = new CompositeChildWriter<>(Routing.class, - new RoutingCustomizer(getVppJapiIfcDependency())); + new RoutingCustomizer(getVppJvppIfcDependency(), getInterfaceContextDependency())); final ChildWriter<Vxlan> vxlanWriter = new CompositeChildWriter<>(Vxlan.class, - new VxlanCustomizer(getVppJapiIfcDependency())); + new VxlanCustomizer(getVppJvppIfcDependency(), getInterfaceContextDependency())); final ChildWriter<L2> l2Writer = new CompositeChildWriter<>(L2.class, - new L2Customizer(getVppJapiIfcDependency())); + new L2Customizer(getVppJvppIfcDependency(), getInterfaceContextDependency(), getBridgeDomainContextDependency())); final List<ChildWriter<? extends ChildOf<VppInterfaceAugmentation>>> vppIfcChildWriters = Lists.newArrayList(); // TODO what's the order here ? @@ -108,7 +108,7 @@ public class InterfacesHoneycombWriterModule extends org.opendaylight.yang.gen.v return new CompositeChildWriter<>(VppInterfaceAugmentation.class, vppIfcChildWriters, - RWUtils.<VppInterfaceAugmentation>emptyAugWriterList(), - new ReflexiveAugmentWriterCustomizer<VppInterfaceAugmentation>()); + RWUtils.emptyAugWriterList(), + new ReflexiveAugmentWriterCustomizer<>()); } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java index aa72a29af..e753cf56e 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/InterfacesStateHoneycombReaderModule.java @@ -1,10 +1,15 @@ package org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406; + +import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyAugReaderList; +import static io.fd.honeycomb.v3po.translate.util.RWUtils.emptyChildReaderList; +import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonAugReaderList; +import static io.fd.honeycomb.v3po.translate.util.RWUtils.singletonChildReaderList; + import io.fd.honeycomb.v3po.translate.impl.read.CompositeChildReader; import io.fd.honeycomb.v3po.translate.impl.read.CompositeListReader; import io.fd.honeycomb.v3po.translate.impl.read.CompositeRootReader; import io.fd.honeycomb.v3po.translate.read.ChildReader; -import io.fd.honeycomb.v3po.translate.util.RWUtils; import io.fd.honeycomb.v3po.translate.util.read.CloseableReader; import io.fd.honeycomb.v3po.translate.util.read.ReflexiveRootReaderCustomizer; import io.fd.honeycomb.v3po.translate.v3po.interfacesstate.InterfaceCustomizer; @@ -15,14 +20,18 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces. import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceBuilder; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.InterfaceKey; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.VppInterfaceStateAugmentation; -import org.openvpp.vppjapi.vppApi; -public class InterfacesStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule { - public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { +public class InterfacesStateHoneycombReaderModule extends + org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractInterfacesStateHoneycombReaderModule { + public InterfacesStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, + org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { super(identifier, dependencyResolver); } - 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) { + 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) { super(identifier, dependencyResolver, oldModule, oldInstance); } @@ -33,22 +42,22 @@ public class InterfacesStateHoneycombReaderModule extends org.opendaylight.yang. @Override public java.lang.AutoCloseable createInstance() { - final vppApi vppApi = getVppJapiDependency(); final ChildReader<VppInterfaceStateAugmentation> vppInterfaceStateAugmentationChildReader = - new CompositeChildReader<>(VppInterfaceStateAugmentation.class, - new VppInterfaceStateCustomizer(vppApi)); + new CompositeChildReader<>(VppInterfaceStateAugmentation.class, + new VppInterfaceStateCustomizer(getVppJvppDependency())); + final CompositeListReader<Interface, InterfaceKey, InterfaceBuilder> interfaceReader = - new CompositeListReader<>(Interface.class, - RWUtils.<Interface>emptyChildReaderList(), - RWUtils.<Interface>singletonAugReaderList(vppInterfaceStateAugmentationChildReader), - new InterfaceCustomizer(vppApi)); + new CompositeListReader<>(Interface.class, + emptyChildReaderList(), + singletonAugReaderList(vppInterfaceStateAugmentationChildReader), + new InterfaceCustomizer(getVppJvppDependency(), getInterfaceContextIfcStateDependency())); return new CloseableReader<>(new CompositeRootReader<>( - InterfacesState.class, - RWUtils.singletonChildReaderList(interfaceReader), - RWUtils.<InterfacesState>emptyAugReaderList(), - new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class))); + InterfacesState.class, + singletonChildReaderList(interfaceReader), + emptyAugReaderList(), + new ReflexiveRootReaderCustomizer<>(InterfacesStateBuilder.class))); } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java index a9eff593d..69c1bfc11 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppHoneycombWriterModule.java @@ -35,20 +35,20 @@ public class VppHoneycombWriterModule extends org.opendaylight.yang.gen.v1.urn.h public java.lang.AutoCloseable createInstance() { final CompositeListWriter<BridgeDomain, BridgeDomainKey> bridgeDomainWriter = new CompositeListWriter<>( BridgeDomain.class, - new BridgeDomainCustomizer(getVppJapiWriterDependency())); + new BridgeDomainCustomizer(getVppJvppWriterDependency(), getBridgeDomainContextVppDependency())); - final ChildWriter<BridgeDomains> bridgeDomainsReader = new CompositeChildWriter<>( + final ChildWriter<BridgeDomains> bridgeDomainsWriter = new CompositeChildWriter<>( BridgeDomains.class, RWUtils.singletonChildWriterList(bridgeDomainWriter), - new ReflexiveChildWriterCustomizer<BridgeDomains>()); + new ReflexiveChildWriterCustomizer<>()); final List<ChildWriter<? extends ChildOf<Vpp>>> childWriters = new ArrayList<>(); - childWriters.add(bridgeDomainsReader); + childWriters.add(bridgeDomainsWriter); return new CloseableWriter<>(new CompositeRootWriter<>( Vpp.class, childWriters, - new NoopWriterCustomizer<Vpp>())); + new NoopWriterCustomizer<>())); } } diff --git a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java index 0e1d48035..9a0165577 100644 --- a/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java +++ b/v3po/v3po2vpp/src/main/java/org/opendaylight/yang/gen/v1/urn/honeycomb/params/xml/ns/yang/v3po2vpp/rev160406/VppStateHoneycombReaderModule.java @@ -21,7 +21,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.v3po.rev150105.vpp.state.bridge.domains.BridgeDomainKey; import org.opendaylight.yangtools.yang.binding.ChildOf; -import org.openvpp.vppjapi.vppApi; +import org.openvpp.jvpp.future.FutureJVpp; public class VppStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1.urn.honeycomb.params.xml.ns.yang.v3po2vpp.rev160406.AbstractVppStateHoneycombReaderModule { public VppStateHoneycombReaderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { @@ -39,12 +39,13 @@ public class VppStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1. @Override public java.lang.AutoCloseable createInstance() { - final vppApi vppApi = getVppJapiDependency(); + final FutureJVpp vppApi = getVppJvppDependency(); final ChildReader<Version> versionReader = new CompositeChildReader<>(Version.class, new VersionCustomizer(vppApi)); final CompositeListReader<BridgeDomain, BridgeDomainKey, BridgeDomainBuilder> bridgeDomainReader = - new CompositeListReader<>(BridgeDomain.class, new BridgeDomainCustomizer(vppApi)); + new CompositeListReader<>(BridgeDomain.class, new BridgeDomainCustomizer(vppApi, + getBridgeDomainContextVppStateDependency(), getInterfaceContextVppStateDependency())); final ChildReader<BridgeDomains> bridgeDomainsReader = new CompositeChildReader<>( BridgeDomains.class, @@ -58,8 +59,7 @@ public class VppStateHoneycombReaderModule extends org.opendaylight.yang.gen.v1. return new CloseableReader<>(new CompositeRootReader<>( VppState.class, childVppReaders, - RWUtils.<VppState>emptyAugReaderList(), + RWUtils.emptyAugReaderList(), new ReflexiveRootReaderCustomizer<>(VppStateBuilder.class))); } - } |