@Override public void handle(ErrorCode errCode, Map data) { dbf.remove(vo); evt.setError(errCode); bus.publish(evt); } }).start();
@Override public void handle(Map data) { casf.asyncCascadeFull(CascadeConstant.DELETION_CLEANUP_CODE, issuer, ctx, new NopeCompletion()); bus.publish(evt); } }).error(new FlowErrorHandler(msg) {
@Override public void fail(ErrorCode errorCode) { evt.setError(errorCode); bus.publish(evt); completion.done(); } });
@Override public void fail(ErrorCode errorCode) { evt.setError(err(SftpBackupStorageErrors.RECONNECT_ERROR, errorCode, errorCode.getDetails())); bus.publish(evt); } });
@Override public void handle(ErrorCode errCode, Map data) { evt.setError(err(SysErrors.DELETE_RESOURCE_ERROR, errCode, errCode.getDetails())); bus.publish(evt); } }).start();
@Override public void run(MessageReply reply) { if (!reply.isSuccess()) { evt.setError(reply.getError()); } bus.publish(evt); } });
@Override public void handle(ErrorCode errCode, Map data) { evt.setError(err(SysErrors.DELETE_RESOURCE_ERROR, errCode, errCode.getDetails())); bus.publish(evt); } }).start();
@Override public void fail(ErrorCode errorCode) { evt.setError(err(L2Errors.ATTACH_ERROR, errorCode, errorCode.getDetails())); bus.publish(evt); completion.done(); } });
private void validate(APIDeleteHostMsg msg) { if (!dbf.isExist(msg.getUuid(), HostVO.class)) { APIDeleteHostEvent evt = new APIDeleteHostEvent(msg.getId()); bus.publish(evt); throw new StopRoutingException(); } }
private void handle(APIAddIpv6RangeMsg msg) { IpRangeInventory ipr = IpRangeInventory.fromMessage(msg); ipr = createIpRange(msg, ipr); APIAddIpRangeEvent evt = new APIAddIpRangeEvent(msg.getId()); evt.setInventory(ipr); bus.publish(evt); }
@Override public void success() { APIRebootVmInstanceEvent evt = new APIRebootVmInstanceEvent(msg.getId()); VmInstanceInventory inv = VmInstanceInventory.valueOf(self); evt.setInventory(inv); bus.publish(evt); taskChain.next(); }
private void handle(APIUpdateBackupStorageMsg msg) { BackupStorageVO vo = updateBackupStorage(msg); if (vo != null) { self = dbf.updateAndRefresh(vo); } APIUpdateBackupStorageEvent evt = new APIUpdateBackupStorageEvent(msg.getId()); evt.setInventory(getSelfInventory()); bus.publish(evt); }
private void handle(APICreateUserTagMsg msg) { APICreateUserTagEvent evt = new APICreateUserTagEvent(msg.getId()); UserTagInventory inv = (UserTagInventory) createUserTag(msg.getResourceUuid(), msg.getTag(), msg.getResourceType()); evt.setInventory(inv); bus.publish(evt); }
private void handle(APIDetachRoleFromAccountMsg msg) { SQL.New(RoleAccountRefVO.class).eq(RoleAccountRefVO_.accountUuid, msg.getAccountUuid()) .eq(RoleAccountRefVO_.roleUuid, msg.getRoleUuid()).hardDelete(); APIDetachRoleFromAccountEvent evt = new APIDetachRoleFromAccountEvent(msg.getId()); bus.publish(evt); }
private void handle(APIRemoveMonFromFusionstorBackupStorageMsg msg) { SimpleQuery<FusionstorBackupStorageMonVO> q = dbf.createQuery(FusionstorBackupStorageMonVO.class); q.add(FusionstorBackupStorageMonVO_.hostname, Op.IN, msg.getMonHostnames()); q.add(FusionstorBackupStorageMonVO_.backupStorageUuid, Op.EQ, self.getUuid()); List<FusionstorBackupStorageMonVO> vos = q.list(); if (!vos.isEmpty()) { dbf.removeCollection(vos, FusionstorBackupStorageMonVO.class); } APIRemoveMonFromFusionstorBackupStorageEvent evt = new APIRemoveMonFromFusionstorBackupStorageEvent(msg.getId()); evt.setInventory(FusionstorBackupStorageInventory.valueOf(dbf.reload(getSelf()))); bus.publish(evt); }
private void handle(APIUpdateNotificationsStatusMsg msg) { APIUpdateNotificationsStatusEvent evt = new APIUpdateNotificationsStatusEvent(msg.getId()); SQL.New(NotificationVO.class).set(NotificationVO_.status, NotificationStatus.valueOf(msg.getStatus())) .in(NotificationVO_.uuid, msg.getUuids()).update(); bus.publish(evt); }
private void handle(APISetVmBootModeMsg msg) { SystemTagCreator creator = VmSystemTags.BOOT_MODE.newSystemTagCreator(self.getUuid()); creator.setTagByTokens(map( e(VmSystemTags.BOOT_MODE_TOKEN, msg.getBootMode()) )); creator.recreate = true; creator.create(); APISetVmBootModeEvent evt = new APISetVmBootModeEvent(msg.getId()); bus.publish(evt); }
private void handle(APIRemoveMonFromCephPrimaryStorageMsg msg) { APIRemoveMonFromCephPrimaryStorageEvent evt = new APIRemoveMonFromCephPrimaryStorageEvent(msg.getId()); SimpleQuery<CephPrimaryStorageMonVO> q = dbf.createQuery(CephPrimaryStorageMonVO.class); q.add(CephPrimaryStorageMonVO_.hostname, Op.IN, msg.getMonHostnames()); List<CephPrimaryStorageMonVO> vos = q.list(); dbf.removeCollection(vos, CephPrimaryStorageMonVO.class); evt.setInventory(CephPrimaryStorageInventory.valueOf(dbf.reload(getSelf()))); bus.publish(evt); }
private void handle(APIRemoveMonFromFusionstorPrimaryStorageMsg msg) { APIRemoveMonFromFusionstorPrimaryStorageEvent evt = new APIRemoveMonFromFusionstorPrimaryStorageEvent(msg.getId()); SimpleQuery<FusionstorPrimaryStorageMonVO> q = dbf.createQuery(FusionstorPrimaryStorageMonVO.class); q.add(FusionstorPrimaryStorageMonVO_.hostname, Op.IN, msg.getMonHostnames()); List<FusionstorPrimaryStorageMonVO> vos = q.list(); dbf.removeCollection(vos, FusionstorPrimaryStorageMonVO.class); evt.setInventory(FusionstorPrimaryStorageInventory.valueOf(dbf.reload(getSelf()))); bus.publish(evt); }
private void handle(APIChangeEipStateMsg msg) { EipVO eip = dbf.findByUuid(msg.getUuid(), EipVO.class); eip.setState(eip.getState().nextState(EipStateEvent.valueOf(msg.getStateEvent()))); eip = dbf.updateAndRefresh(eip); APIChangeEipStateEvent evt = new APIChangeEipStateEvent(msg.getId()); evt.setInventory(EipInventory.valueOf(eip)); bus.publish(evt); }