CashSelectionPostgreSQLImpl
Keywords: net.corda.finance.workflows.asset.selection.CashSelectionPostgreSQLImpl class
Date: 2023-09-18

net.corda.finance.workflows.asset.selection

## Class CashSelectionPostgreSQLImpl

- AbstractCashSelection
- - net.corda.finance.workflows.asset.selection.CashSelectionPostgreSQLImpl

-     public class CashSelectionPostgreSQLImpl
      extends AbstractCashSelection

- - ### Field Detail

    - #### JDBC_DRIVER_NAME

          @NotNull
          public static java.lang.String JDBC_DRIVER_NAME

      See Also:
        Constant Field Values

    - #### Companion

          public static net.corda.finance.workflows.asset.selection.CashSelectionPostgreSQLImpl.Companion Companion

  - ### Constructor Detail

    - #### CashSelectionPostgreSQLImpl

          public CashSelectionPostgreSQLImpl()

  - ### Method Detail

    - #### isCompatible

          protected boolean isCompatible(@NotNull
                                         java.sql.DatabaseMetaData metadata)

      Upon dynamically loading configured Cash Selection algorithms declared in META-INF/services this method determines whether the loaded implementation is compatible and usable with the currently loaded JDBC driver. Note: the first loaded implementation to pass this check will be used at run-time.

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### executeQuery

          protected boolean executeQuery(@NotNull
                                         java.sql.Connection connection,
                                         @NotNull
                                         Amount<java.util.Currency> amount,
                                         @NotNull
                                         java.util.UUID lockId,
                                         @Nullable
                                         Party notary,
                                         @NotNull
                                         java.util.Set<? extends net.corda.core.identity.AbstractParty> onlyFromIssuerParties,
                                         @NotNull
                                         java.util.Set<? extends net.corda.core.utilities.OpaqueBytes> withIssuerRefs,
                                         @NotNull
                                         kotlin.jvm.functions.Function1<? super java.sql.ResultSet,java.lang.Boolean> withResultSet)

      A vendor specific query(ies) to gather Cash states that are available.

      Parameters:
        `amount` - The amount of currency desired (ignoring issues, but specifying the currency)
        `lockId` - The FlowLogic.runId.uuid of the flow, which is used to soft reserve the states.Also, previous outputs of the flow will be eligible as they are implicitly locked with this id until the flow completes.
        `notary` - If null the notary source is ignored, if specified then only states markedwith this notary are included.
        `onlyFromIssuerParties` - Optional issuer parties to match against.
        `withIssuerRefs` - Optional issuer references to match against.
        `withResultSet` - Function that contains the business logic. The JDBC ResultSet with the matching states that were found. If sufficient funds were found these will be locked,otherwise what is available is returned unlocked for informational purposes.
      Returns:
        The result of the withResultSet function