Package-level declarations

Types

Link copied to clipboard
abstract class AbstractAttachment(dataLoader: () -> ByteArray, val uploader: String?) : Attachment
Link copied to clipboard

Calculates the trust of attachments stored in the node.

Link copied to clipboard
data class AttachmentTrustInfo(val attachmentId: AttachmentId, val fileName: String?, val uploader: String?, val trustRootId: AttachmentId?, val trustRootFileName: String?)

Data class containing information about an attachment's trust root.

Link copied to clipboard
class AttachmentWithContext(val contractAttachment: ContractAttachment, val contract: ContractClassName, val whitelistedContractImplementations: Map<String, List<AttachmentId>>) : Attachment

Used only for passing to the Attachment constraint verification.

Link copied to clipboard

Implementation of TimedFlow that can handle WaitTimeUpdate messages. Any flow talking to the notary should implement this and use explicit send and this class's receiveResultOrTiming to receive the response to handle cases where the notary sends a timeout update.

Link copied to clipboard

Describes the Corda role a certificate is used for. This is used both to verify the hierarchy of certificates is correct, and to determine which is the well known identity's certificate.

Link copied to clipboard
Link copied to clipboard
class ContractUpgradeTransactionBuilder(val inputs: List<StateRef>, val notary: Party, val legacyContractAttachmentId: SecureHash, val upgradedContractClassName: ContractClassName, val upgradedContractAttachmentId: SecureHash, privacySalt: PrivacySalt = PrivacySalt(), val networkParametersHash: SecureHash, val digestService: DigestService = DigestService.sha2_256)
Link copied to clipboard
Link copied to clipboard
class DeclaredField<T>(clazz: Class<*>, name: String, receiver: Any?)

A simple wrapper around a Field object providing type safe read and write access using value, ignoring the field's visibility.

Link copied to clipboard

A digital signature with attached certificate of the public key and (optionally) the remaining chain of the certificates from the certificate path.

Link copied to clipboard
object Emoji

A simple wrapper class that contains icons and support for printing them only when we're connected to a terminal.

Link copied to clipboard

Given a set of hashes either loads from local storage or requests them from the other peer. Downloaded attachments are saved to local storage automatically.

Link copied to clipboard

An abstract flow for fetching typed data from a remote peer.

Link copied to clipboard

Given a set of hashes either loads from local network parameters storage or requests them from the other peer. Downloaded network parameters are saved to local parameters storage automatically. This flow can be used only if the minimumPlatformVersion is >= PlatformVersionSwitches.FETCH_MISSING_NETWORK_PARAMETERS. Nodes on lower versions won't respond to this flow.

Link copied to clipboard
class FetchTransactionsFlow constructor(requests: Set<SecureHash>, otherSide: FlowSession, dataType: FetchDataFlow.DataType = DataType.TRANSACTION) : FetchDataFlow<SignedTransaction, SignedTransaction>

Given a set of tx hashes (IDs), either loads them from local disk or asks the remote peer to provide them.

Link copied to clipboard
interface FlowAsyncOperation<R : Any>

Interface for arbitrary operations that can be invoked in a flow asynchronously - the flow will suspend until the operation completes. Operation parameters are expected to be injected via constructor.

Link copied to clipboard
sealed class FlowIORequest<out R : Any>

A FlowIORequest represents an IO request of a flow when it suspends. It is persisted in checkpoints.

Link copied to clipboard

This is an internal interface that is implemented by code in the node module. You should look at FlowLogic.

Link copied to clipboard
Link copied to clipboard
interface IdempotentFlow

A marker for a flow that will return the same result if replayed from the beginning. Any side effects the flow causes must also be idempotent.

Link copied to clipboard
class InheritableThreadLocalToggleField<T>(name: String, log: <Error class: unknown class> = staticLog, isAGlobalThreadBeingCreated: (Array<StackTraceElement>) -> Boolean) : ToggleField<T>
Link copied to clipboard
data class InputStreamAndHash(val inputStream: InputStream, val sha256: SecureHash.SHA256)
Link copied to clipboard

Utility class which provides the ability to extract a list of signing parties from a JarInputStream.

