import org.opendaylight.genius.mdsalutil.matches.MatchEthernetType;
import org.opendaylight.genius.utils.ServiceIndex;
import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
+import org.opendaylight.netvirt.aclservice.api.AclInterfaceCache;
import org.opendaylight.netvirt.aclservice.api.AclServiceManager.Action;
import org.opendaylight.netvirt.aclservice.api.utils.AclInterface;
import org.opendaylight.netvirt.aclservice.utils.AclConstants;
/**
* Initialize the member variables.
- *
- * @param dataBroker the data broker instance.
- * @param mdsalManager the mdsal manager.
- * @param aclDataUtil
- * the acl data util.
- * @param aclServiceUtils
- * the acl service util.
*/
public AbstractIngressAclServiceImpl(DataBroker dataBroker, IMdsalApiManager mdsalManager, AclDataUtil aclDataUtil,
- AclServiceUtils aclServiceUtils, JobCoordinator jobCoordinator) {
+ AclServiceUtils aclServiceUtils, JobCoordinator jobCoordinator, AclInterfaceCache aclInterfaceCache) {
// Service mode is w.rt. switch
- super(ServiceModeEgress.class, dataBroker, mdsalManager, aclDataUtil, aclServiceUtils, jobCoordinator);
+ super(ServiceModeEgress.class, dataBroker, mdsalManager, aclDataUtil, aclServiceUtils,
+ jobCoordinator, aclInterfaceCache);
}
/**
ServiceIndex.getIndex(NwConstants.EGRESS_ACL_SERVICE_NAME,
NwConstants.EGRESS_ACL_SERVICE_INDEX), ServiceModeEgress.class);
- WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
- writeTxn.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo,
- WriteTransaction.CREATE_MISSING_PARENTS);
-
- return Collections.singletonList(writeTxn.submit());
+ return Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ tx -> tx.put(LogicalDatastoreType.CONFIGURATION, path, serviceInfo,
+ WriteTransaction.CREATE_MISSING_PARENTS)));
});
}
LOG.debug("UnBinding ACL service for interface {}", interfaceName);
jobCoordinator.enqueueJob(interfaceName,
- () -> {
- WriteTransaction writeTxn = dataBroker.newWriteOnlyTransaction();
- writeTxn.delete(LogicalDatastoreType.CONFIGURATION, path);
-
- return Collections.singletonList(writeTxn.submit());
- });
+ () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(
+ tx -> tx.delete(LogicalDatastoreType.CONFIGURATION, path))));
}
/**
new InstructionWriteMetadata(AclServiceUtils.getAclIdMetadata(aclId),
MetaDataUtil.METADATA_MASK_REMOTE_ACL_ID);
instructions.add(writeMetatdata);
- instructions.add(new InstructionGotoTable(getIngressAclFilterTable()));
+ instructions.add(new InstructionGotoTable(getStatefulIngressAclApplyOnExistingTrafficTable()));
Long serviceTag = vpnId != null ? vpnId : elanTag;
String flowNameAdded = "Acl_Filter_Ingress_" + new String(ip.getIpAddress().getValue()) + "_" + serviceTag;
return NwConstants.EGRESS_ACL_REMOTE_ACL_TABLE;
}
+ protected short getStatefulIngressAclApplyOnExistingTrafficTable() {
+ return NwConstants.EGRESS_ACL_STATEFUL_APPLY_CHANGE_EXIST_TRAFFIC_TABLE;
+ }
+
protected abstract String syncSpecificAclFlow(BigInteger dpId, int lportTag, int addOrRemove, Ace ace,
String portId, Map<String, List<MatchInfoBase>> flowMap, String flowName);