public static NetworkACL findByNetworkACLId(long aclId) { return s_networkACLDao.findById(aclId); }
@Override public NetworkACL getNetworkACL(final long id) { return _networkACLDao.findById(id); }
if (networkAclId == null) continue; NetworkACLVO networkAcl = _networkACLDao.findById(networkAclId);
@Override @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_UPDATE, eventDescription = "updating network acl", async = true) public NetworkACL updateNetworkACL(UpdateNetworkACLListCmd updateNetworkACLListCmd) { Long id = updateNetworkACLListCmd.getId(); NetworkACLVO acl = _networkACLDao.findById(id); Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId()); Account caller = CallContext.current().getCallingAccount(); _accountMgr.checkAccess(caller, null, true, vpc); String name = updateNetworkACLListCmd.getName(); if (StringUtils.isNotBlank(name)) { acl.setName(name); } String description = updateNetworkACLListCmd.getDescription(); if (StringUtils.isNotBlank(description)) { acl.setDescription(description); } String customId = updateNetworkACLListCmd.getCustomId(); if (StringUtils.isNotBlank(customId)) { acl.setUuid(customId); } Boolean forDisplay = updateNetworkACLListCmd.getDisplay(); if (forDisplay != null) { acl.setDisplay(forDisplay); } _networkACLDao.update(id, acl); return _networkACLDao.findById(id); }
NetworkACLVO acl = _networkACLDao.findById(aclId); NetworkPolicyModel policyModel = _manager.getDatabase().lookupNetworkPolicy(acl.getUuid()); if (policyModel == null) {
NetworkACLVO acl = _networkACLDao.findById(dbNet.getNetworkACLId()); NetworkPolicyModel policyModel = _manager.getDatabase().lookupNetworkPolicy(acl.getUuid()); if (policyModel == null) {
/** * Validates if the data provided to move the ACL rule is supported by this implementation. The user needs to provide a valid ACL UUID, and at least one of the previous or the next ACL rule. * The validation is as follows: * <ul> * <li> If both ACL rules 'previous' and 'next' are invalid, we throw an {@link InvalidParameterValueException}; * <li> informed previous and next ACL rules must have the same ACL ID as the rule being moved; otherwise, an {@link InvalidParameterValueException} is thrown; * <li> then we check if the user trying to move ACL rules has access to the VPC, where the ACL rules are being applied. * </ul> */ protected void validateMoveAclRulesData(NetworkACLItemVO ruleBeingMoved, NetworkACLItemVO previousRule, NetworkACLItemVO nextRule) { if (nextRule == null && previousRule == null) { throw new InvalidParameterValueException("Both previous and next ACL rule IDs cannot be invalid."); } long aclId = ruleBeingMoved.getAclId(); if ((nextRule != null && nextRule.getAclId() != aclId) || (previousRule != null && previousRule.getAclId() != aclId)) { throw new InvalidParameterValueException("Cannot use ACL rules from differenting ACLs. Rule being moved."); } NetworkACLVO acl = _networkACLDao.findById(aclId); Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId()); Account caller = CallContext.current().getCallingAccount(); _accountMgr.checkAccess(caller, null, true, vpc); } }
@Override @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_DELETE, eventDescription = "Deleting Network ACL List", async = true) public boolean deleteNetworkACL(final long id) { final Account caller = CallContext.current().getCallingAccount(); final NetworkACL acl = _networkACLDao.findById(id); if (acl == null) { throw new InvalidParameterValueException("Unable to find specified ACL"); } //Do not allow deletion of default ACLs if (acl.getId() == NetworkACL.DEFAULT_ALLOW || acl.getId() == NetworkACL.DEFAULT_DENY) { throw new InvalidParameterValueException("Default ACL cannot be removed"); } final Vpc vpc = _entityMgr.findById(Vpc.class, acl.getVpcId()); if (vpc == null) { throw new InvalidParameterValueException("Unable to find specified VPC associated with the ACL"); } _accountMgr.checkAccess(caller, null, true, vpc); return _networkAclMgr.deleteNetworkACL(acl); }
NetworkACLVO acl = _networkACLDao.findById(dbn.getNetworkACLId()); NetworkPolicyModel policyModel = _manager.getDatabase().lookupNetworkPolicy(acl.getUuid()); if (policyModel == null) {
final NetworkACL acl = _networkACLDao.findById(aclId); if (acl == null) { throw new InvalidParameterValueException("Unable to find specified NetworkACL");
final NetworkACLVO aclVO = _networkAclDao.findById(aclId); if (aclVO == null) { throw new InvalidParameterValueException("Invalid network acl id passed ");
final NetworkACL acl = _networkACLDao.findById(aclId); if (acl == null) { throw new InvalidParameterValueException("Unable to find specified NetworkACL");
NetworkACL acl = _networkACLDao.findById(aclId); if (acl == null) { throw new InvalidParameterValueException("Unable to find specified NetworkACL");
final NetworkACL acl = _networkACLDao.findById(aclId); if (acl.getVpcId() != 0) { final Vpc vpc = _vpcDao.findById(acl.getVpcId());