Link copied to clipboard
class LazyMappedList<T, U>(val originalList: List<T>, val transform: (T, Int) -> U)

List implementation that applies the expensive transform function only when the element is accessed and caches calculated values. Size is very cheap as it doesn't call transform. Used internally by net.corda.core.transactions.TraversableTransaction.

Link copied to clipboard
class LazyPool<A>(clear: (A) -> Unit? = null, shouldReturnToPool: (A) -> Boolean? = null, bound: Int? = null, newInstance: () -> A)

A lazy pool of resources A.

Link copied to clipboard
class LazyStickyPool<A : Any>(size: Int, newInstance: () -> A)

A LazyStickyPool is a lazy pool of resources where a borrow may "stick" the borrowed instance to an object. Any subsequent borrows using the same object will return the same pooled instance.

Link copied to clipboard
Link copied to clipboard
class LifeCycle<S : Enum<S>>(initial: S)

This class provides simple tracking of the lifecycle of a service-type object. S is an enum enumerating the possible states the service can be in.

Link copied to clipboard

Allow extra functionality to be injected to our caches.

Link copied to clipboard
class NotaryChangeTransactionBuilder(val inputs: List<StateRef>, val notary: Party, val newNotary: Party, val networkParametersHash: SecureHash, val digestService: DigestService = DigestService.sha2_256)
Link copied to clipboard
Link copied to clipboard

Resolves transactions for the specified txHashes along with their full history (dependency graph) from otherSide. Each retrieved transaction is validated and inserted into the local transaction storage.

Link copied to clipboard
data class ResolveTransactionsFlowStats(val resolvableTransactionHashesCount: Long = 0, val downloadedDependencyCount: Long = 0, val recordedTransactionCount: Long = 0, val skippedRecordingTransactionCount: Long = 0)
Link copied to clipboard

This is a wildcard payload to be used by the invoker of the DataVendingFlow to allow unlimited access to its vault.

Link copied to clipboard
data class SerializedStateAndRef(val serializedState: SerializedTransactionState, val ref: StateRef)

A SerializedStateAndRef is a pair (BinaryStateRepresentation, StateRef). The serializedState is the actual component from the original wire transaction.

Link copied to clipboard

Similar to SignedData but instead of just attaching the public key, the certificate for the key is attached instead.

Link copied to clipboard
class SimpleToggleField<T>(name: String, once: Boolean = false) : ToggleField<T>
Link copied to clipboard

Uses reflection to search for instances of StatePointer within a ContractState. TODO: Doesn't handle calculated properties. Add support for this.

Link copied to clipboard
class ThreadBox<out T>(val content: T, val lock: ReentrantLock = ReentrantLock())

A threadbox is a simple utility that makes it harder to forget to take a lock before accessing some shared state. Simply define a private class to hold the data that must be grouped under the same lock, and then pass the only instance to the ThreadBox constructor. You can now use the locked method with a lambda to take the lock in a way that ensures it'll be released if there's an exception.

Link copied to clipboard

The named thread has leaked from a previous test.

Link copied to clipboard
Link copied to clipboard

An idempotent flow that needs to be replayed if it does not complete within a certain timeout.

Link copied to clipboard
abstract class ToggleField<T>(val name: String)

May go from null to non-null and vice-versa, and that's it.

Link copied to clipboard

x Exception raised if an error was encountered while attempting to deserialise a component group in a transaction.

Link copied to clipboard
Link copied to clipboard
typealias Version = Int

Contract version and flow versions are integers.

Link copied to clipboard

The annotated object would have a more restricted visibility were it not needed in tests.

Link copied to clipboard
class WaitForStateConsumption(val stateRefs: Set<StateRef>, val services: ServiceHub) : FlowAsyncOperation<Unit>

An FlowAsyncOperation which suspends a flow until the provided StateRefs have been updated.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The configured instance of DigestService which is passed by default to instances of classes like TransactionBuilder and as a parameter to MerkleTree.getMerkleTree(...) method. Default: SHA2_256.

Link copied to clipboard
Link copied to clipboard

Returns a name of the external operation implementation considering that it can wrapped by WrappedFlowExternalAsyncOperation or WrappedFlowExternalOperation

