Search in sources :

Example 1 with ResumeProcessResponse

use of com.walmartlabs.concord.server.process.ResumeProcessResponse in project concord by walmartlabs.

the class ProcessCheckpointResource method restore.

@POST
@ApiOperation(value = "Restore process from checkpoint")
@javax.ws.rs.Path("{id}/checkpoint/restore")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
@Validate
public ResumeProcessResponse restore(@ApiParam @PathParam("id") UUID instanceId, @ApiParam @Valid RestoreCheckpointRequest request) {
    UUID checkpointId = request.getId();
    // TODO replace with ProcessKeyCache
    ProcessEntry entry = processManager.assertProcess(instanceId);
    ProcessKey processKey = new ProcessKey(entry.instanceId(), entry.createdAt());
    processManager.restoreFromCheckpoint(processKey, checkpointId);
    return new ResumeProcessResponse();
}
Also used : ProcessEntry(com.walmartlabs.concord.server.process.ProcessEntry) ProcessKey(com.walmartlabs.concord.server.sdk.ProcessKey) UUID(java.util.UUID) ResumeProcessResponse(com.walmartlabs.concord.server.process.ResumeProcessResponse) Validate(org.sonatype.siesta.Validate) WithTimer(com.walmartlabs.concord.server.sdk.metrics.WithTimer) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

ProcessEntry (com.walmartlabs.concord.server.process.ProcessEntry)1 ResumeProcessResponse (com.walmartlabs.concord.server.process.ResumeProcessResponse)1 ProcessKey (com.walmartlabs.concord.server.sdk.ProcessKey)1 WithTimer (com.walmartlabs.concord.server.sdk.metrics.WithTimer)1 ApiOperation (io.swagger.annotations.ApiOperation)1 UUID (java.util.UUID)1 Validate (org.sonatype.siesta.Validate)1