Class NarayanaClient
java.lang.Object
io.helidon.lra.coordinator.client.narayana.NarayanaClient
- All Implemented Interfaces:
CoordinatorClient
Narayana LRA coordinator client.
-
Field Summary
Fields inherited from interface io.helidon.lra.coordinator.client.CoordinatorClient
CONF_DEFAULT_COORDINATOR_URL, CONF_KEY_COORDINATOR_HEADERS_PROPAGATION_PREFIX, CONF_KEY_COORDINATOR_TIMEOUT, CONF_KEY_COORDINATOR_TIMEOUT_UNIT, CONF_KEY_COORDINATOR_URL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel
(URI lraId, PropagatedHeaders headers) Cancel LRA if its active.void
close
(URI lraId, PropagatedHeaders headers) Close LRA if its active.void
Initialization of the properties provided by LRA client.join
(URI lraId, PropagatedHeaders headers, long timeLimit, Participant p) Join existing LRA with participant.void
leave
(URI lraId, PropagatedHeaders headers, Participant p) Leave LRA.start
(String clientID, PropagatedHeaders headers, long timeout) Ask coordinator to start new LRA and return its id.start
(URI parentLRAUri, String clientID, PropagatedHeaders headers, long timeout) Ask coordinator to start new LRA and return its id.status
(URI lraId, PropagatedHeaders headers) Return status of specified LRA.
-
Constructor Details
-
NarayanaClient
public NarayanaClient()
-
-
Method Details
-
init
Description copied from interface:CoordinatorClient
Initialization of the properties provided by LRA client.- Specified by:
init
in interfaceCoordinatorClient
- Parameters:
coordinatorUriSupplier
- url of the coordinatortimeout
- general timeout for coordinator calls
-
start
Description copied from interface:CoordinatorClient
Ask coordinator to start new LRA and return its id.- Specified by:
start
in interfaceCoordinatorClient
- Parameters:
clientID
- id specifying originating method/resourceheaders
- headers to be propagated to the coordinatortimeout
- after what time should be LRA cancelled automatically- Returns:
- id of the new LRA
-
start
Description copied from interface:CoordinatorClient
Ask coordinator to start new LRA and return its id.- Specified by:
start
in interfaceCoordinatorClient
- Parameters:
parentLRAUri
- in case new LRA should be a child of already existing oneclientID
- id specifying originating method/resourceheaders
- headers to be propagated to the coordinatortimeout
- after what time should be LRA cancelled automatically- Returns:
- id of the new LRA
-
cancel
Description copied from interface:CoordinatorClient
Cancel LRA if its active. Should cause coordinator to compensate its participants.- Specified by:
cancel
in interfaceCoordinatorClient
- Parameters:
lraId
- id of the LRA to be cancelledheaders
- headers to be propagated to the coordinator
-
close
Description copied from interface:CoordinatorClient
Close LRA if its active. Should cause coordinator to complete its participants.- Specified by:
close
in interfaceCoordinatorClient
- Parameters:
lraId
- id of the LRA to be closedheaders
- headers to be propagated to the coordinator
-
join
Description copied from interface:CoordinatorClient
Join existing LRA with participant.- Specified by:
join
in interfaceCoordinatorClient
- Parameters:
lraId
- id of existing LRAheaders
- headers to be propagated to the coordinatortimeLimit
- time limit in milliseconds after which should be LRA cancelled, 0 means neverp
- participant metadata with URLs to be called when complete/compensate ...- Returns:
- recovery URI if supported by coordinator or empty
-
leave
Description copied from interface:CoordinatorClient
Leave LRA. Supplied participant won't be part of specified LRA any more, no compensation or completion will be executed on it.- Specified by:
leave
in interfaceCoordinatorClient
- Parameters:
lraId
- id of the LRA that should be left by supplied participantheaders
- headers to be propagated to the coordinatorp
- participant which will leave
-
status
Description copied from interface:CoordinatorClient
Return status of specified LRA.- Specified by:
status
in interfaceCoordinatorClient
- Parameters:
lraId
- id of the queried LRAheaders
- headers to be propagated to the coordinator- Returns:
LRAStatus
of the queried LRA
-