Link copied to clipboard

Calculate the hash of the contents of this file.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Similar to KClass.objectInstance but also works on private objects.

Link copied to clipboard
val <Error class: unknown class>.level: <Error class: unknown class>
Link copied to clipboard

Returns the location of this class.

The maximum number of keys in a signature constraint that the platform supports.

Link copied to clipboard
Link copied to clipboard
const val P2P_UPLOADER: String
Link copied to clipboard

Convenience method to get the package name of a class literal.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val PLATFORM_VERSION: Int = 140
Link copied to clipboard

Obtain the typename of the required ContractClass associated with the target ContractState, using the BelongsToContract annotation by default, but falling through to checking the state's enclosing class if there is one and it inherits from Contract.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val RPC_UPLOADER: String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val TRUSTED_UPLOADERS: <Error class: unknown class>
Link copied to clipboard

Functions

Link copied to clipboard
fun String.abbreviate(maxWidth: Int): String
Link copied to clipboard
Link copied to clipboard
fun <T> <Error class: unknown class><T>.bufferUntilSubscribed(): <Error class: unknown class><T>

Returns an Observable that buffers events until subscribed.

Link copied to clipboard

This method will be used in conjunction with NoConstraintPropagation. It is run during transaction verification when the contract is not annotated with NoConstraintPropagation. When constraints propagation is enabled, constraints set on output states need to follow certain rules with regards to constraints of input states.

Link copied to clipboard
Link copied to clipboard
fun <T> Class<T>.castIfPossible(obj: Any): T?
Link copied to clipboard
fun checkMinimumPlatformVersion(minimumPlatformVersion: Int, requiredMinPlatformVersion: Int, feature: String)
Link copied to clipboard
Link copied to clipboard
fun FlowLogic<*>.checkParameterHash(networkParametersHash: SecureHash?)

Check that network parameters hash on this transaction is the current hash for the network.

Link copied to clipboard
Link copied to clipboard
fun combinedHash(components: Iterable<SecureHash>, digestService: DigestService): SecureHash

Concatenates the hash components into a single ByteArray and returns its hash.

Link copied to clipboard
Link copied to clipboard

See overload of Files.copy which takes in an InputStream.

fun InputStream.copyTo(target: Path, vararg options: CopyOption): Long
Link copied to clipboard
fun Path.copyToDirectory(targetDir: Path, vararg options: CopyOption): Path

Copy the file into the target directory using Files.copy.

Link copied to clipboard
fun createComponentGroups(inputs: List<StateRef>, outputs: List<TransactionState<ContractState>>, commands: List<Command<*>>, attachments: List<SecureHash>, notary: Party?, timeWindow: TimeWindow?, references: List<StateRef>, networkParametersHash: SecureHash?, legacyAttachments: List<SecureHash> = emptyList()): List<ComponentGroup>
Link copied to clipboard
fun <T : Any> createInstancesOfClassesImplementing(classloader: ClassLoader, clazz: Class<T>, classVersionRange: IntRange? = null): Set<T>

Creates instances of all the classes in the classpath of the provided classloader, which implement the interface of the provided class.

Link copied to clipboard
fun <K, V> createSimpleCache(maxSize: Int, onEject: (MutableMap.MutableEntry<K, V>) -> Unit = {}): MutableMap<K, V>
Link copied to clipboard
Link copied to clipboard

Returns a DeclaredField wrapper around the declared (possibly non-public) instance field of the receiver object.

fun <T> Any.declaredField(clazz: Class<*>, name: String): DeclaredField<T>
fun <T> Any.declaredField(clazz: KClass<*>, name: String): DeclaredField<T>

Returns a DeclaredField wrapper around the (possibly non-public) instance field of the receiver object, but declared in its superclass clazz.

Link copied to clipboard

Deletes this path (if it exists) and if it's a directory, all its child paths recursively.

Link copied to clipboard
fun deserialiseCommands(componentGroups: List<ComponentGroup>, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = factory.defaultContext, digestService: DigestService = DigestService.sha2_256): List<Command<*>>

Method to deserialise Commands from its two groups:

