public class AbstractCashSelection
Pluggable interface to allow for different cash selection provider implementations
Default implementation in finance workflow module uses H2 database and a custom function within H2 to perform aggregation.
Custom implementations must implement this interface and declare their implementation in
META-INF/services/net.corda.finance.workflows.asset.selection.AbstractCashSelection
.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCashSelection.Companion |
Modifier and Type | Field and Description |
---|---|
static AbstractCashSelection.Companion |
Companion |
Constructor and Description |
---|
AbstractCashSelection(int maxRetries,
int retrySleep,
int retryCap)
Pluggable interface to allow for different cash selection provider implementations
Default implementation in finance workflow module uses H2 database and a custom function within H2 to perform aggregation.
Custom implementations must implement this interface and declare their implementation in
META-INF/services/net.corda.finance.workflows.asset.selection.AbstractCashSelection . |
AbstractCashSelection()
Pluggable interface to allow for different cash selection provider implementations
Default implementation in finance workflow module uses H2 database and a custom function within H2 to perform aggregation.
Custom implementations must implement this interface and declare their implementation in
META-INF/services/net.corda.finance.workflows.asset.selection.AbstractCashSelection . |
Modifier and Type | Method and Description |
---|---|
boolean |
executeQuery(java.sql.Connection connection,
Amount<java.util.Currency> amount,
java.util.UUID lockId,
Party notary,
java.util.Set<? extends net.corda.core.identity.AbstractParty> onlyFromIssuerParties,
java.util.Set<? extends net.corda.core.utilities.OpaqueBytes> withIssuerRefs,
Function1<? super java.sql.ResultSet,java.lang.Boolean> withResultSet)
A vendor specific query(ies) to gather Cash states that are available.
|
boolean |
isCompatible(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.
|
java.lang.String |
toString() |
java.util.List<net.corda.core.contracts.StateAndRef> |
unconsumedCashStatesForSpending(ServiceHub services,
Amount<java.util.Currency> amount,
java.util.Set<? extends net.corda.core.identity.AbstractParty> onlyFromIssuerParties,
Party notary,
java.util.UUID lockId,
java.util.Set<? extends net.corda.core.utilities.OpaqueBytes> withIssuerRefs)
Query to gather Cash states that are available and retry if they are temporarily unavailable.
|
public static AbstractCashSelection.Companion Companion
public AbstractCashSelection(int maxRetries, int retrySleep, int retryCap)
Pluggable interface to allow for different cash selection provider implementations
Default implementation in finance workflow module uses H2 database and a custom function within H2 to perform aggregation.
Custom implementations must implement this interface and declare their implementation in
META-INF/services/net.corda.finance.workflows.asset.selection.AbstractCashSelection
.
public AbstractCashSelection()
Pluggable interface to allow for different cash selection provider implementations
Default implementation in finance workflow module uses H2 database and a custom function within H2 to perform aggregation.
Custom implementations must implement this interface and declare their implementation in
META-INF/services/net.corda.finance.workflows.asset.selection.AbstractCashSelection
.
public boolean isCompatible(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.
public boolean executeQuery(java.sql.Connection connection, Amount<java.util.Currency> amount, java.util.UUID lockId, Party notary, java.util.Set<? extends net.corda.core.identity.AbstractParty> onlyFromIssuerParties, java.util.Set<? extends net.corda.core.utilities.OpaqueBytes> withIssuerRefs, Function1<? super java.sql.ResultSet,java.lang.Boolean> withResultSet)
A vendor specific query(ies) to gather Cash states that are available.
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 marked
with 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.public java.lang.String toString()
public java.util.List<net.corda.core.contracts.StateAndRef> unconsumedCashStatesForSpending(ServiceHub services, Amount<java.util.Currency> amount, java.util.Set<? extends net.corda.core.identity.AbstractParty> onlyFromIssuerParties, Party notary, java.util.UUID lockId, java.util.Set<? extends net.corda.core.utilities.OpaqueBytes> withIssuerRefs)
Query to gather Cash states that are available and retry if they are temporarily unavailable.
services
- The service hub to allow access to the database sessionamount
- The amount of currency desired (ignoring issues, but specifying the currency)onlyFromIssuerParties
- If empty the operation ignores the specifics of the issuer,
otherwise the set of eligible states wil be filtered to only include those from these issuers.notary
- If null the notary source is ignored, if specified then only states marked
with this notary are included.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.withIssuerRefs
- If not empty the specific set of issuer references to match against.