if (aclTag != null) {
this.aclDataUtil.removeAclTag(aclName);
}
- updateRemoteAclCache(acl.getAccessListEntries().getAce(), aclName, AclServiceManager.Action.REMOVE);
+
+ updateRemoteAclCache(AclServiceUtils.getAceListFromAcl(acl), aclName, AclServiceManager.Action.REMOVE);
if (aclClusterUtil.isEntityOwner()) {
if (aclTag != null) {
this.aclServiceUtils.releaseAclTag(aclName);
this.aclDataUtil.addAclTag(aclName, aclTag);
}
- updateRemoteAclCache(acl.getAccessListEntries().getAce(), aclName, AclServiceManager.Action.ADD);
+ updateRemoteAclCache(AclServiceUtils.getAceListFromAcl(acl), aclName, AclServiceManager.Action.ADD);
}
/**
* @param action the action
*/
private void updateRemoteAclCache(@Nullable List<Ace> aceList, String aclName, AclServiceManager.Action action) {
- if (null == aceList) {
- return;
- }
for (Ace ace : aceList) {
SecurityRuleAttr aceAttributes = ace.augmentation(SecurityRuleAttr.class);
if (AclServiceUtils.doesAceHaveRemoteGroupId(aceAttributes)) {
return flowMatches;
}
+ public static List<Ace> getAceListFromAcl(Acl acl) {
+ if (acl.getAccessListEntries() != null) {
+ List<Ace> aceList = acl.getAccessListEntries().getAce();
+ if (aceList != null && !aceList.isEmpty()
+ && aceList.get(0).augmentation(SecurityRuleAttr.class) != null) {
+ return aceList;
+ }
+ }
+ return Collections.emptyList();
+ }
+
/**
* Builds the ip protocol matches.
*