Interface CoordinatorClient
-
- All Known Implementing Classes:
NarayanaClient
public interface CoordinatorClientAbstraction over specific coordinator.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONF_DEFAULT_COORDINATOR_URLDefault coordinator url.static StringCONF_KEY_COORDINATOR_HEADERS_PROPAGATION_PREFIXPrefix of headers which should be propagated to the coordinator.static StringCONF_KEY_COORDINATOR_TIMEOUTTimeout for synchronous communication with coordinator.static StringCONF_KEY_COORDINATOR_TIMEOUT_UNITTimeout unit for synchronous communication with coordinator.static StringCONF_KEY_COORDINATOR_URLURL of the coordinator to be used for orchestrating Long Running Actions.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default Single<Void>cancel(URI lraId)Deprecated, for removal: This API element is subject to removal in a future version.Usecancel(java.net.URI, PropagatedHeaders)insteadSingle<Void>cancel(URI lraId, PropagatedHeaders headers)Cancel LRA if its active.default Single<Void>close(URI lraId)Deprecated, for removal: This API element is subject to removal in a future version.Useclose(java.net.URI, PropagatedHeaders)insteadSingle<Void>close(URI lraId, PropagatedHeaders headers)Close LRA if its active.voidinit(Supplier<URI> coordinatorUriSupplier, long timeout, TimeUnit timeoutUnit)Initialization of the properties provided by LRA client.default Single<Optional<URI>>join(URI lraId, long timeLimit, Participant participant)Deprecated, for removal: This API element is subject to removal in a future version.Single<Optional<URI>>join(URI lraId, PropagatedHeaders headers, long timeLimit, Participant participant)Join existing LRA with participant.default Single<Void>leave(URI lraId, Participant participant)Deprecated, for removal: This API element is subject to removal in a future version.Single<Void>leave(URI lraId, PropagatedHeaders headers, Participant participant)Leave LRA.default Single<URI>start(String clientID, long timeout)Deprecated, for removal: This API element is subject to removal in a future version.Usestart(String, PropagatedHeaders, long)insteadSingle<URI>start(String clientID, PropagatedHeaders headers, long timeout)Ask coordinator to start new LRA and return its id.default Single<URI>start(URI parentLRA, String clientID, long timeout)Deprecated, for removal: This API element is subject to removal in a future version.Single<URI>start(URI parentLRA, String clientID, PropagatedHeaders headers, long timeout)Ask coordinator to start new LRA and return its id.default Single<LRAStatus>status(URI lraId)Deprecated, for removal: This API element is subject to removal in a future version.Usestatus(java.net.URI, PropagatedHeaders)insteadSingle<LRAStatus>status(URI lraId, PropagatedHeaders headers)Return status of specified LRA.
-
-
-
Field Detail
-
CONF_KEY_COORDINATOR_HEADERS_PROPAGATION_PREFIX
static final String CONF_KEY_COORDINATOR_HEADERS_PROPAGATION_PREFIX
Prefix of headers which should be propagated to the coordinator.- See Also:
- Constant Field Values
-
CONF_KEY_COORDINATOR_URL
static final String CONF_KEY_COORDINATOR_URL
URL of the coordinator to be used for orchestrating Long Running Actions.- See Also:
- Constant Field Values
-
CONF_KEY_COORDINATOR_TIMEOUT
static final String CONF_KEY_COORDINATOR_TIMEOUT
Timeout for synchronous communication with coordinator.- See Also:
- Constant Field Values
-
CONF_KEY_COORDINATOR_TIMEOUT_UNIT
static final String CONF_KEY_COORDINATOR_TIMEOUT_UNIT
Timeout unit for synchronous communication with coordinator. Values of enumTimeUnitare expected.- See Also:
- Constant Field Values
-
CONF_DEFAULT_COORDINATOR_URL
static final String CONF_DEFAULT_COORDINATOR_URL
Default coordinator url.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
void init(Supplier<URI> coordinatorUriSupplier, long timeout, TimeUnit timeoutUnit)
Initialization of the properties provided by LRA client.- Parameters:
coordinatorUriSupplier- url of the coordinatortimeout- general timeout for coordinator callstimeoutUnit- timeout unit for coordinator calls
-
start
@Deprecated(since="2.4.2", forRemoval=true) default Single<URI> start(String clientID, long timeout)
Deprecated, for removal: This API element is subject to removal in a future version.Usestart(String, PropagatedHeaders, long)insteadAsk coordinator to start new LRA and return its id.- Parameters:
clientID- id specifying originating method/resourcetimeout- after what time should be LRA cancelled automatically- Returns:
- id of the new LRA
-
start
Single<URI> start(String clientID, PropagatedHeaders headers, long timeout)
Ask coordinator to start new LRA and return its id.- 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
@Deprecated(since="2.4.2", forRemoval=true) default Single<URI> start(URI parentLRA, String clientID, long timeout)
Deprecated, for removal: This API element is subject to removal in a future version.Ask coordinator to start new LRA and return its id.- Parameters:
parentLRA- in case new LRA should be a child of already existing oneclientID- id specifying originating method/resourcetimeout- after what time should be LRA cancelled automatically- Returns:
- id of the new LRA
-
start
Single<URI> start(URI parentLRA, String clientID, PropagatedHeaders headers, long timeout)
Ask coordinator to start new LRA and return its id.- Parameters:
parentLRA- 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
-
join
@Deprecated(since="2.4.2", forRemoval=true) default Single<Optional<URI>> join(URI lraId, long timeLimit, Participant participant)
Deprecated, for removal: This API element is subject to removal in a future version.Join existing LRA with participant.- Parameters:
lraId- id of existing LRAtimeLimit- time limit in milliseconds after which should be LRA cancelled, 0 means neverparticipant- participant metadata with URLs to be called when complete/compensate ...- Returns:
- recovery URI if supported by coordinator or empty
-
join
Single<Optional<URI>> join(URI lraId, PropagatedHeaders headers, long timeLimit, Participant participant)
Join existing LRA with participant.- 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 neverparticipant- participant metadata with URLs to be called when complete/compensate ...- Returns:
- recovery URI if supported by coordinator or empty
-
cancel
@Deprecated(since="2.4.2", forRemoval=true) default Single<Void> cancel(URI lraId)
Deprecated, for removal: This API element is subject to removal in a future version.Usecancel(java.net.URI, PropagatedHeaders)insteadCancel LRA if its active. Should cause coordinator to compensate its participants.- Parameters:
lraId- id of the LRA to be cancelled- Returns:
- single future of the cancel call
-
cancel
Single<Void> cancel(URI lraId, PropagatedHeaders headers)
Cancel LRA if its active. Should cause coordinator to compensate its participants.- Parameters:
lraId- id of the LRA to be cancelledheaders- headers to be propagated to the coordinator- Returns:
- single future of the cancel call
-
close
@Deprecated(since="2.4.2", forRemoval=true) default Single<Void> close(URI lraId)
Deprecated, for removal: This API element is subject to removal in a future version.Useclose(java.net.URI, PropagatedHeaders)insteadClose LRA if its active. Should cause coordinator to complete its participants.- Parameters:
lraId- id of the LRA to be closed- Returns:
- single future of the cancel call
-
close
Single<Void> close(URI lraId, PropagatedHeaders headers)
Close LRA if its active. Should cause coordinator to complete its participants.- Parameters:
lraId- id of the LRA to be closedheaders- headers to be propagated to the coordinator- Returns:
- single future of the cancel call
-
leave
@Deprecated(since="2.4.2", forRemoval=true) default Single<Void> leave(URI lraId, Participant participant)
Deprecated, for removal: This API element is subject to removal in a future version.Leave LRA. Supplied participant won't be part of specified LRA any more, no compensation or completion will be executed on it.- Parameters:
lraId- id of the LRA that should be left by supplied participantparticipant- participant which will leave- Returns:
- single future of the cancel call
-
leave
Single<Void> leave(URI lraId, PropagatedHeaders headers, Participant participant)
Leave LRA. Supplied participant won't be part of specified LRA any more, no compensation or completion will be executed on it.- Parameters:
lraId- id of the LRA that should be left by supplied participantheaders- headers to be propagated to the coordinatorparticipant- participant which will leave- Returns:
- single future of the cancel call
-
status
@Deprecated(since="2.4.2", forRemoval=true) default Single<LRAStatus> status(URI lraId)
Deprecated, for removal: This API element is subject to removal in a future version.Usestatus(java.net.URI, PropagatedHeaders)insteadReturn status of specified LRA.- Parameters:
lraId- id of the queried LRA- Returns:
LRAStatusof the queried LRA
-
status
Single<LRAStatus> status(URI lraId, PropagatedHeaders headers)
Return status of specified LRA.- Parameters:
lraId- id of the queried LRAheaders- headers to be propagated to the coordinator- Returns:
LRAStatusof the queried LRA
-
-