summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java
diff options
context:
space:
mode:
authorTibor Král <tibor.kral@pantheon.tech>2019-05-14 12:19:44 +0200
committerMichal Cmarada <mcmarada@cisco.com>2019-05-27 08:25:05 +0200
commit5c416ebacf4baad25de6213661c3cdfff31c0482 (patch)
treed2fe4889f01e4adbdeb50ea83b47aa44102a5f49 /v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java
parent83206cb1b6b0a6a3bbe45d646ed69a5f2b587fed (diff)
HC2VPP-381: Validation support for V3PO module
Change-Id: If288d97dce15bcc6924d4dd65c640a20920f094d Signed-off-by: Tibor Král <tibor.kral@pantheon.tech>
Diffstat (limited to 'v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java')
-rw-r--r--v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java62
1 files changed, 36 insertions, 26 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java
index cdcd07000..237eab57a 100644
--- a/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java
+++ b/v3po/v3po2vpp/src/main/java/io/fd/hc2vpp/v3po/factory/SubinterfaceAugmentationWriterFactory.java
@@ -21,10 +21,15 @@ import com.google.inject.Inject;
import com.google.inject.name.Named;
import io.fd.hc2vpp.common.translate.util.NamingContext;
import io.fd.hc2vpp.v3po.interfaces.RewriteCustomizer;
+import io.fd.hc2vpp.v3po.interfaces.RewriteValidator;
import io.fd.hc2vpp.v3po.interfaces.SubInterfaceCustomizer;
import io.fd.hc2vpp.v3po.interfaces.SubInterfaceL2Customizer;
+import io.fd.hc2vpp.v3po.interfaces.SubInterfaceL2Validator;
import io.fd.hc2vpp.v3po.interfaces.SubInterfaceRoutingCustomizer;
+import io.fd.hc2vpp.v3po.interfaces.SubInterfaceRoutingValidator;
import io.fd.hc2vpp.v3po.interfaces.SubInterfaceUnnumberedCustomizer;
+import io.fd.hc2vpp.v3po.interfaces.SubInterfaceUnnumberedValidator;
+import io.fd.hc2vpp.v3po.interfaces.SubInterfaceValidator;
import io.fd.hc2vpp.v3po.interfaces.span.MirroredInterfaceCustomizer;
import io.fd.hc2vpp.v3po.util.SubInterfaceUtils;
import io.fd.honeycomb.translate.impl.write.GenericListWriter;
@@ -59,11 +64,11 @@ public final class SubinterfaceAugmentationWriterFactory implements WriterFactor
private final NamingContext bdContext;
public static final InstanceIdentifier<SubinterfaceAugmentation> SUB_IFC_AUG_ID =
- InterfacesWriterFactory.IFC_ID.augmentation(SubinterfaceAugmentation.class);
+ InterfacesWriterFactory.IFC_ID.augmentation(SubinterfaceAugmentation.class);
public static final InstanceIdentifier<SubInterface> SUB_IFC_ID =
- SUB_IFC_AUG_ID.child(SubInterfaces.class).child(SubInterface.class);
+ SUB_IFC_AUG_ID.child(SubInterfaces.class).child(SubInterface.class);
public static final InstanceIdentifier<L2> L2_ID = SUB_IFC_ID.child(
- L2.class);
+ L2.class);
@Inject
public SubinterfaceAugmentationWriterFactory(final FutureJVppCore jvpp,
@@ -79,31 +84,35 @@ public final class SubinterfaceAugmentationWriterFactory implements WriterFactor
// Subinterfaces
// Subinterface(Handle only after all interface related stuff gets processed) =
registry.subtreeAddAfter(
- // TODO HONEYCOMB-188 this customizer covers quite a lot of complex child nodes (maybe refactor ?)
- Sets.newHashSet(
- InstanceIdentifier.create(SubInterface.class).child(Tags.class),
- InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class),
- InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(
- Dot1qTag.class),
- InstanceIdentifier.create(SubInterface.class).child(Match.class),
- InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)),
- new GenericListWriter<>(SUB_IFC_ID, new SubInterfaceCustomizer(jvpp, ifcContext)),
- InterfacesWriterFactory.IFC_ID);
+ // TODO HONEYCOMB-188 this customizer covers quite a lot of complex child nodes (maybe refactor ?)
+ Sets.newHashSet(
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class),
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class),
+ InstanceIdentifier.create(SubInterface.class).child(Tags.class).child(Tag.class).child(
+ Dot1qTag.class),
+ InstanceIdentifier.create(SubInterface.class).child(Match.class),
+ InstanceIdentifier.create(SubInterface.class).child(Match.class).child(VlanTagged.class)),
+ new GenericListWriter<>(SUB_IFC_ID, new SubInterfaceCustomizer(jvpp, ifcContext),
+ new SubInterfaceValidator(ifcContext)),
+ InterfacesWriterFactory.IFC_ID);
// L2 =
- registry.addAfter(new GenericWriter<>(L2_ID, new SubInterfaceL2Customizer(jvpp, ifcContext, bdContext)),
- SUB_IFC_ID);
+ registry.addAfter(new GenericWriter<>(L2_ID, new SubInterfaceL2Customizer(jvpp, ifcContext, bdContext),
+ new SubInterfaceL2Validator(ifcContext, bdContext)),
+ SUB_IFC_ID);
// Rewrite(also handles pushTags + pushTags/dot1qtag) =
final InstanceIdentifier<Rewrite> rewriteId = L2_ID.child(Rewrite.class);
registry.subtreeAddAfter(
- Sets.newHashSet(
- InstanceIdentifier.create(Rewrite.class).child(PushTags.class),
- InstanceIdentifier.create(Rewrite.class).child(PushTags.class)
- .child(
- org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)),
- new GenericWriter<>(rewriteId, new RewriteCustomizer(jvpp, ifcContext)),
- L2_ID);
+ Sets.newHashSet(
+ InstanceIdentifier.create(Rewrite.class).child(PushTags.class),
+ InstanceIdentifier.create(Rewrite.class).child(PushTags.class)
+ .child(
+ org.opendaylight.yang.gen.v1.urn.ieee.params.xml.ns.yang.dot1q.types.rev150626.dot1q.tag.Dot1qTag.class)),
+ new GenericWriter<>(rewriteId, new RewriteCustomizer(jvpp, ifcContext),
+ new RewriteValidator(ifcContext)),
+ L2_ID);
final InstanceIdentifier<Routing> routingId = SUB_IFC_ID.child(Routing.class);
- registry.add(new GenericWriter<>(routingId, new SubInterfaceRoutingCustomizer(jvpp, ifcContext)));
+ registry.add(new GenericWriter<>(routingId, new SubInterfaceRoutingCustomizer(jvpp, ifcContext),
+ new SubInterfaceRoutingValidator(ifcContext)));
final InstanceIdentifier<MirroredInterface> mirroredId =
SUB_IFC_ID.augmentation(VppSubinterfaceSpanAugmentation.class)
@@ -116,8 +125,9 @@ public final class SubinterfaceAugmentationWriterFactory implements WriterFactor
// Unnumbered =
final InstanceIdentifier<Unnumbered> unnumberedId =
- SUB_IFC_ID.augmentation(SubinterfaceUnnumberedAugmentation.class).child(Unnumbered.class);
- registry.addAfter(new GenericWriter<>(unnumberedId, new SubInterfaceUnnumberedCustomizer(jvpp, ifcContext)),
- SUB_IFC_ID);
+ SUB_IFC_ID.augmentation(SubinterfaceUnnumberedAugmentation.class).child(Unnumbered.class);
+ registry.addAfter(new GenericWriter<>(unnumberedId, new SubInterfaceUnnumberedCustomizer(jvpp, ifcContext),
+ new SubInterfaceUnnumberedValidator(ifcContext)),
+ SUB_IFC_ID);
}
}