Class LraCancelOnResource

java.lang.Object
org.eclipse.microprofile.lra.tck.participant.api.LraCancelOnResource

@ApplicationScoped @Path("lraresource-cancelon") public class LraCancelOnResource extends Object
  • Field Details

  • Constructor Details

    • LraCancelOnResource

      public LraCancelOnResource()
  • Method Details

    • cancelOnFamilyDefault4xx

      @GET @Path("cancelOnFamilyDefault4xx") public jakarta.ws.rs.core.Response cancelOnFamilyDefault4xx(@HeaderParam("Long-Running-Action") URI lraId)
      Default return status for cancelling LRA is 4xx and 5xx
      Parameters:
      lraId - The LRA id generated for this action
      Returns:
      JAX-RS response
    • cancelOnFamilyDefault5xx

      @GET @Path("cancelOnFamilyDefault5xx") public jakarta.ws.rs.core.Response cancelOnFamilyDefault5xx(@HeaderParam("Long-Running-Action") URI lraId)
      Default return status for cancelling LRA is 4xx and 5xx
      Parameters:
      lraId - The LRA id generated for this action
      Returns:
      JAX-RS response
    • cancelOnFamily3xx

      @GET @Path("cancelOnFamily3xx") public jakarta.ws.rs.core.Response cancelOnFamily3xx(@HeaderParam("Long-Running-Action") URI lraId)
      Cancel on family is set to 3xx. The 3xx return code has to cancel the LRA.
      Parameters:
      lraId - The LRA id generated for this action
      Returns:
      JAX-RS response
    • cancelOn301

      @GET @Path("cancelOn301") public jakarta.ws.rs.core.Response cancelOn301(@HeaderParam("Long-Running-Action") URI lraId)
      Cancel on is set to 301. The 301 return code has to cancel the LRA.
      Parameters:
      lraId - The LRA id generated for this action
      Returns:
      JAX-RS response
    • notCancelOnFamily5xx

      @GET @Path("notCancelOnFamily5xx") public jakarta.ws.rs.core.Response notCancelOnFamily5xx(@HeaderParam("Long-Running-Action") URI lraId)
      Cancel on family is set to 4xx, the code from other families (e.g. for 5xx should not cancel but should go with close the LRA.
      Parameters:
      lraId - The LRA id generated for this action
      Returns:
      JAX-RS response
    • cancelFromRemoteCall

      @GET @Path("cancelFromRemoteCall") public jakarta.ws.rs.core.Response cancelFromRemoteCall(@HeaderParam("Long-Running-Action") URI lraId, @Context jakarta.ws.rs.core.UriInfo uriInfo)

      Returning 200 thus the LRA should be closed but beforehand it makes a remote REST call which returns 5xx which is the default for the cancelling and so the whole LRA should be cancelled.

      The remote REST call invokes the same resource class LraCancelOnResource That assumes the call to the representative of the same LRA participant as it's already enlisted by the method cancelFromRemoteCall(java.net.URI, jakarta.ws.rs.core.UriInfo) invoked by the test. Because the specification mandates that the same participant can be enlisted only once per LRA instance then the Compensate method compensateWork(URI) will be called only once for the test invocation.

      Parameters:
      lraId - The LRA id generated for this action
      uriInfo - as context provided by JAX-RS to find base service URI
      Returns:
      JAX-RS response
    • completeWork

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

      @PUT @Path("/compensate") public jakarta.ws.rs.core.Response compensateWork(@HeaderParam("Long-Running-Action") URI lraId)