use of com.walmartlabs.concord.server.sdk.metrics.WithTimer in project concord by walmartlabs.
the class ProcessResource method get.
/**
* Returns a process instance details.
*
* @deprecated use {@link ProcessResourceV2#get(UUID, Set)}
*/
@GET
@ApiOperation("Get a process' details")
@javax.ws.rs.Path("/{id}")
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
@Deprecated
public ProcessEntry get(@ApiParam @PathParam("id") UUID instanceId) {
PartialProcessKey processKey = PartialProcessKey.from(instanceId);
ProcessEntry e = processQueueManager.get(processKey);
if (e == null) {
log.warn("get ['{}'] -> not found", instanceId);
throw new ConcordApplicationException("Process instance not found", Status.NOT_FOUND);
}
return e;
}
use of com.walmartlabs.concord.server.sdk.metrics.WithTimer in project concord by walmartlabs.
the class ProcessResource method updateStatus.
/**
* Updates a process' status
*
* @param instanceId
* @param status
*/
@POST
@ApiOperation("Update process status")
@javax.ws.rs.Path("{id}/status")
@Consumes(MediaType.TEXT_PLAIN)
@WithTimer
public void updateStatus(@ApiParam @PathParam("id") UUID instanceId, @ApiParam(required = true) @QueryParam("agentId") String agentId, @ApiParam(required = true) ProcessStatus status) {
ProcessKey processKey = assertProcessKey(instanceId);
processManager.updateStatus(processKey, agentId, status);
}
use of com.walmartlabs.concord.server.sdk.metrics.WithTimer 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();
}
use of com.walmartlabs.concord.server.sdk.metrics.WithTimer in project concord by walmartlabs.
the class ProcessCheckpointResource method list.
@GET
@ApiOperation(value = "List the process checkpoints", responseContainer = "list", response = ProcessCheckpointEntry.class)
@javax.ws.rs.Path("{id}/checkpoint")
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
public List<ProcessCheckpointEntry> list(@ApiParam @PathParam("id") UUID instanceId) {
ProcessEntry entry = processManager.assertProcess(instanceId);
ProcessKey processKey = new ProcessKey(entry.instanceId(), entry.createdAt());
checkpointManager.assertProcessAccess(entry);
return checkpointManager.list(processKey);
}
use of com.walmartlabs.concord.server.sdk.metrics.WithTimer in project concord by walmartlabs.
the class ProcessEventResource method list.
/**
* List process events.
*/
@GET
@ApiOperation(value = "List process events", responseContainer = "list", response = ProcessEventEntry.class)
@Path("/{processInstanceId}/event")
@Produces(MediaType.APPLICATION_JSON)
@WithTimer
public List<ProcessEventEntry> list(@ApiParam @PathParam("processInstanceId") UUID processInstanceId, @ApiParam @QueryParam("type") String eventType, @ApiParam @QueryParam("after") OffsetDateTimeParam after, @ApiParam @QueryParam("fromId") Long fromId, @ApiParam @QueryParam("eventCorrelationId") UUID eventCorrelationId, @ApiParam @QueryParam("eventPhase") EventPhase eventPhase, @ApiParam @QueryParam("includeAll") @DefaultValue("false") boolean includeAll, @ApiParam @QueryParam("limit") @DefaultValue("-1") int limit) {
ProcessKey processKey = assertProcessKey(processInstanceId);
if (includeAll) {
// verify that the user can access potentially sensitive data
assertAccessRights(processKey);
}
ProcessEventFilter f = ProcessEventFilter.builder().processKey(processKey).after(unwrap(after)).eventType(eventType).eventCorrelationId(eventCorrelationId).eventPhase(eventPhase).limit(limit).fromId(fromId).build();
List<ProcessEventEntry> l = eventManager.list(f);
if (!includeAll) {
l = filterOutSensitiveData(l);
}
return l;
}
Aggregations