Link copied to clipboard
fun <T : Any> deserialiseComponentGroup(componentGroups: List<ComponentGroup>, clazz: KClass<T>, groupEnum: ComponentGroupEnum, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = factory.defaultContext): List<T>

This function knows how to deserialize a transaction component group.

Link copied to clipboard
operator fun Duration.div(divider: Long): Duration
Link copied to clipboard
fun <T> List<T>.eagerDeserialise(onError: (TransactionDeserialisationException, Int) -> T? = { ex, _ -> throw ex })

Iterate over a LazyMappedList, forcing it to transform all of its elements immediately. This transformation is assumed to be "deserialisation". Does nothing for any other kind of List. WARNING: Any changes made to the LazyMappedList contents are PERMANENT!

Link copied to clipboard
inline fun elapsedTime(block: () -> Unit): Duration

Executes the given code block and returns a Duration of how long it took to execute in nanosecond precision.

Link copied to clipboard
fun ServicesForResolution.ensureMinimumPlatformVersion(requiredMinPlatformVersion: Int, feature: String)
Link copied to clipboard
fun JarInputStream.entries(): <Error class: unknown class><JarEntry>
Link copied to clipboard
Link copied to clipboard
fun <T, R : Any> FlowLogic<T>.executeAsync(operation: FlowAsyncOperation<R>, maySkipCheckpoint: Boolean = false): R

Executes the specified operation and suspends until operation completion.

Link copied to clipboard
fun <T> executeWithThreadContextClassLoader(classloader: ClassLoader, fn: () -> T): T
Link copied to clipboard
Link copied to clipboard
inline fun <T, R> Collection<T>.flatMapToSet(transform: (T) -> Iterable<R>): Set<R>

Similar to Iterable.flatMap except it maps to a Set which preserves the iteration order.

Link copied to clipboard
Link copied to clipboard
fun <T : Any> getNamesOfClassesImplementing(classloader: ClassLoader, clazz: Class<T>, classVersionRange: IntRange? = null): Set<String>

Scans for all the non-abstract classes in the classpath of the provided classloader which implement the interface of the provided class.

Link copied to clipboard

Returns the public key of the package owner of the contractClassName, or null if not owned.

Link copied to clipboard
Link copied to clipboard
fun getRequiredSigningKeysInternal(inputs: <Error class: unknown class><StateAndRef<*>>, notary: Party?): Set<PublicKey>
Link copied to clipboard
inline fun <K, V> Iterable<V>.groupByMultipleKeys(keysSelector: (V) -> Iterable<K>, onDuplicate: (K, V, V) -> Unit = { key, value1, value2 -> throw IllegalArgumentException("Duplicate mapping for $key ($value1, $value2)") }): Map<K, V>

Map the elements of the Iterable to multiple keys. By default duplicate mappings are not allowed. The returned Map preserves the iteration order of the values.

Link copied to clipboard

Calculate the hash of the remaining bytes in this input stream. The stream is closed at the end.

Link copied to clipboard
fun <T> List<T>.indexOfOrThrow(item: T): Int

Returns the index of the given item or throws IllegalArgumentException if not found.

Link copied to clipboard

Checks equality between the two X500Principal instances ignoring the ordering of the X500Name parts.

Link copied to clipboard

Checks if this flow is an idempotent flow.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Analogous to Thread.join.

Link copied to clipboard
fun <T, U> List<T>.lazyMapped(transform: (T, Int) -> U): List<U>

Returns a List implementation that applies the expensive transform function only when an element is accessed and then caches the calculated values. Size is very cheap as it doesn't call transform.

Link copied to clipboard
inline fun <T> loadClassOfType(className: String, initialize: Boolean = true, classLoader: ClassLoader? = null): Class<out T>
fun <T> loadClassOfType(type: Class<T>, className: String, initialize: Boolean = true, classLoader: ClassLoader? = null): Class<out T>
Link copied to clipboard
fun <T> logElapsedTime(label: String, logger: <Error class: unknown class>? = null, body: () -> T): T
Link copied to clipboard
fun <T> <Error class: unknown class>.logElapsedTime(label: String, body: () -> T): T
Link copied to clipboard
inline fun <T, R : Any> Stream<T>.mapNotNull(crossinline transform: (T) -> R?): Stream<R>
Link copied to clipboard
inline fun <T, R> Collection<T>.mapToSet(transform: (T) -> R): Set<R>

