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));
}
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);
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),
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;
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));
}
}