@@ -39,6 +39,21 @@ import net.corda.core.transactions.SignedTransaction
3939 */
4040class ClaimCommandService (rpc : CordaRPCOps ) : RPCService(rpc) {
4141
42+ /* *
43+ * Issues a claim.
44+ *
45+ * @param claim The claim to issue.
46+ * @param notary The notary to use for the transaction.
47+ * @param observers Additional observers of the transaction.
48+ */
49+ fun <T : Any > issueClaim (
50+ claim : CordaClaim <T >,
51+ notary : Party ? = null,
52+ observers : Set <Party > = emptySet()
53+ ): FlowProgressHandle <SignedTransaction > {
54+ return rpc.startTrackedFlow(IssueClaimFlow ::Initiator , claim, notary, observers)
55+ }
56+
4257 /* *
4358 * Issues a claim.
4459 *
@@ -60,12 +75,24 @@ class ClaimCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
6075 notary : Party ? = null,
6176 observers : Set <Party > = emptySet()
6277 ): FlowProgressHandle <SignedTransaction > {
63- return rpc.startTrackedFlow(
64- IssueClaimFlow ::Initiator ,
65- CordaClaim (issuer, holder, property, value, linearId),
66- notary,
67- observers
68- )
78+ val claim = CordaClaim (issuer, holder, property, value, linearId)
79+ return issueClaim(claim, notary, observers)
80+ }
81+
82+ /* *
83+ * Amends a claim.
84+ *
85+ * @param T The underlying claim value type.
86+ * @param oldClaim The claim to be consumed.
87+ * @param newClaim The claim to be created.
88+ * @param observers Additional observers of the transaction.
89+ */
90+ fun <T : Any > amendClaim (
91+ oldClaim : StateAndRef <CordaClaim <T >>,
92+ newClaim : CordaClaim <T >,
93+ observers : Set <Party > = emptySet()
94+ ): FlowProgressHandle <SignedTransaction > {
95+ return rpc.startTrackedFlow(AmendClaimFlow ::Initiator , oldClaim, newClaim, observers)
6996 }
7097
7198 /* *
@@ -81,12 +108,7 @@ class ClaimCommandService(rpc: CordaRPCOps) : RPCService(rpc) {
81108 value : T ,
82109 observers : Set <Party > = emptySet()
83110 ): FlowProgressHandle <SignedTransaction > {
84- return rpc.startTrackedFlow(
85- AmendClaimFlow ::Initiator ,
86- claim,
87- claim.amend(value),
88- observers
89- )
111+ return amendClaim(claim, claim.amend(value), observers)
90112 }
91113
92114 /* *
0 commit comments