diff options
author | Michal Cmarada <mcmarada@cisco.com> | 2019-05-29 15:15:14 +0200 |
---|---|---|
committer | Michal Cmarada <mcmarada@cisco.com> | 2019-05-29 15:15:14 +0200 |
commit | 4dce3cd25ec520ce51da1ed34e5b439eea19232d (patch) | |
tree | 6331e0ad9aab5aad042f0629c187f70942c9ac44 | |
parent | ac1c9bbcce723dbbec2d9900b7b8e2a9f32a8db6 (diff) |
cleanup v3po customizers
- remove unnecessary full paths
- reformat
Change-Id: If918be3de8b4839cd3a50d73d9de7c3e0b32ab3d
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
13 files changed, 91 insertions, 129 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/AfPacketCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/AfPacketCustomizer.java index 6af18219d..33047255d 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/AfPacketCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/AfPacketCustomizer.java @@ -114,23 +114,18 @@ public class AfPacketCustomizer implements InitializingReaderCustomizer<AfPacket @Nonnull @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.AfPacket> init( - @Nonnull final InstanceIdentifier<AfPacket> id, - @Nonnull final AfPacket readValue, - @Nonnull final ReadContext ctx) { - return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.AfPacketBuilder() + public Initialized<AfPacket> init(@Nonnull final InstanceIdentifier<AfPacket> id, @Nonnull final AfPacket readValue, + @Nonnull final ReadContext ctx) { + return Initialized.create(getCfgId(id), new AfPacketBuilder() .setHostInterfaceName(readValue.getHostInterfaceName()) .setMac(readValue.getMac()) .build()); } @VisibleForTesting - static InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.AfPacket> getCfgId( - final InstanceIdentifier<AfPacket> id) { + static InstanceIdentifier<AfPacket> getCfgId(final InstanceIdentifier<AfPacket> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) - .augmentation(VppInterfaceAugmentation.class) - .child( - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.AfPacket.class); + .augmentation(VppInterfaceAugmentation.class) + .child(AfPacket.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/GreCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/GreCustomizer.java index affef6111..af21856fd 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/GreCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/GreCustomizer.java @@ -128,20 +128,19 @@ public class GreCustomizer extends FutureJVppCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Gre> init( - @Nonnull final InstanceIdentifier<Gre> id, @Nonnull final Gre readValue, @Nonnull final ReadContext ctx) { + public Initialized<Gre> init(@Nonnull final InstanceIdentifier<Gre> id, @Nonnull final Gre readValue, + @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.GreBuilder() + new GreBuilder() .setDst(readValue.getDst()) .setSrc(readValue.getSrc()) .setOuterFibId(readValue.getOuterFibId()) .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Gre> getCfgId( - final InstanceIdentifier<Gre> id) { + private InstanceIdentifier<Gre> getCfgId(final InstanceIdentifier<Gre> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Gre.class); + .child(Gre.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceCustomizer.java index 3e0a1dc41..f8932bec3 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceCustomizer.java @@ -150,11 +150,11 @@ public class InterfaceCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev180220.interfaces.Interface> init( + public Initialized<Interface> init( @Nonnull final InstanceIdentifier<Interface> id, @Nonnull final Interface readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev180220.interfaces.InterfaceBuilder() + new InterfaceBuilder() .setName(readValue.getName()) .setType(readValue.getType()) .setEnabled(AdminStatus.Up.equals(readValue.getAdminStatus())) @@ -163,11 +163,8 @@ public class InterfaceCustomizer .build()); } - public static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev180220.interfaces.Interface> getCfgId( - final InstanceIdentifier<Interface> id) { - return InstanceIdentifier.create(Interfaces.class).child( - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev180220.interfaces.Interface.class, - new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev180220.interfaces.InterfaceKey( - id.firstKeyOf(Interface.class).getName())); + public static InstanceIdentifier<Interface> getCfgId(final InstanceIdentifier<Interface> id) { + return InstanceIdentifier.create(Interfaces.class) + .child(Interface.class, new InterfaceKey(id.firstKeyOf(Interface.class).getName())); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceRoutingCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceRoutingCustomizer.java index 9c1c5f834..81298cbab 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceRoutingCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/InterfaceRoutingCustomizer.java @@ -67,22 +67,17 @@ public class InterfaceRoutingCustomizer extends RoutingCustomizer implements @Nonnull @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Routing> init( - @Nonnull final InstanceIdentifier<Routing> id, - @Nonnull final Routing readValue, - @Nonnull final ReadContext ctx) { - return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.RoutingBuilder() - .setIpv4VrfId(readValue.getIpv4VrfId()) - .setIpv6VrfId(readValue.getIpv6VrfId()) - .build()); + public Initialized<Routing> init(@Nonnull final InstanceIdentifier<Routing> id, @Nonnull final Routing readValue, + @Nonnull final ReadContext ctx) { + return Initialized.create(getCfgId(id), new RoutingBuilder() + .setIpv4VrfId(readValue.getIpv4VrfId()) + .setIpv6VrfId(readValue.getIpv6VrfId()) + .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Routing> getCfgId( - final InstanceIdentifier<Routing> id) { + private InstanceIdentifier<Routing> getCfgId(final InstanceIdentifier<Routing> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child( - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Routing.class); + .child(Routing.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/L2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/L2Customizer.java index f3fd515d0..63347bf24 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/L2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/L2Customizer.java @@ -51,8 +51,7 @@ public class L2Customizer extends FutureJVppCustomizer implements InitializingRe private static final Logger LOG = LoggerFactory.getLogger(L2Customizer.class); private final InterconnectionReadUtils icReadUtils; - public L2Customizer(@Nonnull final FutureJVppCore futureJVppCore, - @Nonnull final NamingContext interfaceContext, + public L2Customizer(@Nonnull final FutureJVppCore futureJVppCore, @Nonnull final NamingContext interfaceContext, @Nonnull final NamingContext bridgeDomainContext, @Nonnull final InterfaceCacheDumpManager dumpManager) { super(futureJVppCore); @@ -82,13 +81,9 @@ public class L2Customizer extends FutureJVppCustomizer implements InitializingRe } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.L2> init( - @Nonnull final InstanceIdentifier<L2> id, - @Nonnull final L2 readValue, - @Nonnull final ReadContext ctx) { - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.L2Builder - l2Builder = - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.L2Builder(); + public Initialized<L2> init(@Nonnull final InstanceIdentifier<L2> id, @Nonnull final L2 readValue, + @Nonnull final ReadContext ctx) { + final L2Builder l2Builder = new L2Builder(); final Interconnection interconnection = readValue.getInterconnection(); if (interconnection != null) { @@ -110,10 +105,9 @@ public class L2Customizer extends FutureJVppCustomizer implements InitializingRe return Initialized.create(getCfgId(id), l2Builder.build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.L2> getCfgId( - final InstanceIdentifier<L2> id) { + private InstanceIdentifier<L2> getCfgId(final InstanceIdentifier<L2> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.L2.class); + .child(L2.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceCustomizer.java index d96584897..e6ff61c69 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceCustomizer.java @@ -218,11 +218,11 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterface> init( + public Initialized<SubInterface> init( @Nonnull final InstanceIdentifier<SubInterface> id, @Nonnull final SubInterface readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterfaceBuilder() + new SubInterfaceBuilder() .setEnabled(SubInterfaceStatus.Up.equals(readValue.getAdminStatus())) .setIdentifier(readValue.getIdentifier()) .setMatch(readValue.getMatch()) @@ -231,13 +231,10 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer .build()); } - public static InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterface> getCfgId( - final InstanceIdentifier<SubInterface> id) { + public static InstanceIdentifier<SubInterface> getCfgId(final InstanceIdentifier<SubInterface> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(SubinterfaceAugmentation.class) .child(SubInterfaces.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterface.class, - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterfaceKey( - id.firstKeyOf(SubInterface.class).getIdentifier())); + .child(SubInterface.class, new SubInterfaceKey(id.firstKeyOf(SubInterface.class).getIdentifier())); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceL2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceL2Customizer.java index 611c1942f..b83e1fba5 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceL2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/SubInterfaceL2Customizer.java @@ -28,7 +28,9 @@ import io.fd.honeycomb.translate.util.RWUtils; import io.fd.jvpp.core.future.FutureJVppCore; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.BridgeBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.BridgeBasedBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.XconnectBased; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.XconnectBasedBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterface; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterfaceBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterfaceKey; @@ -83,37 +85,29 @@ public class SubInterfaceL2Customizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.sub._interface.l2.config.attributes.L2> init( - @Nonnull final InstanceIdentifier<L2> id, - @Nonnull final L2 readValue, - @Nonnull final ReadContext ctx) { + public Initialized<L2> init(@Nonnull final InstanceIdentifier<L2> id, @Nonnull final L2 readValue, + @Nonnull final ReadContext ctx) { - org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.sub._interface.l2.config.attributes.L2Builder - builder = - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.sub._interface.l2.config.attributes.L2Builder(); + L2Builder builder = new L2Builder(); if (readValue.getInterconnection() instanceof XconnectBased) { XconnectBased state = (XconnectBased) readValue.getInterconnection(); - builder.setInterconnection( - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.XconnectBasedBuilder() - .setXconnectOutgoingInterface(state.getXconnectOutgoingInterface()) - .build()); + builder.setInterconnection(new XconnectBasedBuilder() + .setXconnectOutgoingInterface(state.getXconnectOutgoingInterface()) + .build()); } else { BridgeBased state = (BridgeBased) readValue.getInterconnection(); - builder.setInterconnection( - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.l2.config.attributes.interconnection.BridgeBasedBuilder() - .setBridgeDomain(state.getBridgeDomain()) - .setBridgedVirtualInterface(state.isBridgedVirtualInterface()) - .setSplitHorizonGroup(state.getSplitHorizonGroup()) - .build()); + builder.setInterconnection(new BridgeBasedBuilder() + .setBridgeDomain(state.getBridgeDomain()) + .setBridgedVirtualInterface(state.isBridgedVirtualInterface()) + .setSplitHorizonGroup(state.getSplitHorizonGroup()) + .build()); } return Initialized.create(getCfgId(id), builder.setRewrite(readValue.getRewrite()).build()); } - static InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.sub._interface.l2.config.attributes.L2> getCfgId( - final InstanceIdentifier<L2> id) { - return SubInterfaceCustomizer.getCfgId(RWUtils.cutId(id, SubInterface.class)) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.sub._interface.l2.config.attributes.L2.class); + static InstanceIdentifier<L2> getCfgId(final InstanceIdentifier<L2> id) { + return SubInterfaceCustomizer.getCfgId(RWUtils.cutId(id, SubInterface.class)).child(L2.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/TapV2Customizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/TapV2Customizer.java index b7f57bbc1..a1aac896f 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/TapV2Customizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/TapV2Customizer.java @@ -173,9 +173,8 @@ public class TapV2Customizer extends FutureJVppCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.TapV2> init( - @Nonnull final InstanceIdentifier<TapV2> id, @Nonnull final TapV2 readValue, - @Nonnull final ReadContext ctx) { + public Initialized<TapV2> init(@Nonnull final InstanceIdentifier<TapV2> id, @Nonnull final TapV2 readValue, + @Nonnull final ReadContext ctx) { // The MAC address & tag is set from interface details, those details are retrieved from cache final InterfaceKey key = id.firstKeyOf(Interface.class); @@ -187,7 +186,7 @@ public class TapV2Customizer extends FutureJVppCustomizer } return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.TapV2Builder() + new TapV2Builder() .setMac(new PhysAddress(vppPhysAddrToYang(ifcDetails.l2Address))) .setHostInterfaceName(readValue.getHostInterfaceName()) .setTag(ifcDetails.tag[0] == 0 @@ -203,10 +202,9 @@ public class TapV2Customizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.TapV2> getCfgId( - final InstanceIdentifier<TapV2> id) { + private InstanceIdentifier<TapV2> getCfgId(final InstanceIdentifier<TapV2> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.TapV2.class); + .child(TapV2.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VhostUserCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VhostUserCustomizer.java index 835149baf..fb348ce4e 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VhostUserCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VhostUserCustomizer.java @@ -136,10 +136,8 @@ public class VhostUserCustomizer implements InitializingReaderCustomizer<VhostUs } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VhostUser> init( - @Nonnull final InstanceIdentifier<VhostUser> id, - @Nonnull final VhostUser readValue, - @Nonnull final ReadContext ctx) { + public Initialized<VhostUser> init(@Nonnull final InstanceIdentifier<VhostUser> id, + @Nonnull final VhostUser readValue, @Nonnull final ReadContext ctx) { // The tag is set from interface details, those details are retrieved from cache final InterfaceKey key = id.firstKeyOf(Interface.class); final SwInterfaceDetails ifcDetails; @@ -149,7 +147,7 @@ public class VhostUserCustomizer implements InitializingReaderCustomizer<VhostUs throw new IllegalStateException(format("Unable to find VHost interface %s", key.getName()), e); } return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VhostUserBuilder() + new VhostUserBuilder() .setRole(readValue.getRole()) .setSocket(readValue.getSocket()) .setTag(ifcDetails.tag[0] == 0 @@ -158,10 +156,9 @@ public class VhostUserCustomizer implements InitializingReaderCustomizer<VhostUs .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VhostUser> getCfgId( - final InstanceIdentifier<VhostUser> id) { + private InstanceIdentifier<VhostUser> getCfgId(final InstanceIdentifier<VhostUser> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VhostUser.class); + .child(VhostUser.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanCustomizer.java index 3d7f9eb09..09b38784a 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanCustomizer.java @@ -70,8 +70,7 @@ public class VxlanCustomizer extends FutureJVppCustomizer } @Override - public void merge(@Nonnull Builder<? extends DataObject> parentBuilder, - @Nonnull Vxlan readValue) { + public void merge(@Nonnull Builder<? extends DataObject> parentBuilder, @Nonnull Vxlan readValue) { ((VppInterfaceAugmentationBuilder) parentBuilder).setVxlan(readValue); } @@ -142,11 +141,11 @@ public class VxlanCustomizer extends FutureJVppCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Vxlan> init( + public Initialized<Vxlan> init( @Nonnull final InstanceIdentifier<Vxlan> id, @Nonnull final Vxlan readValue, @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VxlanBuilder() + new VxlanBuilder() .setDst(readValue.getDst()) .setSrc(readValue.getSrc()) .setEncapVrfId(readValue.getEncapVrfId()) @@ -155,10 +154,9 @@ public class VxlanCustomizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Vxlan> getCfgId( - final InstanceIdentifier<Vxlan> id) { + private InstanceIdentifier<Vxlan> getCfgId(final InstanceIdentifier<Vxlan> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Vxlan.class); + .child(Vxlan.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanGpeCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanGpeCustomizer.java index d8f135d92..bceab69d0 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanGpeCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/VxlanGpeCustomizer.java @@ -132,11 +132,10 @@ public class VxlanGpeCustomizer extends FutureJVppCustomizer } @Override - public Initialized<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VxlanGpe> init( - @Nonnull final InstanceIdentifier<VxlanGpe> id, @Nonnull final VxlanGpe readValue, - @Nonnull final ReadContext ctx) { + public Initialized<VxlanGpe> init(@Nonnull final InstanceIdentifier<VxlanGpe> id, @Nonnull final VxlanGpe readValue, + @Nonnull final ReadContext ctx) { return Initialized.create(getCfgId(id), - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VxlanGpeBuilder() + new VxlanGpeBuilder() .setLocal(readValue.getLocal()) .setRemote(readValue.getRemote()) .setVni(new VxlanGpeVni(readValue.getVni())) @@ -146,10 +145,10 @@ public class VxlanGpeCustomizer extends FutureJVppCustomizer .build()); } - private InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VxlanGpe> getCfgId( + private InstanceIdentifier<VxlanGpe> getCfgId( final InstanceIdentifier<VxlanGpe> id) { return InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.VxlanGpe.class); + .child(VxlanGpe.class); } } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/InterfaceMirroredInterfacesCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/InterfaceMirroredInterfacesCustomizer.java index d74854b59..fcd96f4d0 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/InterfaceMirroredInterfacesCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/InterfaceMirroredInterfacesCustomizer.java @@ -27,6 +27,7 @@ import java.util.Optional; import java.util.stream.Collectors; import javax.annotation.Nonnull; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.VppInterfaceAugmentation; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Span; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.SpanBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfacesBuilder; @@ -52,22 +53,21 @@ public class InterfaceMirroredInterfacesCustomizer extends AbstractMirroredInter public Initialized<? extends DataObject> init(@Nonnull final InstanceIdentifier<MirroredInterfaces> id, @Nonnull final MirroredInterfaces readValue, @Nonnull final ReadContext ctx) { - final InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces> - cfgId = + final InstanceIdentifier<MirroredInterfaces> cfgId = InterfaceCustomizer.getCfgId(RWUtils.cutId(id, Interface.class)) .augmentation(VppInterfaceAugmentation.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.interfaces._interface.Span.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces.class); - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces - cfgValue = new MirroredInterfacesBuilder() - .setMirroredInterface(Optional.ofNullable(readValue.getMirroredInterface()).orElse(Collections.emptyList()) - .stream() - .map(mirroredInterface -> new MirroredInterfaceBuilder() - .setState(mirroredInterface.getState()) - .withKey(new MirroredInterfaceKey(mirroredInterface.key().getIfaceRef())) - .setIfaceRef(mirroredInterface.getIfaceRef()) - .build()) - .collect(Collectors.toList())) + .child(Span.class) + .child(MirroredInterfaces.class); + final MirroredInterfaces cfgValue = new MirroredInterfacesBuilder() + .setMirroredInterface( + Optional.ofNullable(readValue.getMirroredInterface()).orElse(Collections.emptyList()) + .stream() + .map(mirroredInterface -> new MirroredInterfaceBuilder() + .setState(mirroredInterface.getState()) + .withKey(new MirroredInterfaceKey(mirroredInterface.key().getIfaceRef())) + .setIfaceRef(mirroredInterface.getIfaceRef()) + .build()) + .collect(Collectors.toList())) .build(); return Initialized.create(cfgId, cfgValue); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/SubInterfaceMirroredInterfacesCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/SubInterfaceMirroredInterfacesCustomizer.java index ca44208ba..dedd59027 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/SubInterfaceMirroredInterfacesCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/read/span/SubInterfaceMirroredInterfacesCustomizer.java @@ -32,6 +32,9 @@ import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev190527.interfaces._interface.sub.interfaces.sub._interface.Span; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.subinterface.span.rev190527.interfaces._interface.sub.interfaces.sub._interface.SpanBuilder; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfacesBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder; +import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.mirrored.interfaces.MirroredInterfaceKey; import org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.vpp.vlan.rev190527.interfaces._interface.sub.interfaces.SubInterface; import org.opendaylight.yangtools.concepts.Builder; import org.opendaylight.yangtools.yang.binding.DataObject; @@ -51,23 +54,19 @@ public class SubInterfaceMirroredInterfacesCustomizer extends AbstractMirroredIn public Initialized<? extends DataObject> init(@Nonnull InstanceIdentifier<MirroredInterfaces> id, @Nonnull MirroredInterfaces readValue, @Nonnull ReadContext readContext) { - final InstanceIdentifier<org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces> + final InstanceIdentifier<MirroredInterfaces> cfgId = SubInterfaceCustomizer.getCfgId(RWUtils.cutId(id, SubInterface.class)) .augmentation(VppSubinterfaceSpanAugmentation.class) .child(Span.class) - .child(org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces.class); + .child(MirroredInterfaces.class); - final org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfaces - cfgValue = - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.MirroredInterfacesBuilder() + final MirroredInterfaces cfgValue = new MirroredInterfacesBuilder() .setMirroredInterface( Optional.ofNullable(readValue.getMirroredInterface()).orElse(Collections.emptyList()) .stream() - .map(mirroredInterface -> new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.mirrored.interfaces.MirroredInterfaceBuilder() - .withKey( - new org.opendaylight.yang.gen.v1.http.fd.io.hc2vpp.yang.v3po.rev190527.span.attributes.mirrored.interfaces.MirroredInterfaceKey( - mirroredInterface.key().getIfaceRef())) + .map(mirroredInterface -> new MirroredInterfaceBuilder() + .withKey(new MirroredInterfaceKey(mirroredInterface.key().getIfaceRef())) .setIfaceRef(mirroredInterface.getIfaceRef()) .setState(mirroredInterface.getState()) .build()) |