Package 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("lraresource") public class LraResource extends ResourceParent

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ACCEPT_WORK`
`static final String`
`CANCEL_PATH`
`static final String`
`LRA_RESOURCE_PATH`
`static final String`
`TIME_LIMIT`
`static final String`
`TIME_LIMIT_HALF_SEC`
`static final String`
`TRANSACTIONAL_WORK_PATH`

## Constructor Summary

Constructors
Constructor
Description
`LraResource()`

## Method Summary

Modifier and Type
Method
Description
`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 Details

### 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 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:
  - `TckTests.mixedMultiLevelNestedActivity()`

### 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:
  - `TckTests.timeLimitWithPreConditionFailed()`

### 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)