@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); FirewallRuleVO entry = findById(id); if (entry != null) { if (entry.getPurpose() == Purpose.LoadBalancing) { _tagsDao.removeByIdAndType(id, ResourceObjectType.LoadBalancer); } else if (entry.getPurpose() == Purpose.PortForwarding) { _tagsDao.removeByIdAndType(id, ResourceObjectType.PortForwardingRule); } else if (entry.getPurpose() == Purpose.Firewall) { _tagsDao.removeByIdAndType(id, ResourceObjectType.FirewallRule); } else if (entry.getPurpose() == Purpose.NetworkACL) { _tagsDao.removeByIdAndType(id, ResourceObjectType.NetworkACL); } } boolean result = super.remove(id); txn.commit(); return result; }
@Override public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); _tagsDao.removeByIdAndType(id, ResourceObjectType.UserVm); boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); VMTemplateVO template = createForUpdate(); template.setRemoved(new Date()); VMTemplateVO vo = findById(id); if (vo != null) { if (vo.getFormat() == ImageFormat.ISO) { _tagsDao.removeByIdAndType(id, ResourceObjectType.ISO); } else { _tagsDao.removeByIdAndType(id, ResourceObjectType.Template); } } boolean result = update(id, template); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); StaticRouteVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.StaticRoute); } boolean result = super.remove(id); txn.commit(); return result; } }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); SecurityGroupVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(final Long id) { final TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); final NetworkVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.Network); } final boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); IPAddressVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); SnapshotVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.Snapshot); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); VolumeVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.Volume); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); VpcVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.Vpc); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @DB public boolean expunge(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); SecurityGroupVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroup); } boolean result = super.expunge(id); txn.commit(); return result; } }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); SecurityGroupRuleVO entry = findById(id); if (entry != null) { _tagsDao.removeByIdAndType(id, ResourceObjectType.SecurityGroupRule); } boolean result = super.remove(id); txn.commit(); return result; } }
@Override @DB public boolean remove(Long projectId) { boolean result = false; TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); ProjectVO projectToRemove = findById(projectId); projectToRemove.setName(null); if (!update(projectId, projectToRemove)) { s_logger.warn("Failed to reset name for the project id=" + projectId + " as a part of project remove"); return false; } _tagsDao.removeByIdAndType(projectId, ResourceObjectType.Project); result = super.remove(projectId); txn.commit(); return result; }
@Override @DB public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); VMInstanceVO vm = findById(id); if (vm != null && vm.getType() == Type.User) { _tagsDao.removeByIdAndType(id, ResourceObjectType.UserVm); } boolean result = super.remove(id); txn.commit(); return result; }
@Override @ActionEvent(eventType = EventTypes.EVENT_VPC_DELETE, eventDescription = "deleting VPC") public boolean deleteVpc(final long vpcId) throws ConcurrentOperationException, ResourceUnavailableException { CallContext.current().setEventDetails(" Id: " + vpcId); final CallContext ctx = CallContext.current(); // Verify vpc id final Vpc vpc = _vpcDao.findById(vpcId); if (vpc == null) { throw new InvalidParameterValueException("unable to find VPC id=" + vpcId); } // verify permissions _accountMgr.checkAccess(ctx.getCallingAccount(), null, false, vpc); _resourceTagDao.removeByIdAndType(vpcId, ResourceObjectType.Vpc); return destroyVpc(vpc, ctx.getCallingAccount(), ctx.getCallingUserId()); }