public static APISubmitLongJobEvent __example__() { APISubmitLongJobEvent event = new APISubmitLongJobEvent(); LongJobInventory inv = new LongJobInventory(); inv.setUuid(uuid()); event.setInventory(inv); event.setNeedAudit(false); return event; } }
public static APIRerunLongJobEvent __example__() { APIRerunLongJobEvent event = new APIRerunLongJobEvent(); LongJobInventory inv = new LongJobInventory(); inv.setUuid(uuid()); event.setInventory(inv); return event; } }
default void resume(LongJobVO job) { job.setJobResult("Failed because management node restarted."); job.setState(LongJobState.Failed); } default Class getAuditType() {
public LongJobInventory(LongJobVO vo) { this.setUuid(vo.getUuid()); this.setName(vo.getName()); this.setState(vo.getState()); this.setApiId(vo.getApiId()); this.setJobData(vo.getJobData()); this.setJobResult(vo.getJobResult()); this.setJobName(vo.getJobName()); this.setCreateDate(vo.getCreateDate()); this.setLastOpDate(vo.getLastOpDate()); this.setExecuteTime(vo.getExecuteTime()); this.setDescription(vo.getDescription()); this.setTargetResourceUuid(vo.getTargetResourceUuid()); this.setManagementNodeUuid(vo.getManagementNodeUuid()); }
public static APISubmitLongJobMsg __example__() { APISubmitLongJobMsg msg = new APISubmitLongJobMsg(); msg.setName("migrate-volume"); msg.setDescription("migrate volume to another Ceph primary storage"); msg.setJobName("APIPrimaryStorageMigrateVolumeMsg"); msg.setJobData("{\"volumeUuid\":\"45a53d3d93384433add8ead7616586cf\", \"dstPrimaryStorageUuid\":\"70a0618804864b3dabe8be9824c8028c\"}"); msg.setTargetResourceUuid("45a53d3d93384433add8ead7616586cf"); return msg; }
public static APIQueryLongJobReply __example__() { APIQueryLongJobReply reply = new APIQueryLongJobReply(); LongJobInventory inv = new LongJobInventory(); inv.setUuid(uuid()); reply.setInventories(Arrays.asList(inv)); return reply; } }
private void handle(APISubmitLongJobMsg msg) { APISubmitLongJobEvent evt = new APISubmitLongJobEvent(msg.getId()); SubmitLongJobMsg smsg = SubmitLongJobMsg.valueOf(msg); bus.makeLocalServiceId(smsg, LongJobConstants.SERVICE_ID); bus.send(smsg, new CloudBusCallBack(msg) { @Override public void run(MessageReply rly) { SubmitLongJobReply reply = rly.castReply(); evt.setInventory(reply.getInventory()); evt.setNeedAudit(reply.isNeedAudit()); bus.publish(evt); } }); }
public static APICancelLongJobMsg __example__() { APICancelLongJobMsg msg = new APICancelLongJobMsg(); msg.setUuid(uuid()); return msg; }
public static APIDeleteLongJobMsg __example__() { APIDeleteLongJobMsg msg = new APIDeleteLongJobMsg(); msg.setUuid(uuid()); return msg; }
public static APICancelLongJobEvent __example__() { APICancelLongJobEvent event = new APICancelLongJobEvent(); event.setSuccess(true); return event; } }
public static APIRerunLongJobMsg __example__() { APIRerunLongJobMsg msg = new APIRerunLongJobMsg(); msg.setUuid(uuid()); return msg; } }
@Override public void after(APIEvent evt) { if (evt.isSuccess()) { String uuid = ((APISubmitLongJobEvent)evt).getInventory().getUuid(); ntfy("Submitted long job[uuid:%s] for %s", uuid, jobName) .resource(uuid, LongJobVO.class.getSimpleName()) .messageAndEvent(that, evt).done(); } } };
public static APICancelLongJobEvent __example__() { APICancelLongJobEvent event = new APICancelLongJobEvent(); return event; } }
@Override public void run(SyncTaskChain chain) { final CancelLongJobReply reply = new CancelLongJobReply(); cancelLongJob(msg.getUuid(), new Completion(chain) { @Override public void success() { bus.reply(msg, reply); chain.next(); } @Override public void fail(ErrorCode errorCode) { reply.setError(errorCode); bus.reply(msg, reply); chain.next(); } }); }
@Override public String getSyncSignature() { return "longjob-" + msg.getUuid(); }
@Override public String getSyncSignature() { return "longjob-" + msg.getUuid(); }
@Override public String getSyncSignature() { return "longjob-" + msg.getUuid(); }
@Override public String getSyncSignature() { return "longjob-" + msg.getJobUuid(); }
public static LongJobInventory valueOf(LongJobVO vo) { return new LongJobInventory(vo); }