java.lang.Object
org.eclipse.microprofile.lra.tck.participant.api.ResourceParent
org.eclipse.microprofile.lra.tck.participant.api.LraResource

@ApplicationScoped @Path("lraresource") public class LraResource extends ResourceParent
  • Field Details

  • Constructor Details

    • LraResource

      public LraResource()
  • Method Details

    • status

      @GET @Path("/status") @Produces("application/json") public jakarta.ws.rs.core.Response status(@HeaderParam("Long-Running-Action") URI lraId, @HeaderParam("Long-Running-Action-Recovery") URI recoveryId)
      Performing a GET on the participant URL will return the current status of the participant ParticipantStatus, or 410 if the participant does no longer know about this LRA.
      Parameters:
      lraId - the id of the LRA
      recoveryId - the recovery id of this enlistment
      Returns:
      the status of the LRA
    • leaveWork

      @PUT @Path("/leave") @Produces("application/json") public jakarta.ws.rs.core.Response leaveWork(@HeaderParam("Long-Running-Action") URI lraId)
    • completeWork

      @PUT @Path("/complete") @Produces("application/json") public jakarta.ws.rs.core.Response completeWork(@HeaderParam("Long-Running-Action") URI lraId, @HeaderParam("Long-Running-Action-Recovery") URI recoveryId)
    • compensateWork

      @PUT @Path("/compensate") @Produces("application/json") public jakarta.ws.rs.core.Response compensateWork(@HeaderParam("Long-Running-Action") URI lraId, @HeaderParam("Long-Running-Action-Recovery") URI recoveryId)
    • forgetWork

      @DELETE @Path("/forget") @Produces("application/json") public jakarta.ws.rs.core.Response forgetWork(@HeaderParam("Long-Running-Action") URI lraId, @HeaderParam("Long-Running-Action-Recovery") URI recoveryId)
    • acceptWork

      @PUT @Path("acceptWork") public jakarta.ws.rs.core.Response acceptWork(@HeaderParam("Long-Running-Action-Recovery") URI recoveryId, @HeaderParam("Long-Running-Action") URI lraId)
    • supportsLRACall

      @PUT @Path("/supports") public jakarta.ws.rs.core.Response supportsLRACall(@HeaderParam("Long-Running-Action") URI lraId)
    • subActivity

      @PUT @Path("/startViaApi") public jakarta.ws.rs.core.Response subActivity(@HeaderParam("Long-Running-Action") URI lraId)
    • activityWithLRA

      @PUT @Path("work") public jakarta.ws.rs.core.Response activityWithLRA(@HeaderParam("Long-Running-Action-Recovery") URI recoveryId, @HeaderParam("Long-Running-Action") URI lraId)
    • activityWithMandatoryLRA

      @PUT @Path("/mandatory") @Produces("text/plain") public jakarta.ws.rs.core.Response activityWithMandatoryLRA(@HeaderParam("Long-Running-Action-Recovery") URI recoveryId, @HeaderParam("Long-Running-Action") URI lraId)
    • nestedActivity

      @PUT @Path("/nestedActivity") public jakarta.ws.rs.core.Response nestedActivity(@HeaderParam("Long-Running-Action-Recovery") URI recoveryId, @HeaderParam("Long-Running-Action") URI nestedLRAId)
    • cancelLRA

      @PUT @Path("/cancel") public jakarta.ws.rs.core.Response cancelLRA(@HeaderParam("Long-Running-Action") URI lraId)
      Used to close nested LRA in which this resource is enlisted
      Parameters:
      lraId - the id of the LRA
      Returns:
      the JAX-RS response indicating that LRA should be cancelled
      See Also:
    • multiLevelNestedActivity

      @PUT @Path("/multiLevelNestedActivity") public jakarta.ws.rs.core.Response multiLevelNestedActivity(@HeaderParam("Long-Running-Action-Recovery") URI recoveryId, @HeaderParam("Long-Running-Action") URI nestedLRAId, @QueryParam("nestedCnt") @DefaultValue("1") Integer nestedCnt)
    • findAll

      @GET @Produces("application/json") public jakarta.ws.rs.core.Response findAll()
    • timeLimit

      @GET @Path("/timeLimit") @Produces("application/json") public jakarta.ws.rs.core.Response timeLimit(@HeaderParam("Long-Running-Action") URI lraId)
    • timeLimitTest2

      @GET @Path("/timeLimit2") @Produces("application/json") public jakarta.ws.rs.core.Response timeLimitTest2(@HeaderParam("Long-Running-Action") URI lraId)
      Starts an LRA with the time limit and verifies that after the timelimit is passed the LRA is finished by the invocation to a mandatory LRA endpoint (which should fail with 412)
      Parameters:
      lraId - the id of the LRA
      Returns:
      the JAX-RS response 200 if successful or the received HTTP status call otherwise
      See Also:
    • compensate

      @PUT @Path("/{LRAId}/compensate") @Produces("application/json") public jakarta.ws.rs.core.Response compensate(@PathParam("LRAId") URI lraId)
      Performing a PUT on "participant URL"/compensate will cause the participant to compensate the work that was done within the scope of the 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
      Parameters:
      lraId - the id of the LRA
      Returns:
      the final status of the activity
    • complete

      @PUT @Path("/{LRAId}/complete") @Produces("application/json") public jakarta.ws.rs.core.Response complete(@PathParam("LRAId") URI lraId)
      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
      Parameters:
      lraId - the id of the LRA
      Returns:
      the final status of the activity
    • forget

      @PUT @Path("/{LRAId}/forget") public void forget(@PathParam("LRAId") URI lraId)
    • completedStatus

      @GET @Path("/{LRAId}/completed") @Produces("application/json") public String completedStatus(@PathParam("LRAId") String lraId)
    • compensatedStatus

      @GET @Path("/{LRAId}/compensated") @Produces("application/json") public String compensatedStatus(@PathParam("LRAId") String lraId)