net.corda.core.node.services / UniquenessProvider

# UniquenessProvider

`interface UniquenessProvider`

A service that records input states of the given transaction and provides conflict information if any of the inputs have already been used in another transaction.

A uniqueness provider is expected to be used from within the context of a flow.

### Types

Conflict | `data class Conflict` Specifies the consuming transaction for every conflicting state
ConsumingTx | `data class ConsumingTx` Specifies the transaction id, the position of the consumed state in the inputs, and the caller identity requesting the commit.

### Functions

commit | `abstract fun commit(states: List<StateRef>, txId: SecureHash, callerIdentity: Party): Unit` Commits all input states of the given transaction

### Inheritors

InMemoryUniquenessProvider | `class InMemoryUniquenessProvider : UniquenessProvider` A dummy Uniqueness provider that stores the whole history of consumed states in memory
PersistentUniquenessProvider | `class PersistentUniquenessProvider : UniquenessProvider, SingletonSerializeAsToken` A RDBMS backed Uniqueness provider
RaftUniquenessProvider | `class RaftUniquenessProvider : UniquenessProvider, SingletonSerializeAsToken` A uniqueness provider that records committed input states in a distributed collection replicated and persisted in a Raft cluster, using the Copycat framework (http://atomix.io/copycat/).