/** * Updates and applies the network ACL rule ({@link NetworkACLItemVO}). * We will first try to update the ACL rule in the database using {@link NetworkACLItemDao#update(Long, NetworkACLItemVO)}. If it does not work, a {@link CloudRuntimeException} is thrown. * If we manage to update the ACL rule in the database, we proceed to apply it using {@link #applyNetworkACL(long)}. If this does not work we throw a {@link CloudRuntimeException}. * If all is working we return the {@link NetworkACLItemVO} given as parameter. We wil set the state of the rule to {@link com.cloud.network.vpc.NetworkACLItem.State#Add}. */ @Override public NetworkACLItem updateNetworkACLItem(NetworkACLItemVO networkACLItemVO) throws ResourceUnavailableException { networkACLItemVO.setState(State.Add); if (_networkACLItemDao.update(networkACLItemVO.getId(), networkACLItemVO)) { if (applyNetworkACL(networkACLItemVO.getAclId())) { return networkACLItemVO; } else { throw new CloudRuntimeException("Failed to apply Network ACL rule: " + networkACLItemVO.getUuid()); } } throw new CloudRuntimeException(String.format("Network ACL rule [id=%s] acl rule list [id=%s] could not be updated.", networkACLItemVO.getUuid(), networkACLItemVO.getAclId())); }
aclRulesUuids += rule.getUuid();
aclItem.getNumber(), aclItem.getUuid(), aclItem.getAction().name(), aclItem.getTrafficType().name(), ((aclItem.getSourcePortStart() != null) ?aclItem.getSourcePortStart().toString() :null),