NotaryFlow.Client
Keywords: net.corda.core.flows.NotaryFlow.Client class
Date: 2023-09-18

net.corda.core.flows

## Class NotaryFlow.Client

- net.corda.core.flows.NotaryFlow.Client

- Enclosing class:
    NotaryFlow

      @DoNotImplement
       @InitiatingFlow
      public static class NotaryFlow.Client

  A flow to be used by a party for obtaining signature(s) from a NotaryService ascertaining the transaction time-window is correct and none of its inputs have been used in another completed transaction.

  In case of a single-node or Raft notary, the flow will return a single signature. For the BFT notary multiple signatures will be returned – one from each replica that accepted the input state commit.

  The transaction to be notarised, stx, should be fully verified before calling this flow.

  See Also:
    NotaryService

- - ### Field Detail

    - #### Companion

          public static net.corda.core.flows.NotaryFlow.Client.Companion Companion

  - ### Constructor Detail

    - #### Client

          public Client(@NotNull
                        SignedTransaction stx,
                        @NotNull
                        ProgressTracker progressTracker,
                        boolean skipVerification)

      A flow to be used by a party for obtaining signature(s) from a NotaryService ascertaining the transaction time-window is correct and none of its inputs have been used in another completed transaction.

      In case of a single-node or Raft notary, the flow will return a single signature. For the BFT notary multiple signatures will be returned – one from each replica that accepted the input state commit.

      The transaction to be notarised, stx, should be fully verified before calling this flow.

      Parameters:
        `progressTracker` -

        Override this to provide a `class ProgressTracker`. If one is provided and stepped, the framework will do something helpful with the progress reports e.g record to the audit service. If this flow is invoked as a subflow of another, then the tracker will be made a child of the current step in the parent. If it's null, this flow doesn't track progress.

        Note that this has to return a tracker before the flow is invoked. You can't change your mind half way through.

        `skipVerification` - Set to true if the stx has already been verified for signature and contract validity,to prevent re-verification.
      Throws:
        `NotaryException` - in case the any of the inputs to the transaction have been consumed by another transaction or the time-window is invalid or the parameters used for this transaction are no longer in force in the network.
      See Also:
        NotaryService

    - #### Client

          @JvmOverloads
          public Client(@NotNull
                                      SignedTransaction stx,
                                      boolean skipVerification)

    - #### Client

          @JvmOverloads
          public Client(@NotNull
                                      SignedTransaction stx)

    - #### Client

          public Client(@NotNull
                        SignedTransaction stx,
                        @NotNull
                        ProgressTracker progressTracker)

  - ### Method Detail

    - #### isTimeoutEnabled

          @CordaInternal
          public boolean isTimeoutEnabled()

    - #### call

          @Suspendable
           @NotNull
          public java.util.List<net.corda.core.crypto.TransactionSignature> call()

      This is where you fill out your business logic.

    - #### checkTransaction

          @NotNull
          protected Party checkTransaction()

      Checks that the transaction specifies a valid notary, and verifies that it contains all required signatures apart from the notary's.

    - #### notarise

          @Suspendable
           @NotNull
          protected UntrustworthyData<net.corda.core.flows.NotarisationResponse> notarise(@NotNull
                                                                                                                 Party notaryParty)

      Notarises the transaction with the `notaryParty`, obtains the notary's signature(s).

      See Also:
        `notaryParty`

    - #### validateResponse

          @NotNull
          protected java.util.List<net.corda.core.crypto.TransactionSignature> validateResponse(@NotNull
                                                                                                         UntrustworthyData<net.corda.core.flows.NotarisationResponse> response,
                                                                                                         @NotNull
                                                                                                         Party notaryParty)

      Checks that the notary's signature(s) is/are valid.

    - #### getProgressTracker

          @NotNull
          public ProgressTracker getProgressTracker()

      Override this to provide a `class ProgressTracker`. If one is provided and stepped, the framework will do something helpful with the progress reports e.g record to the audit service. If this flow is invoked as a subflow of another, then the tracker will be made a child of the current step in the parent. If it's null, this flow doesn't track progress.

      Note that this has to return a tracker before the flow is invoked. You can't change your mind half way through.

      See Also:
        `class ProgressTracker`