From 4dce3cd25ec520ce51da1ed34e5b439eea19232d Mon Sep 17 00:00:00 2001 From: Michal Cmarada Date: Wed, 29 May 2019 15:15:14 +0200 Subject: cleanup v3po customizers - remove unnecessary full paths - reformat Change-Id: If918be3de8b4839cd3a50d73d9de7c3e0b32ab3d Signed-off-by: Michal Cmarada --- .../io/fd/hc2vpp/v3po/read/AfPacketCustomizer.java | 17 ++++------ .../java/io/fd/hc2vpp/v3po/read/GreCustomizer.java | 11 +++---- .../fd/hc2vpp/v3po/read/InterfaceCustomizer.java | 13 +++----- .../v3po/read/InterfaceRoutingCustomizer.java | 21 +++++-------- .../java/io/fd/hc2vpp/v3po/read/L2Customizer.java | 18 ++++------- .../hc2vpp/v3po/read/SubInterfaceCustomizer.java | 11 +++---- .../hc2vpp/v3po/read/SubInterfaceL2Customizer.java | 36 +++++++++------------- .../io/fd/hc2vpp/v3po/read/TapV2Customizer.java | 12 +++----- .../fd/hc2vpp/v3po/read/VhostUserCustomizer.java | 13 +++----- .../io/fd/hc2vpp/v3po/read/VxlanCustomizer.java | 12 +++----- .../io/fd/hc2vpp/v3po/read/VxlanGpeCustomizer.java | 11 +++---- .../InterfaceMirroredInterfacesCustomizer.java | 28 ++++++++--------- .../SubInterfaceMirroredInterfacesCustomizer.java | 17 +++++----- 13 files changed, 91 insertions(+), 129 deletions(-) (limited to 'v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po') 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 init( - @Nonnull final InstanceIdentifier 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 init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + static InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier id, @Nonnull final Gre readValue, @Nonnull final ReadContext ctx) { + public Initialized init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( + public Initialized init( @Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier 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 getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier 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 init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier 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 init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( + public Initialized init( @Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + public static InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier id, - @Nonnull final L2 readValue, - @Nonnull final ReadContext ctx) { + public Initialized init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier 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 getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier id, @Nonnull final TapV2 readValue, - @Nonnull final ReadContext ctx) { + public Initialized init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier id, - @Nonnull final VhostUser readValue, - @Nonnull final ReadContext ctx) { + public Initialized init(@Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 parentBuilder, - @Nonnull Vxlan readValue) { + public void merge(@Nonnull Builder parentBuilder, @Nonnull Vxlan readValue) { ((VppInterfaceAugmentationBuilder) parentBuilder).setVxlan(readValue); } @@ -142,11 +141,11 @@ public class VxlanCustomizer extends FutureJVppCustomizer } @Override - public Initialized init( + public Initialized init( @Nonnull final InstanceIdentifier 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 getCfgId( - final InstanceIdentifier id) { + private InstanceIdentifier getCfgId(final InstanceIdentifier 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 init( - @Nonnull final InstanceIdentifier id, @Nonnull final VxlanGpe readValue, - @Nonnull final ReadContext ctx) { + public Initialized init(@Nonnull final InstanceIdentifier 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 getCfgId( + private InstanceIdentifier getCfgId( final InstanceIdentifier 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 init(@Nonnull final InstanceIdentifier id, @Nonnull final MirroredInterfaces readValue, @Nonnull final ReadContext ctx) { - final InstanceIdentifier - cfgId = + final InstanceIdentifier 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 init(@Nonnull InstanceIdentifier id, @Nonnull MirroredInterfaces readValue, @Nonnull ReadContext readContext) { - final InstanceIdentifier + final InstanceIdentifier 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()) -- cgit 1.2.3-korg