use of edu.harvard.iq.dataverse.workflow.PendingWorkflowInvocation in project dataverse by IQSS.
the class Workflows method resumeWorkflow.
@Path("{invocationId}")
@POST
public Response resumeWorkflow(@PathParam("invocationId") String invocationId, String body) {
PendingWorkflowInvocation pending = workflows.getPendingWorkflow(invocationId);
String remoteAddrStr = httpRequest.getRemoteAddr();
IpAddress remoteAddr = IpAddress.valueOf((remoteAddrStr != null) ? remoteAddrStr : "0.0.0.0");
if (!isAllowed(remoteAddr)) {
return unauthorized("Sorry, your IP address is not authorized to send resume requests. Please contact an admin.");
}
Logger.getLogger(Workflows.class.getName()).log(Level.INFO, "Resume request from: {0}", httpRequest.getRemoteAddr());
if (pending == null) {
return notFound("Cannot find workflow invocation with id " + invocationId);
}
workflows.resume(pending, body);
return Response.accepted("/api/datasets/" + pending.getDataset().getId()).build();
}
Aggregations