Package io.narayana.lra.client.internal
Class NarayanaLRAClient
java.lang.Object
io.narayana.lra.client.internal.NarayanaLRAClient
- All Implemented Interfaces:
Closeable,AutoCloseable
Deprecated.
WARNING: NarayanaLRAClient is an internal utility class and is subject to change
(however it will be made available with improved guarantees in a subsequent release).
A utility class for controlling the lifecycle of Long Running Actions (LRAs) but the preferred mechanism is to use
the annotation in the
packageinvalid reference
org.eclipse.microprofile.lra.annotation
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.Key for looking up the config property that specifies which is the URL to connect to the Narayana LRA coordinator -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creating LRA client.NarayanaLRAClient(String coordinatorUrl) Deprecated.Creating LRA client where expecting LRA coordinator being available at the provided URL defined by String.NarayanaLRAClient(String protocol, String host, int port, String coordinatorPath) Deprecated.Creating LRA client where expecting LRA coordinator being available through protocol protocol at host:port/coordinatorPath.NarayanaLRAClient(URI coordinatorUrl) Deprecated.Creating LRA client where expecting LRA coordinator being available at the provided uri. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidDeprecated.voidclose()Deprecated.voidDeprecated.voidDeprecated.enlistCompensator(URI uri, Long timelimit, String linkHeader, StringBuilder compensatorData) Deprecated.Deprecated.Deprecated.Deprecated.Deprecated.org.eclipse.microprofile.lra.annotation.LRAStatusDeprecated.getTerminationUris(Class<?> compensatorClass, String uriPrefix, Long timeout) Deprecated.For particular compensator class it returns termination uris based on the provided base uri.static booleanisAsyncCompletion(Method method) Deprecated.Providing information if method is defined to be completed asynchronously.joinLRA(URI lraId, Long timeLimit, URI participantUri, StringBuilder compensatorData) Deprecated.Joining the LRA with identity of `lraId` as participant defined by a participant URI.joinLRA(URI lraId, Long timeLimit, URI compensateUri, URI completeUri, URI forgetUri, URI leaveUri, URI afterUri, URI statusUri, String compensatorData) Deprecated.Joining the LRA with identity of `lraId` as participant defined by URIs for complete, compensate, forget, leave, after and status.joinLRA(URI lraId, Long timeLimit, URI compensateUri, URI completeUri, URI forgetUri, URI leaveUri, URI afterUri, URI statusUri, StringBuilder compensatorData) Deprecated.voidDeprecated.voidsetCurrentLRA(URI lraId) Deprecated.Method changes the client's notion about the place where the LRA coordinator can be contacted.Deprecated.Starting LRA.startLRA(URI parentLRA, String clientID, Long timeout, ChronoUnit unit) Deprecated.startLRA(URI parentLRA, String clientID, Long timeout, ChronoUnit unit, boolean verbose) Deprecated.Starting LRA.
-
Field Details
-
LRA_COORDINATOR_URL_KEY
Deprecated.Key for looking up the config property that specifies which is the URL to connect to the Narayana LRA coordinator- See Also:
-
-
Constructor Details
-
NarayanaLRAClient
public NarayanaLRAClient()Deprecated.Creating LRA client. The URL of the LRA coordinator will be taken from system propertyLRA_COORDINATOR_URL_KEY. If not defined as default value is takenhttp://localhost:8080/lra-coordinator. The LRA recovery coordinator will be searched at the sub-path "recovery".- Throws:
IllegalStateException- thrown when the URL taken from the system property value is not a URL format
-
NarayanaLRAClient
Deprecated.Creating LRA client where expecting LRA coordinator being available through protocol protocol at host:port/coordinatorPath.- Parameters:
protocol- protocol used to contact the LRA coordinatorhost- hostname where the LRA coordinator will be contactedport- port where the LRA coordinator will be contactedcoordinatorPath- path where the LRA coordinator will be contacted
-
NarayanaLRAClient
Deprecated.Creating LRA client where expecting LRA coordinator being available at the provided uri. The LRA recovery coordinator will be searched at the sub-path "recovery".- Parameters:
coordinatorUrl- uri of the LRA coordinator
-
NarayanaLRAClient
Deprecated.Creating LRA client where expecting LRA coordinator being available at the provided URL defined by String. The LRA recovery coordinator will be searched at the sub-path "recovery".- Parameters:
coordinatorUrl- url of the LRA coordinator- Throws:
IllegalStateException- thrown when the provided URL String is not a URL format
-
-
Method Details
-
setCurrentLRA
Deprecated.Method changes the client's notion about the place where the LRA coordinator can be contacted. It takes the provided URI and tries to derive the URL path of the coordinator responsible for the LRA id. The URL is then used as endpoint for later use of this LRA Narayana client instance.- Parameters:
lraId- LRA id consisting of the coordinator URL and the LRA uid
-
getAllLRAs
Deprecated. -
startLRA
Deprecated.Starting LRA. You provide client id determining the LRA being started.- Parameters:
clientID- client id determining the LRA- Returns:
- LRA id as URL
- Throws:
jakarta.ws.rs.WebApplicationException- thrown when start of the LRA failed
-
startLRA
public URI startLRA(URI parentLRA, String clientID, Long timeout, ChronoUnit unit) throws jakarta.ws.rs.WebApplicationException Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
startLRA
public URI startLRA(URI parentLRA, String clientID, Long timeout, ChronoUnit unit, boolean verbose) throws jakarta.ws.rs.WebApplicationException Deprecated.Starting LRA. You provide client id that joins the LRA context and is passed when working with the LRA.- Parameters:
parentLRA- when the newly started LRA should be nested with this LRA parent, when null the newly started LRA is top-levelclientID- client id determining the LRAtimeout- timeout value, when timeout-ed the LRA will be compensatedunit- timeout unit, when null seconds are used- Returns:
- LRA id as URL
- Throws:
jakarta.ws.rs.WebApplicationException- thrown when start of the LRA failed
-
cancelLRA
Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
closeLRA
Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
cancelLRA
public void cancelLRA(URI lraId, String compensator, String userData) throws jakarta.ws.rs.WebApplicationException Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
closeLRA
public void closeLRA(URI lraId, String compensator, String userData) throws jakarta.ws.rs.WebApplicationException Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
joinLRA
public URI joinLRA(URI lraId, Long timeLimit, URI compensateUri, URI completeUri, URI forgetUri, URI leaveUri, URI afterUri, URI statusUri, String compensatorData) throws jakarta.ws.rs.WebApplicationException Deprecated.Joining the LRA with identity of `lraId` as participant defined by URIs for complete, compensate, forget, leave, after and status.- Parameters:
lraId- the URI of the LRA to jointimeLimit- how long the participant is prepared to wait for LRA completioncompensateUri- URI for compensation notificationscompleteUri- URI for completion notificationsforgetUri- URI for forget callbackleaveUri- URI for leave requestsstatusUri- URI for reporting the status of the participantcompensatorData- data provided during compensation- Returns:
- a recovery URL for this enlistment
- Throws:
jakarta.ws.rs.WebApplicationException- if the LRA coordinator failed to enlist the participant
-
joinLRA
public URI joinLRA(URI lraId, Long timeLimit, URI compensateUri, URI completeUri, URI forgetUri, URI leaveUri, URI afterUri, URI statusUri, StringBuilder compensatorData) throws jakarta.ws.rs.WebApplicationException Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
joinLRA
public URI joinLRA(URI lraId, Long timeLimit, URI participantUri, StringBuilder compensatorData) throws jakarta.ws.rs.WebApplicationException Deprecated.Joining the LRA with identity of `lraId` as participant defined by a participant URI.- Parameters:
lraId- the URI of the LRA to jointimeLimit- how long the participant is prepared to wait for LRA completionparticipantUri- URI of participant for enlistmentcompensatorData- data provided during compensation- Returns:
- a recovery URL for this enlistment
- Throws:
jakarta.ws.rs.WebApplicationException- if the LRA coordinator failed to enlist the participant
-
leaveLRA
Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
getTerminationUris
public static Map<String,String> getTerminationUris(Class<?> compensatorClass, String uriPrefix, Long timeout) Deprecated.For particular compensator class it returns termination uris based on the provided base uri. You get map of string and URI.- Parameters:
compensatorClass- compensator class to examineuriInfo- the uri that triggered this join request.- Returns:
- map of URI
-
isAsyncCompletion
Deprecated.Providing information if method is defined to be completed asynchronously. This means thatSuspendedannotation is available amongst the method parameters while the method is annotated withCompleteorCompensate.- Parameters:
method- method to be checked for async completion- Returns:
- true if method is to complete asynchronously, false if synchronously
-
getStatus
public org.eclipse.microprofile.lra.annotation.LRAStatus getStatus(URI uri) throws jakarta.ws.rs.WebApplicationException Deprecated.- Throws:
jakarta.ws.rs.WebApplicationException
-
enlistCompensator
public URI enlistCompensator(URI uri, Long timelimit, String linkHeader, StringBuilder compensatorData) Deprecated. -
getCoordinatorUrl
Deprecated. -
getRecoveryUrl
Deprecated. -
getCurrent
Deprecated. -
close
public void close()Deprecated.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-