java.lang.Object
io.helidon.lra.coordinator.client.narayana.NarayanaClient
All Implemented Interfaces:
CoordinatorClient

public class NarayanaClient extends Object implements CoordinatorClient
Narayana LRA coordinator client.
  • Constructor Details

    • NarayanaClient

      public NarayanaClient()
  • Method Details

    • init

      public void init(Supplier<URI> coordinatorUriSupplier, Duration timeout)
      Description copied from interface: CoordinatorClient
      Initialization of the properties provided by LRA client.
      Specified by:
      init in interface CoordinatorClient
      Parameters:
      coordinatorUriSupplier - url of the coordinator
      timeout - general timeout for coordinator calls
    • start

      public URI start(String clientID, PropagatedHeaders headers, long timeout)
      Description copied from interface: CoordinatorClient
      Ask coordinator to start new LRA and return its id.
      Specified by:
      start in interface CoordinatorClient
      Parameters:
      clientID - id specifying originating method/resource
      headers - headers to be propagated to the coordinator
      timeout - after what time should be LRA cancelled automatically
      Returns:
      id of the new LRA
    • start

      public URI start(URI parentLRAUri, String clientID, PropagatedHeaders headers, long timeout)
      Description copied from interface: CoordinatorClient
      Ask coordinator to start new LRA and return its id.
      Specified by:
      start in interface CoordinatorClient
      Parameters:
      parentLRAUri - in case new LRA should be a child of already existing one
      clientID - id specifying originating method/resource
      headers - headers to be propagated to the coordinator
      timeout - after what time should be LRA cancelled automatically
      Returns:
      id of the new LRA
    • cancel

      public void cancel(URI lraId, PropagatedHeaders headers)
      Description copied from interface: CoordinatorClient
      Cancel LRA if its active. Should cause coordinator to compensate its participants.
      Specified by:
      cancel in interface CoordinatorClient
      Parameters:
      lraId - id of the LRA to be cancelled
      headers - headers to be propagated to the coordinator
    • close

      public void close(URI lraId, PropagatedHeaders headers)
      Description copied from interface: CoordinatorClient
      Close LRA if its active. Should cause coordinator to complete its participants.
      Specified by:
      close in interface CoordinatorClient
      Parameters:
      lraId - id of the LRA to be closed
      headers - headers to be propagated to the coordinator
    • join

      public Optional<URI> join(URI lraId, PropagatedHeaders headers, long timeLimit, Participant p)
      Description copied from interface: CoordinatorClient
      Join existing LRA with participant.
      Specified by:
      join in interface CoordinatorClient
      Parameters:
      lraId - id of existing LRA
      headers - headers to be propagated to the coordinator
      timeLimit - time limit in milliseconds after which should be LRA cancelled, 0 means never
      p - participant metadata with URLs to be called when complete/compensate ...
      Returns:
      recovery URI if supported by coordinator or empty
    • leave

      public void leave(URI lraId, PropagatedHeaders headers, Participant p)
      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 interface CoordinatorClient
      Parameters:
      lraId - id of the LRA that should be left by supplied participant
      headers - headers to be propagated to the coordinator
      p - participant which will leave
    • status

      public LRAStatus status(URI lraId, PropagatedHeaders headers)
      Description copied from interface: CoordinatorClient
      Return status of specified LRA.
      Specified by:
      status in interface CoordinatorClient
      Parameters:
      lraId - id of the queried LRA
      headers - headers to be propagated to the coordinator
      Returns:
      LRAStatus of the queried LRA