Similar to Iterable.map except it maps to a Set which preserves the iteration order.

Link copied to clipboard
fun min(d1: Duration, d2: Duration): Duration
Link copied to clipboard
fun <T> List<T>.noneOrSingle(): T?

Returns the single element, or null if the list is empty, or throws an exception if it has more than one element.

inline fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T?

Returns the single element matching the given predicate, or null if the collection is empty, or throws exception if more than one element was found.

Link copied to clipboard
Link copied to clipboard

creates a new instance if not a Kotlin object

Link copied to clipboard
Link copied to clipboard
fun <Error class: unknown class>.pooledScan(): <Error class: unknown class>

Use this rather than the built-in implementation of ClassGraph.scan. The built-in implementation creates a thread pool every time, resulting in too many threads. This one uses a mutex to restrict concurrency.

Link copied to clipboard
fun URL.post(serializedData: OpaqueBytes, vararg properties: <Error class: unknown class><String, String>, proxy: Proxy? = null): ByteArray
Link copied to clipboard
inline fun <R> Path.read(vararg options: OpenOption, block: (InputStream) -> R): R

Same as inputStream except it also closes the InputStream.

Link copied to clipboard

Same as InputStream.readBytes but also closes the stream.

Link copied to clipboard
inline fun <T : Any> InputStream.readObject(): T

inline fun <T : Any> Path.readObject(): T

Read in this file as an AMQP serialised blob of type T.

Link copied to clipboard

Check if a string is a legal Java package name.

Link copied to clipboard
inline fun <T : Any> HttpURLConnection.responseAs(): T
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns a DeclaredField wrapper around the declared (possibly non-public) static field of the receiver Class.

Returns a DeclaredField wrapper around the declared (possibly non-public) static field of the receiver KClass.

Link copied to clipboard
fun IntProgression.stream(parallel: Boolean = false): IntStream
Link copied to clipboard
fun <T> <Error class: unknown class><T>.tee(vararg teeTo: <Error class: unknown class><T>): <Error class: unknown class><T>

Copy an Observer to multiple other Observers.

Link copied to clipboard
operator fun Duration.times(multiplicand: Double): Duration
operator fun Duration.times(multiplicand: Long): Duration
Link copied to clipboard
fun X500Principal.toAttributesMap(supportedAttributes: Set<<Error class: unknown class>> = emptySet()): Map<<Error class: unknown class>, String>

Transforms the X500Principal to the attributes map.

Link copied to clipboard
fun <K, V> Iterable<<Error class: unknown class><K, V>>.toMultiMap(): Map<K, List<V>>
Link copied to clipboard
fun URL.toPath(): Path
Link copied to clipboard
fun <T> Stream<T>.toSet(): Set<T>

Similar to Collectors.toSet except the Set is guaranteed to be ordered.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> Stream<out T>.toTypedArray(): Array<out T?>?
Link copied to clipboard
fun X500Principal.toX500Name(): <Error class: unknown class>

Converts the X500Principal instance to the X500Name object.

fun CordaX500Name.toX500Name(): <Error class: unknown class>

Return the underlying X.500 name from this Corda-safe X.500 name. These are guaranteed to have a consistent ordering, such that their toString() function returns the same value every time for the same CordaX500Name.

Link copied to clipboard
fun <T, U : T> uncheckedCast(obj: T): U
Link copied to clipboard
infix fun Temporal.until(endExclusive: Temporal): Duration
Link copied to clipboard
fun CertPath.validate(trustAnchors: Set<TrustAnchor>, checkRevocation: Boolean = false): PKIXCertPathValidatorResult
Link copied to clipboard
fun <Error class: unknown class>.warnOnce(warning: String)

Utility to help log a warning message only once. It implements an ad hoc Fifo cache because there's none available in the standard libraries.

Link copied to clipboard
inline fun Path.write(createDirs: Boolean = false, vararg options: OpenOption = emptyArray(), block: (OutputStream) -> Unit)

Same as outputStream except it also closes the OutputStream.