@Override public void rollback(FlowRollback trigger, Map data) { final ParamOut out = (ParamOut) data.get(ParamOut.class); if (out.getBackupStorageInstallPath() != null) { DeleteBitsOnBackupStorageMsg msg = new DeleteBitsOnBackupStorageMsg(); msg.setInstallPath(out.getBackupStorageInstallPath()); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); bus.send(msg); } trigger.rollback(); } });
@Override public void run(FlowTrigger trigger, Map data) { ParamOut out = (ParamOut) data.get(ParamOut.class); allocatedSize = out.getActualSize(); AllocateBackupStorageMsg amsg = new AllocateBackupStorageMsg(); amsg.setBackupStorageUuid(msg.getBackupStorageUuid()); amsg.setSize(allocatedSize); bus.makeLocalServiceId(amsg, BackupStorageConstant.SERVICE_ID); bus.send(amsg, new CloudBusCallBack(trigger) { @Override public void run(MessageReply reply) { if (reply.isSuccess()) { allocateBackupStorageUuid = msg.getBackupStorageUuid(); paramIn.setBackupStorageUuid(allocateBackupStorageUuid); trigger.next(); } else { trigger.fail(reply.getError()); } } }); }
@Override public void handle(Map data) { ParamOut out = (ParamOut) data.get(ParamOut.class); reply.setActualSize(out.getActualSize()); reply.setSize(out.getSize()); reply.setBackupStorageInstallPath(out.getBackupStorageInstallPath()); reply.setBackupStorageUuid(paramIn.getBackupStorageUuid()); bus.reply(msg, reply); } }).error(new FlowErrorHandler(msg, completion) {
WorkflowTemplate workflowTemplate = ext.createTemplateFromVolumeSnapshot(paramIn); ParamOut paramOut = new ParamOut();
@Override public void rollback(FlowRollback trigger, Map data) { final ParamOut out = (ParamOut) data.get(ParamOut.class); if (out.getBackupStorageInstallPath() != null) { DeleteBitsOnBackupStorageMsg msg = new DeleteBitsOnBackupStorageMsg(); msg.setInstallPath(out.getBackupStorageInstallPath()); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); bus.send(msg); } trigger.rollback(); } });
@Override public void rollback(FlowRollback trigger, Map data) { ParamOut out = (ParamOut) data.get(ParamOut.class); if (out.getBackupStorageInstallPath() != null) { DeleteBitsOnBackupStorageMsg msg = new DeleteBitsOnBackupStorageMsg(); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); msg.setInstallPath(out.getBackupStorageInstallPath()); bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); bus.send(msg); } trigger.rollback(); } });
@Override public void rollback(FlowRollback trigger, Map data) { final ParamOut out = (ParamOut) data.get(ParamOut.class); if (out.getBackupStorageInstallPath() != null) { DeleteBitsOnBackupStorageMsg msg = new DeleteBitsOnBackupStorageMsg(); msg.setInstallPath(out.getBackupStorageInstallPath()); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); bus.send(msg); } trigger.rollback(); } });
@Override public void rollback(FlowRollback trigger, Map data) { final ParamOut out = (ParamOut) data.get(ParamOut.class); if (out.getBackupStorageInstallPath() != null) { DeleteBitsOnBackupStorageMsg msg = new DeleteBitsOnBackupStorageMsg(); msg.setInstallPath(out.getBackupStorageInstallPath()); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); bus.makeTargetServiceIdByResourceUuid(msg, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); bus.send(msg); } trigger.rollback(); } });