mirror of
https://github.com/corda/corda.git
synced 2025-05-02 16:53:22 +00:00
Adds todos that will improve java interop.
This commit is contained in:
parent
a007ecf980
commit
ae349a8831
@ -61,6 +61,8 @@ inline fun <R> requireThat(body: Requirements.() -> R) = Requirements.body()
|
|||||||
|
|
||||||
//// Authenticated commands ///////////////////////////////////////////////////////////////////////////////////////////
|
//// Authenticated commands ///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
// TODO: Provide a version of select that interops with Java
|
||||||
|
|
||||||
/** Filters the command list by type, party and public key all at once. */
|
/** Filters the command list by type, party and public key all at once. */
|
||||||
inline fun <reified T : CommandData> Collection<AuthenticatedObject<CommandData>>.select(signer: CompositeKey? = null,
|
inline fun <reified T : CommandData> Collection<AuthenticatedObject<CommandData>>.select(signer: CompositeKey? = null,
|
||||||
party: Party? = null) =
|
party: Party? = null) =
|
||||||
@ -69,6 +71,8 @@ inline fun <reified T : CommandData> Collection<AuthenticatedObject<CommandData>
|
|||||||
filter { if (party == null) true else party in it.signingParties }.
|
filter { if (party == null) true else party in it.signingParties }.
|
||||||
map { AuthenticatedObject(it.signers, it.signingParties, it.value as T) }
|
map { AuthenticatedObject(it.signers, it.signingParties, it.value as T) }
|
||||||
|
|
||||||
|
// TODO: Provide a version of select that interops with Java
|
||||||
|
|
||||||
/** Filters the command list by type, parties and public keys all at once. */
|
/** Filters the command list by type, parties and public keys all at once. */
|
||||||
inline fun <reified T : CommandData> Collection<AuthenticatedObject<CommandData>>.select(signers: Collection<CompositeKey>?,
|
inline fun <reified T : CommandData> Collection<AuthenticatedObject<CommandData>>.select(signers: Collection<CompositeKey>?,
|
||||||
parties: Collection<Party>?) =
|
parties: Collection<Party>?) =
|
||||||
|
@ -54,6 +54,8 @@ abstract class FlowLogic<out T> {
|
|||||||
return sendAndReceive(otherParty, payload, T::class.java)
|
return sendAndReceive(otherParty, payload, T::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Move the receiveType param to first position for readability
|
||||||
|
|
||||||
@Suspendable
|
@Suspendable
|
||||||
fun <T : Any> sendAndReceive(otherParty: Party, payload: Any, receiveType: Class<T>): UntrustworthyData<T> {
|
fun <T : Any> sendAndReceive(otherParty: Party, payload: Any, receiveType: Class<T>): UntrustworthyData<T> {
|
||||||
return fsm.sendAndReceive(otherParty, payload, receiveType, sessionFlow)
|
return fsm.sendAndReceive(otherParty, payload, receiveType, sessionFlow)
|
||||||
@ -61,6 +63,8 @@ abstract class FlowLogic<out T> {
|
|||||||
|
|
||||||
inline fun <reified T : Any> receive(otherParty: Party): UntrustworthyData<T> = receive(otherParty, T::class.java)
|
inline fun <reified T : Any> receive(otherParty: Party): UntrustworthyData<T> = receive(otherParty, T::class.java)
|
||||||
|
|
||||||
|
// TODO: Move the receiveType param to first position for readability
|
||||||
|
|
||||||
@Suspendable
|
@Suspendable
|
||||||
fun <T : Any> receive(otherParty: Party, receiveType: Class<T>): UntrustworthyData<T> {
|
fun <T : Any> receive(otherParty: Party, receiveType: Class<T>): UntrustworthyData<T> {
|
||||||
return fsm.receive(otherParty, receiveType, sessionFlow)
|
return fsm.receive(otherParty, receiveType, sessionFlow)
|
||||||
|
@ -31,6 +31,9 @@ sealed class StateMachineUpdate(val id: StateMachineRunId) {
|
|||||||
* RPC operations that the node exposes to clients using the Java client library. These can be called from
|
* RPC operations that the node exposes to clients using the Java client library. These can be called from
|
||||||
* client apps and are implemented by the node in the [CordaRPCOpsImpl] class.
|
* client apps and are implemented by the node in the [CordaRPCOpsImpl] class.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO: The use of Pairs throughout is unfriendly for Java interop.
|
||||||
|
|
||||||
interface CordaRPCOps : RPCOps {
|
interface CordaRPCOps : RPCOps {
|
||||||
/**
|
/**
|
||||||
* Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.
|
* Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.
|
||||||
|
@ -132,6 +132,9 @@ sealed class PortAllocation {
|
|||||||
* @param dsl The dsl itself.
|
* @param dsl The dsl itself.
|
||||||
* @return The value returned in the [dsl] closure.
|
* @return The value returned in the [dsl] closure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO: Add an @JvmOverloads annotation
|
||||||
|
|
||||||
fun <A> driver(
|
fun <A> driver(
|
||||||
driverDirectory: Path = Paths.get("build", getTimestampAsDirectoryName()),
|
driverDirectory: Path = Paths.get("build", getTimestampAsDirectoryName()),
|
||||||
portAllocation: PortAllocation = PortAllocation.Incremental(10000),
|
portAllocation: PortAllocation = PortAllocation.Incremental(10000),
|
||||||
|
@ -96,6 +96,9 @@ class CordaRPCClient(val host: HostAndPort, override val config: NodeSSLConfigur
|
|||||||
*
|
*
|
||||||
* @throws RPCException if the server version is too low or if the server isn't reachable within the given time.
|
* @throws RPCException if the server version is too low or if the server isn't reachable within the given time.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// TODO: Add an @JvmOverloads annotation
|
||||||
|
|
||||||
@Throws(RPCException::class)
|
@Throws(RPCException::class)
|
||||||
fun proxy(timeout: Duration? = null, minVersion: Int = 0): CordaRPCOps {
|
fun proxy(timeout: Duration? = null, minVersion: Int = 0): CordaRPCOps {
|
||||||
return state.locked {
|
return state.locked {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user