org.eclipse.microprofile.lra.tck.participant.api

## Class LraResource

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

    @ApplicationScoped
     @Path(value="lraresource")
    public class LraResource
    extends ResourceParent

### Field Summary

Fields
`static String` `ACCEPT_WORK`
`static String` `CANCEL_PATH`
`static String` `LRA_RESOURCE_PATH`
`static String` `TIME_LIMIT`
`static String` `TIME_LIMIT_HALF_SEC`
`static String` `TRANSACTIONAL_WORK_PATH`

### Constructor Summary

Constructors
Constructor and Description
`LraResource()`

### Method Summary

All Methods Instance Methods Concrete Methods
`jakarta.ws.rs.core.Response` `acceptWork(URI recoveryId, URI lraId)`
`jakarta.ws.rs.core.Response` `activityWithLRA(URI recoveryId, URI lraId)`
`jakarta.ws.rs.core.Response` `activityWithMandatoryLRA(URI recoveryId, URI lraId)`
`jakarta.ws.rs.core.Response` `cancelLRA(URI lraId)` Used to close nested LRA in which this resource is enlisted
`jakarta.ws.rs.core.Response` `compensate(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.
`String` `compensatedStatus(String lraId)`
`jakarta.ws.rs.core.Response` `compensateWork(URI lraId, URI recoveryId)`
`jakarta.ws.rs.core.Response` `complete(URI lraId)` Performing a PUT on "participant URL"/complete will cause the participant to tidy up and it can forget this transaction.
`String` `completedStatus(String lraId)`
`jakarta.ws.rs.core.Response` `completeWork(URI lraId, URI recoveryId)`
`jakarta.ws.rs.core.Response` `findAll()`
`void` `forget(URI lraId)`
`jakarta.ws.rs.core.Response` `forgetWork(URI lraId, URI recoveryId)`
`jakarta.ws.rs.core.Response` `leaveWork(URI lraId)`
`jakarta.ws.rs.core.Response` `multiLevelNestedActivity(URI recoveryId, URI nestedLRAId, Integer nestedCnt)`
`jakarta.ws.rs.core.Response` `nestedActivity(URI recoveryId, URI nestedLRAId)`
`jakarta.ws.rs.core.Response` `status(URI lraId, 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.
`jakarta.ws.rs.core.Response` `subActivity(URI lraId)`
`jakarta.ws.rs.core.Response` `supportsLRACall(URI lraId)`
`jakarta.ws.rs.core.Response` `timeLimit(URI lraId)`
`jakarta.ws.rs.core.Response` `timeLimitTest2(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)

### Methods inherited from class org.eclipse.microprofile.lra.tck.participant.api.ResourceParent

`afterLRA`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### LRA_RESOURCE_PATH

    public static final String LRA_RESOURCE_PATH

See Also:
  Constant Field Values

#### TRANSACTIONAL_WORK_PATH

    public static final String TRANSACTIONAL_WORK_PATH

See Also:
  Constant Field Values

#### ACCEPT_WORK

    public static final String ACCEPT_WORK

See Also:
  Constant Field Values

#### TIME_LIMIT

    public static final String TIME_LIMIT

See Also:
  Constant Field Values

#### TIME_LIMIT_HALF_SEC

    public static final String TIME_LIMIT_HALF_SEC

See Also:
  Constant Field Values

#### CANCEL_PATH

    public static final String CANCEL_PATH

See Also:
  Constant Field Values

### Constructor Detail

#### LraResource

    public LraResource()

### Method Detail

#### status

    @GET
     @Path(value="/status")
     @Produces(value="application/json")
    public jakarta.ws.rs.core.Response status(@HeaderParam(value="Long-Running-Action")
                                                                                                                URI lraId,
                                                                                                                @HeaderParam(value="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(value="/leave")
     @Produces(value="application/json")
    public jakarta.ws.rs.core.Response leaveWork(@HeaderParam(value="Long-Running-Action")
                                                                                                                  URI lraId)

#### completeWork

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

#### compensateWork

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

#### forgetWork

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

#### acceptWork

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

#### supportsLRACall

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

#### subActivity

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

#### activityWithLRA

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

#### activityWithMandatoryLRA

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

#### nestedActivity

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

#### cancelLRA

    @PUT
     @Path(value="/cancel")
    public jakarta.ws.rs.core.Response cancelLRA(@HeaderParam(value="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:
  `TckTests.mixedMultiLevelNestedActivity()`

#### multiLevelNestedActivity

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

#### findAll

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

#### timeLimit

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

#### timeLimitTest2

    @GET
     @Path(value="/timeLimit2")
     @Produces(value="application/json")
    public jakarta.ws.rs.core.Response timeLimitTest2(@HeaderParam(value="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:
  `TckTests.timeLimitWithPreConditionFailed()`

#### compensate

    @PUT
     @Path(value="/{LRAId}/compensate")
     @Produces(value="application/json")
    public jakarta.ws.rs.core.Response compensate(@PathParam(value="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(value="/{LRAId}/complete")
     @Produces(value="application/json")
    public jakarta.ws.rs.core.Response complete(@PathParam(value="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(value="/{LRAId}/forget")
    public void forget(@PathParam(value="LRAId")
                                                            URI lraId)

#### completedStatus

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

#### compensatedStatus

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