import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.groupbasedpolicy.renderer.vpp.policy.acl.AccessListUtil.ACE_DIRECTION;
import org.opendaylight.groupbasedpolicy.renderer.vpp.util.GbpNetconfTransaction;
+import org.opendaylight.groupbasedpolicy.renderer.vpp.util.VppIidFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.acl.rev161214.VppAclInterfaceAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.acl.rev161214._interface.acl.attributes.Acl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.acl.rev161214._interface.acl.attributes.acl.Ingress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.acl.rev161214._interface.acl.attributes.acl.IngressBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang._interface.acl.rev161214.vpp.acls.base.attributes.VppAcls;
@Override
public void writeAclRefOnIface(@Nonnull DataBroker mountPoint, @Nonnull InstanceIdentifier<Interface> ifaceIid) {
- InstanceIdentifier<Ingress> ingressRefIid = outboundIfaceAclRefIid(ifaceIid);
+ InstanceIdentifier<Ingress> ingressRefIid = VppIidFactory.getAclInterfaceRef(ifaceIid).child(Ingress.class);
VppAcls vppAcl = new VppAclsBuilder().setName(resolveAclName(ifaceIid.firstKeyOf(Interface.class)))
.setType(VppAcl.class)
.build();
Ingress egressAcl = new IngressBuilder().setVppAcls(ImmutableList.<VppAcls>of(vppAcl)).build();
GbpNetconfTransaction.netconfSyncedWrite(mountPoint, ingressRefIid, egressAcl,
- GbpNetconfTransaction.RETRY_COUNT);
- }
-
- private InstanceIdentifier<Ingress> outboundIfaceAclRefIid(InstanceIdentifier<Interface> ifaceIid) {
- return ifaceIid.builder()
- .augmentation(VppAclInterfaceAugmentation.class)
- .child(Acl.class)
- .child(Ingress.class)
- .build();
+ GbpNetconfTransaction.RETRY_COUNT);
}
}