use of io.narayana.lra.participant.model.Activity in project narayana by jbosstm.
the class ActivityController method complete.
/**
* Performing a PUT on <participant URL>/complete will cause the participant to tidy up and it can forget this transaction.
*
* The participant will either return a 200 OK code and a <status URL> which indicates the outcome and which can be probed (via GET)
* and will simply return the same (implicit) information:
* <URL>/cannot-compensate
* <URL>/cannot-complete
*/
@PUT
@Path("/{TxId}/complete")
@Produces(MediaType.APPLICATION_JSON)
public Response complete(@PathParam("TxId") String txId) throws NotFoundException {
Activity activity = activityService.getActivity(txId);
activity.status = CompensatorStatus.Completed;
activity.statusUrl = String.format("%s/%s/activity/completed", context.getBaseUri(), txId);
return Response.ok(activity.statusUrl).build();
}
Aggregations