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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel(URI lraId, PropagatedHeaders headers) Cancel LRA if its active.voidclose(URI lraId, PropagatedHeaders headers) Close LRA if its active.voidInitialization of the properties provided by LRA client.join(URI lraId, PropagatedHeaders headers, long timeLimit, Participant p) Join existing LRA with participant.voidleave(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:CoordinatorClientInitialization of the properties provided by LRA client.- Specified by:
initin interfaceCoordinatorClient- Parameters:
coordinatorUriSupplier- url of the coordinatortimeout- general timeout for coordinator calls
-
start
Description copied from interface:CoordinatorClientAsk coordinator to start new LRA and return its id.- Specified by:
startin 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:CoordinatorClientAsk coordinator to start new LRA and return its id.- Specified by:
startin 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:CoordinatorClientCancel LRA if its active. Should cause coordinator to compensate its participants.- Specified by:
cancelin interfaceCoordinatorClient- Parameters:
lraId- id of the LRA to be cancelledheaders- headers to be propagated to the coordinator
-
close
Description copied from interface:CoordinatorClientClose LRA if its active. Should cause coordinator to complete its participants.- Specified by:
closein interfaceCoordinatorClient- Parameters:
lraId- id of the LRA to be closedheaders- headers to be propagated to the coordinator
-
join
Description copied from interface:CoordinatorClientJoin existing LRA with participant.- Specified by:
joinin 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:CoordinatorClientLeave LRA. Supplied participant won't be part of specified LRA any more, no compensation or completion will be executed on it.- Specified by:
leavein 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:CoordinatorClientReturn status of specified LRA.- Specified by:
statusin interfaceCoordinatorClient- Parameters:
lraId- id of the queried LRAheaders- headers to be propagated to the coordinator- Returns:
LRAStatusof the queried LRA
-