use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.policy.rev170207.policy.profiles.policy.profile.policy.acl.rule.AceRule in project netvirt by opendaylight.
the class PolicyServiceUtil method updateAclRuleForPolicyClassifier.
public void updateAclRuleForPolicyClassifier(String policyClassifier, String aclName, String ruleName, boolean isAdded) {
coordinator.enqueueJob(policyClassifier, () -> {
InstanceIdentifier<AceRule> identifier = getPolicyClassifierAceIdentifier(policyClassifier, aclName, ruleName);
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
if (isAdded) {
tx.merge(LogicalDatastoreType.OPERATIONAL, identifier, new AceRuleBuilder().setRuleName(ruleName).build(), true);
LOG.info("Add ACL {} rule {} to policy classifier {}", aclName, ruleName, policyClassifier);
} else {
tx.delete(LogicalDatastoreType.OPERATIONAL, identifier);
LOG.info("Remove ACL {} rule {} from policy classifier {}", aclName, ruleName, policyClassifier);
}
return Collections.singletonList(tx.submit());
});
}
Aggregations