@Override @Transactional public void removeApplianceVm(ApplianceVmSpec spec, ApplianceVmVO apvm) { dbf.removeByPrimaryKey(apvm.getUuid(), VirtualRouterVmVO.class); return; } }
private void logOutSession(String sessionUuid) { SessionInventory session = sessions.get(sessionUuid); if (session == null) { SessionVO svo = dbf.findByUuid(sessionUuid, SessionVO.class); session = svo == null ? null : SessionInventory.valueOf(svo); } if (session == null) { return; } sessions.remove(sessionUuid); Session.logout(sessionUuid); dbf.removeByPrimaryKey(sessionUuid, SessionVO.class); }
private void handle(CertificateDeletionMsg msg) { CertificateDeletionReply reply = new CertificateDeletionReply(); dbf.removeByPrimaryKey(msg.getUuid(), CertificateVO.class); bus.reply(msg, reply); }
@Override public void fail(ErrorCode errorCode) { logger.warn(errorCode.toString()); // NOTE: we don't know if the failure happens before or after the VIP deleted on the real device, // for example, a message timeout failure happens after the VIP gets really deleted, but an internal error // may happen before so. In both cases, we delete the database reference here so next time the backend // will try to apply the VIP again. It's virtualrouter/vyos's responsibility to succeed if a VIP is applied // while it exists dbf.removeByPrimaryKey(vrvip.getUuid(), vrvip.getClass()); completion.fail(errorCode); } });
private void deleteVmCdRom(String cdRomUuid, Completion completion) { boolean exist = dbf.isExist(cdRomUuid, VmCdRomVO.class); if (!exist) { completion.success(); return; } dbf.removeByPrimaryKey(cdRomUuid, VmCdRomVO.class); completion.success(); }
@Override public void handle(Map data) { dbf.removeByPrimaryKey(struct.getRule().getUuid(), VirtualRouterPortForwardingRuleRefVO.class); completion.success(); } }).error(new FlowErrorHandler(completion) {
private void handle(SecurityGroupDeletionMsg msg) { SecurityGroupDeletionReply reply = new SecurityGroupDeletionReply(); dbf.removeByPrimaryKey(msg.getUuid(), SecurityGroupVO.class); bus.reply(msg, reply); }
private void handle(APIDeleteLdapBindingMsg msg) { APIDeleteLdapBindingEvent evt = new APIDeleteLdapBindingEvent(msg.getId()); dbf.removeByPrimaryKey(msg.getUuid(), LdapAccountRefVO.class); bus.publish(evt); }
private void handle(APIDeletePolicyMsg msg) { dbf.removeByPrimaryKey(msg.getUuid(), PolicyVO.class); APIDeletePolicyEvent evt = new APIDeletePolicyEvent(msg.getId()); bus.publish(evt); }
private void handle(APIDeleteUserGroupMsg msg) { dbf.removeByPrimaryKey(msg.getUuid(), UserGroupVO.class); APIDeleteUserGroupEvent evt = new APIDeleteUserGroupEvent(msg.getId()); bus.publish(evt); }
private void handle(InstanceOfferingDeletionMsg msg) { deleteHook(); InstanceOfferingDeletionReply reply = new InstanceOfferingDeletionReply(); dbf.removeByPrimaryKey(msg.getInstanceOfferingUuid(), InstanceOfferingVO.class); bus.reply(msg, reply); }
@Override public void success() { logger.debug(String.format("successfully released vip[uuid:%s, name:%s, ip:%s] on virtual router vm[uuid:%s]", self.getUuid(), self.getName(), self.getIp(), vrvo.getUuid())); dbf.removeByPrimaryKey(vrvip.getUuid(), vrvip.getClass()); completion.success(); }
private void handle(L2NetworkDeletionMsg msg) { L2NetworkInventory inv = L2NetworkInventory.valueOf(self); extpEmitter.beforeDelete(inv); deleteHook(); dbf.removeByPrimaryKey(msg.getL2NetworkUuid(), L2NetworkVO.class); extpEmitter.afterDelete(inv); L2NetworkDeletionReply reply = new L2NetworkDeletionReply(); bus.reply(msg, reply); }
protected void initialize() { if (getUuid() == null) { throw new IllegalArgumentException("WorkFlowChain cannot run before WorkFlowChain.build() is called"); } dbf.removeByPrimaryKey(getUuid(), WorkFlowChainVO.class); WorkFlowChainVO cvo = new WorkFlowChainVO(); cvo.setName(getName()); cvo.setOwner(owner); cvo.setUuid(getUuid()); cvo.setState(WorkFlowChainState.Processing); cvo.setCurrentPosition(0); cvo.setTotalWorkFlows(flows.size()); chainvo = dbf.persistAndRefresh(cvo); }
private void handle(L2NetworkDeletionMsg msg) { L2NetworkInventory inv = L2NetworkInventory.valueOf(self); extpEmitter.beforeDelete(inv); deleteHook(); dbf.removeByPrimaryKey(msg.getL2NetworkUuid(), L2NetworkVO.class); extpEmitter.afterDelete(inv); L2NetworkDeletionReply reply = new L2NetworkDeletionReply(); bus.reply(msg, reply); }
private void handle(APIDeleteTagMsg msg) { APIDeleteTagEvent evt = new APIDeleteTagEvent(msg.getId()); SystemTagVO stag = dbf.findByUuid(msg.getUuid(), SystemTagVO.class); if (stag != null) { ErrorCode err = checkPemission(stag.getTag(), msg.getSession()); if (err != null) { evt.setError(err); bus.publish(evt); return; } preTagDeleted(SystemTagInventory.valueOf(stag)); } dbf.removeByPrimaryKey(msg.getUuid(), SystemTagVO.class); dbf.removeByPrimaryKey(msg.getUuid(), UserTagVO.class); dbf.removeByPrimaryKey(msg.getUuid(), TagPatternVO.class); if (stag != null) { fireTagDeleted(list(SystemTagInventory.valueOf(stag))); } bus.publish(evt); }
HostSecurityGroupMembersTO groupMemberTO = cal.returnHostSecurityGroupMember(msg.getUuid()); dbf.removeByPrimaryKey(msg.getUuid(), SecurityGroupVO.class);
@Override public void run(MessageReply reply) { if (reply.isSuccess()) { evt.setInventory(factory.reload(inv.getUuid())); bus.publish(evt); CollectionUtils.safeForEach(pluginRgty.getExtensionList(AddBackupStorageExtensionPoint.class), new ForEachFunction<AddBackupStorageExtensionPoint>() { @Override public void run(AddBackupStorageExtensionPoint ext) { ext.afterAddBackupStorage(addBackupStoragestruct); } }); } else { dbf.removeByPrimaryKey(inv.getUuid(), BackupStorageVO.class); evt.setError(err(SysErrors.CREATE_RESOURCE_ERROR, reply.getError(), reply.getError().getDetails())); bus.publish(evt); } } });
dbf.removeByPrimaryKey(vo.getId(), ImageCacheShadowVO.class); continue;
Long id = query.findValue(); if (id != null) { dbf.removeByPrimaryKey(id, NetworkServiceProviderL2NetworkRefVO.class);