Fixed ordering of network ACL rules being sent to the VR. The comparator was inverted

This commit is contained in:
Patrick Dube 2016-06-02 13:15:38 -04:00
parent 9275ba27f3
commit caf4a48075
1 changed files with 11 additions and 6 deletions

View File

@ -45,12 +45,8 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
public String[][] generateFwRules() {
final List<NetworkACLTO> aclList = Arrays.asList(rules);
Collections.sort(aclList, new Comparator<NetworkACLTO>() {
@Override
public int compare(final NetworkACLTO acl1, final NetworkACLTO acl2) {
return acl1.getNumber() < acl2.getNumber() ? 1 : -1;
}
});
orderNetworkAclRulesByRuleNumber(aclList);
final String[][] result = new String[2][aclList.size()];
int i = 0;
@ -97,6 +93,15 @@ public class SetNetworkACLCommand extends NetworkElementCommand {
return result;
}
protected void orderNetworkAclRulesByRuleNumber(List<NetworkACLTO> aclList) {
Collections.sort(aclList, new Comparator<NetworkACLTO>() {
@Override
public int compare(final NetworkACLTO acl1, final NetworkACLTO acl2) {
return acl1.getNumber() > acl2.getNumber() ? 1 : -1;
}
});
}
public NicTO getNic() {
return nic;
}