diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2017-03-03 07:36:52 +0100 |
---|---|---|
committer | Jan Srnicek <jsrnicek@cisco.com> | 2017-03-08 09:00:34 +0000 |
commit | 2c28a58160b7693a1ab11d43def37c41a067eff1 (patch) | |
tree | a744af0f4f195727217bc8714862a936d60c6e60 /acl/acl-impl/src/main/java/io/fd | |
parent | f782c704854eac8cb5ffe04ed4addfeae5b2bdfe (diff) |
HC2VPP-91: fix acl ordering
Acl assignment should be added after interface creation
(and removed in reverse order).
Change-Id: Ieb915b8909ce39549e6f8312a92e065d59303e8d
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'acl/acl-impl/src/main/java/io/fd')
4 files changed, 18 insertions, 18 deletions
diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/AclReaderFactory.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/AclReaderFactory.java index 90c4afe83..34352e8f3 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/AclReaderFactory.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/AclReaderFactory.java @@ -56,15 +56,8 @@ public class AclReaderFactory implements ReaderFactory, AclFactory { public void init(@Nonnull final ModifiableReaderRegistryBuilder registry) { registry.addStructuralReader(ACLS_ID, AccessListsBuilder.class); - // TODO(HONEYCOMB-331): initializer is not registered correctly when subtreeAddBefore is used, - // enable after fixing infra issue: - -// registry.subtreeAddBefore(vppAclChildren(InstanceIdentifier.create(Acl.class)), -// new GenericInitListReader<>(ACL_ID, -// new AclCustomizer(futureAclFacade, standardAclContext, macIpAClContext)), -// ImmutableSet.of(ACL_INGRESS_IID, ACL_EGRESS_IID)); - - registry.addBefore(new GenericInitListReader<>(ACL_ID, + registry.subtreeAddBefore(vppAclChildren(InstanceIdentifier.create(Acl.class)), + new GenericInitListReader<>(ACL_ID, new AclCustomizer(futureAclFacade, standardAclContext, macIpAClContext)), ImmutableSet.of(ACL_INGRESS_IID, ACL_EGRESS_IID)); } diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/InterfaceAclReaderFactory.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/InterfaceAclReaderFactory.java index 5b2c45088..173223648 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/InterfaceAclReaderFactory.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/read/factory/InterfaceAclReaderFactory.java @@ -65,7 +65,7 @@ public class InterfaceAclReaderFactory implements ReaderFactory { IFC_ID = InstanceIdentifier.create(InterfacesState.class).child(Interface.class); private static final InstanceIdentifier<VppAclInterfaceStateAugmentation> VPP_ACL_AUG_IID = IFC_ID.augmentation(VppAclInterfaceStateAugmentation.class); - private static final InstanceIdentifier<Acl> ACL_IID = VPP_ACL_AUG_IID.child(Acl.class); + static final InstanceIdentifier<Acl> ACL_IID = VPP_ACL_AUG_IID.child(Acl.class); static final InstanceIdentifier<Ingress> ACL_INGRESS_IID = ACL_IID.child(Ingress.class); static final InstanceIdentifier<Egress> ACL_EGRESS_IID = ACL_IID.child(Egress.class); diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/InterfaceAclWriterFactory.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/InterfaceAclWriterFactory.java index 6598aae9c..12be40a14 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/InterfaceAclWriterFactory.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/InterfaceAclWriterFactory.java @@ -36,21 +36,24 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class InterfaceAclWriterFactory extends AbstractAclWriterFactory implements WriterFactory { - private static final InstanceIdentifier<Acl> ACL_IID = + static final InstanceIdentifier<Acl> ACL_IID = InstanceIdentifier.create(Interfaces.class).child(Interface.class) .augmentation(VppAclInterfaceAugmentation.class).child(Acl.class); + private static final InstanceIdentifier<Interface> IFC_ID = + InstanceIdentifier.create(Interfaces.class).child(Interface.class); + @Override public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { - registry.subtreeAdd(aclHandledChildren(InstanceIdentifier.create(Acl.class)), + registry.subtreeAddAfter(aclHandledChildren(InstanceIdentifier.create(Acl.class)), new GenericWriter<>(ACL_IID, - new InterfaceAclCustomizer(futureAclFacade, interfaceContext, standardAclContext))); + new InterfaceAclCustomizer(futureAclFacade, interfaceContext, standardAclContext)), IFC_ID); - registry.add(new GenericWriter<>(ACL_IID.child(Ingress.class).child(VppMacipAcl.class), - new InterfaceAclMacIpCustomizer(futureAclFacade, macIpAClContext, interfaceContext))); + registry.addAfter(new GenericWriter<>(ACL_IID.child(Ingress.class).child(VppMacipAcl.class), + new InterfaceAclMacIpCustomizer(futureAclFacade, macIpAClContext, interfaceContext)), IFC_ID); } - private Set<InstanceIdentifier<?>> aclHandledChildren(final InstanceIdentifier<Acl> parentId) { + static Set<InstanceIdentifier<?>> aclHandledChildren(final InstanceIdentifier<Acl> parentId) { return ImmutableSet.of(parentId.child(Ingress.class), parentId.child(Ingress.class).child(VppAcls.class), parentId.child(Egress.class), diff --git a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/VppAclWriterFactory.java b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/VppAclWriterFactory.java index bf855ef26..2b95f0b60 100644 --- a/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/VppAclWriterFactory.java +++ b/acl/acl-impl/src/main/java/io/fd/hc2vpp/acl/write/factory/VppAclWriterFactory.java @@ -16,6 +16,9 @@ package io.fd.hc2vpp.acl.write.factory; +import static io.fd.hc2vpp.acl.write.factory.InterfaceAclWriterFactory.ACL_IID; +import static io.fd.hc2vpp.acl.write.factory.InterfaceAclWriterFactory.aclHandledChildren; + import io.fd.hc2vpp.acl.util.factory.AclFactory; import io.fd.hc2vpp.acl.write.VppAclCustomizer; import io.fd.honeycomb.translate.impl.write.GenericListWriter; @@ -32,8 +35,9 @@ public class VppAclWriterFactory extends AbstractAclWriterFactory implements Wri public void init(@Nonnull final ModifiableWriterRegistryBuilder registry) { final InstanceIdentifier<AccessLists> rootNode = InstanceIdentifier.create(AccessLists.class); - registry.subtreeAdd(vppAclChildren(InstanceIdentifier.create(Acl.class)), + registry.subtreeAddBefore(vppAclChildren(InstanceIdentifier.create(Acl.class)), new GenericListWriter<>(rootNode.child(Acl.class), - new VppAclCustomizer(futureAclFacade, standardAclContext, macIpAClContext))); + new VppAclCustomizer(futureAclFacade, standardAclContext, macIpAClContext)), + aclHandledChildren(ACL_IID)); } } |