public static class AppServiceHub.DefaultImpls
A annotationclass CordaService
annotated class requires a constructor taking a
single parameter of type interface AppServiceHub
.
With the interface AppServiceHub
parameter a annotationclass CordaService
is able to access to privileged operations.
In particular such a annotationclass CordaService
can initiate and track flows marked
with annotationclass StartableByService
.
public static <T> void register(AppServiceHub $this, int priority, @NotNull kotlin.jvm.functions.Function1<? super net.corda.core.node.services.ServiceLifecycleEvent,? extends T> func)
Convenience method to be able to add an arbitrary function as a register
callback.
register
public static void recordTransactions(AppServiceHub $this, boolean notifyVault, @NotNull java.lang.Iterable<net.corda.core.transactions.SignedTransaction> txs)
Stores the given class SignedTransaction
s in the local transaction storage and then sends them to the vault for
further processing if notifyVault
is true. This is expected to be run within a database transaction.
As of platform version TWO_PHASE_FINALITY also performs signature verification and will throw an IllegalStateException with details of the cause of error upon failure. Of course, you should not be recording transactions to the ledger that are not fully signed. It is possible, but not recommended, to revert to non-signature verification behaviour by setting the system property "net.corda.recordtransaction.signature.verification.disabled" to true upon node start-up.
$this
- indicate if the vault should be notified for the update.notifyVault
- The transactions to record.txs
- The transactions to record.class SignedTransaction
,
notifyVault
,
IllegalStateExceptionpublic static void recordTransactions(AppServiceHub $this, boolean notifyVault, @NotNull SignedTransaction first, @NotNull net.corda.core.transactions.SignedTransaction... remaining)
Stores the given class SignedTransaction
s in the local transaction storage and then sends them to the vault for
further processing if notifyVault
is true. This is expected to be run within a database transaction.
As of platform version TWO_PHASE_FINALITY also performs signature verification and will throw an IllegalStateException with details of the cause of error upon failure. Of course, you should not be recording transactions to the ledger that are not fully signed. It is possible, but not recommended, to revert to non-signature verification behaviour by setting the system property "net.corda.recordtransaction.signature.verification.disabled" to true upon node start-up.
class SignedTransaction
,
notifyVault
,
IllegalStateExceptionpublic static void recordTransactions(AppServiceHub $this, @NotNull SignedTransaction first, @NotNull net.corda.core.transactions.SignedTransaction... remaining)
Stores the given class SignedTransaction
s in the local transaction storage and then sends them to the vault for
further processing. This is expected to be run within a database transaction.
As of platform version TWO_PHASE_FINALITY also performs signature verification and will throw an IllegalStateException with details of the cause of error upon failure. Of course, you should not be recording transactions to the ledger that are not fully signed. It is possible, but not recommended, to revert to non-signature verification behaviour by setting the system property "net.corda.recordtransaction.signature.verification.disabled" to true upon node start-up.
class SignedTransaction
,
IllegalStateExceptionpublic static void recordTransactions(AppServiceHub $this, @NotNull java.lang.Iterable<net.corda.core.transactions.SignedTransaction> txs)
Stores the given class SignedTransaction
s in the local transaction storage and then sends them to the vault for
further processing. This is expected to be run within a database transaction.
As of platform version TWO_PHASE_FINALITY also performs signature verification and will throw an IllegalStateException with details of the cause of error upon failure. Of course, you should not be recording transactions to the ledger that are not fully signed. It is possible, but not recommended, to revert to non-signature verification behaviour by setting the system property "net.corda.recordtransaction.signature.verification.disabled" to true upon node start-up.
class SignedTransaction
,
IllegalStateException@NotNull public static <T extends ContractState> StateAndRef<T> toStateAndRef(AppServiceHub $this, @NotNull StateRef stateRef)
Converts the given class StateRef
into a class StateAndRef
object.
TransactionResolutionException
- if stateRef
points to a non-existent transaction.class StateRef
,
class StateAndRef
@NotNull public static SignedTransaction signInitialTransaction(AppServiceHub $this, @NotNull TransactionBuilder builder, @NotNull java.security.PublicKey publicKey)
Helper method to construct an initial partially signed transaction from a class TransactionBuilder
using keys stored inside the node. Signature metadata is added automatically.
$this
- The class TransactionBuilder
to seal with the node's signature.Any existing signatures on the builder will be preserved.builder
- The PublicKey matched to the internal java.security.PrivateKey to use in signing this transaction.If the passed in key is actually a CompositeKey the code searches for the first child key hosted within this nodeto sign with.publicKey
- The PublicKey matched to the internal java.security.PrivateKey to use in signing this transaction.
If the passed in key is actually a CompositeKey the code searches for the first child key hosted within this node
to sign with.class TransactionBuilder
@NotNull public static SignedTransaction signInitialTransaction(AppServiceHub $this, @NotNull TransactionBuilder builder)
Helper method to construct an initial partially signed transaction from a TransactionBuilder using the default identity key contained in the node. The legal identity key is used to sign.
$this
- The TransactionBuilder to seal with the node's signature.Any existing signatures on the builder will be preserved.builder
- The TransactionBuilder to seal with the node's signature.
Any existing signatures on the builder will be preserved.@NotNull public static SignedTransaction signInitialTransaction(AppServiceHub $this, @NotNull TransactionBuilder builder, @NotNull java.lang.Iterable<? extends java.security.PublicKey> signingPubKeys)
Helper method to construct an initial partially signed transaction from a class TransactionBuilder
using a set of keys all held in this node.
$this
- The class TransactionBuilder
to seal with the node's signature.Any existing signatures on the builder will be preserved.builder
- A list of PublicKeys used to lookup the matching java.security.PrivateKey and sign.signingPubKeys
- A list of PublicKeys used to lookup the matching java.security.PrivateKey and sign.class SignedTransaction
with the new node signature attached.IllegalArgumentException
- is thrown if any keys are unavailable locally.class TransactionBuilder
@NotNull public static TransactionSignature createSignature(AppServiceHub $this, @NotNull SignedTransaction signedTransaction, @NotNull java.security.PublicKey publicKey)
Helper method to create an additional signature for an existing (partially) class SignedTransaction
. Additional
class SignatureMetadata
, including the
platform version used during signing and the cryptographic signature scheme use, is added to the signature.
$this
- The class SignedTransaction
to which the signature will apply.signedTransaction
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be usedfor signing.publicKey
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.
If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be used
for signing.class TransactionSignature
generated by signing with the internally held java.security.PrivateKey.class SignedTransaction
,
class SignatureMetadata
@NotNull public static TransactionSignature createSignature(AppServiceHub $this, @NotNull SignedTransaction signedTransaction)
Helper method to create a signature for an existing (partially) class SignedTransaction
using the default identity signing key of the node. The legal identity key is used to sign. Additional
class SignatureMetadata
, including the
platform version used during signing and the cryptographic signature scheme use, is added to the signature.
$this
- The SignedTransaction to which the signature will apply.signedTransaction
- The SignedTransaction to which the signature will apply.class SignedTransaction
,
class SignatureMetadata
@NotNull public static TransactionSignature createSignature(AppServiceHub $this, @NotNull FilteredTransaction filteredTransaction, @NotNull java.security.PublicKey publicKey)
Helper method to create a signature for a FilteredTransaction. Additional class SignatureMetadata
, including the
platform version used during signing and the cryptographic signature scheme use, is added to the signature.
$this
- the class FilteredTransaction
to which the signature will apply.filteredTransaction
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be usedfor signing.publicKey
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.
If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be used
for signing.class TransactionSignature
generated by signing with the internally held java.security.PrivateKey.class SignatureMetadata
@NotNull public static TransactionSignature createSignature(AppServiceHub $this, @NotNull FilteredTransaction filteredTransaction)
Helper method to create a signature for a FilteredTransaction
using the default identity signing key of the node. The legal identity key is used to sign. Additional
class SignatureMetadata
, including the platform version used during signing and the cryptographic signature scheme use,
is added to the signature.
$this
- the FilteredTransaction to which the signature will apply.filteredTransaction
- the FilteredTransaction to which the signature will apply.class TransactionSignature
generated by signing with the internally held identity java.security.PrivateKey.class SignatureMetadata
@NotNull public static SignedTransaction addSignature(AppServiceHub $this, @NotNull SignedTransaction signedTransaction, @NotNull java.security.PublicKey publicKey)
Helper method to append an additional signature to an existing (partially) class SignedTransaction
.
$this
- The class SignedTransaction
to which the signature will be added.signedTransaction
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be usedfor signing.publicKey
- The PublicKey matching to a signing java.security.PrivateKey hosted in the node.
If the PublicKey is actually a class CompositeKey
the first leaf key found locally will be used
for signing.class SignedTransaction
with the addition of the new signature.class SignedTransaction
@NotNull public static SignedTransaction addSignature(AppServiceHub $this, @NotNull SignedTransaction signedTransaction)
Helper method to append an additional signature for an existing (partially) class SignedTransaction
using the default identity signing key of the node.
$this
- The class SignedTransaction
to which the signature will be added.signedTransaction
- The class SignedTransaction
to which the signature will be added.class SignedTransaction
with the addition of the new signature.class SignedTransaction
@NotNull public static CordappContext getAppContext(AppServiceHub $this)
CordappProvider.getAppContext