PlutoImpl

class PlutoImpl(connection: DbConnection) : Pluto(source)

PlutoImpl is a class that provides an implementation of the Pluto interface for interacting with the database.

Constructors

Link copied to clipboard
constructor(connection: DbConnection)

Properties

Link copied to clipboard

isConnected indicates whether the connection to the database is currently established or not.

Functions

Link copied to clipboard

Retrieves all credentials for credential recovery.

Link copied to clipboard
Link copied to clipboard
open override fun getAllDidPairs(): Flow<List<DIDPair>>

Retrieves all the pairs of DIDs stored in the system.

Link copied to clipboard
open override fun getAllDIDs(): Flow<List<DID>>

Retrieves all DIDs.

Link copied to clipboard

Retrieves all the keys for backup.

Link copied to clipboard
open override fun getAllMediators(): Flow<List<Mediator>>

Returns a Flow of lists of Mediator objects representing all the available mediators.

Link copied to clipboard
open override fun getAllMessages(): Flow<List<Message>>

Retrieves all the messages.

open override fun getAllMessages(did: DID): Flow<List<Message>>

Retrieves all messages based on the provided DID.

open override fun getAllMessages(from: DID, to: DID): Flow<List<Message>>

Retrieves all messages exchanged between the specified 'from' and 'to' DIDs.

Link copied to clipboard
open override fun getAllMessagesByType(type: String): Flow<List<Message>>

Retrieves all the messages of the provided type.

Link copied to clipboard
open override fun getAllMessagesOfType(type: String, relatedWithDID: DID?): Flow<List<Message>>

Retrieves all messages of a specific type that are related to a given DID.

Link copied to clipboard
open override fun getAllMessagesReceived(): Flow<List<Message>>

Retrieves all messages received by the user.

Link copied to clipboard
open override fun getAllMessagesReceivedFrom(did: DID): Flow<List<Message>>

Returns a Flow of lists of all messages received from the specified DID.

Link copied to clipboard
open override fun getAllMessagesSent(): Flow<List<Message>>

Retrieves all the messages that have been sent.

Link copied to clipboard
open override fun getAllMessagesSentTo(did: DID): Flow<List<Message>>

Retrieves all messages sent to the specified DID.

Link copied to clipboard
open override fun getAllPeerDIDs(): Flow<List<PeerDID>>

Retrieves all PeerDIDs.

Link copied to clipboard
open override fun getAllPrismDIDs(): Flow<List<PrismDIDInfo>>

Retrieves all PrismDIDs and their associated information.

Link copied to clipboard

Retrieves a list of all private keys.

Link copied to clipboard
open override fun getAvailableClaimsByClaim(claim: String): Flow<Array<AvailableClaims>>

Retrieves the available claims for a given claim.

Link copied to clipboard
open override fun getAvailableClaimsByCredentialId(credentialId: String): Flow<Array<AvailableClaims>>

Retrieves the available claims for a given credential ID.

Link copied to clipboard
open override fun getCredentialMetadata(linkSecretName: String): Flow<CredentialRequestMeta?>

Retrieves the metadata associated with a credential request.

Link copied to clipboard
open override fun getDIDInfoByAlias(alias: String): Flow<List<PrismDIDInfo>>

Retrieves the PrismDIDInfo objects associated with a given alias.

Link copied to clipboard
open override fun getDIDInfoByDID(did: DID): Flow<PrismDIDInfo?>

Retrieves the PrismDIDInfo associated with a given DID.

Link copied to clipboard

Retrieves the private key associated with a given ID.

Link copied to clipboard

Retrieves a list of private keys associated with a given DID.

Link copied to clipboard
open override fun getLinkSecret(): Flow<String?>

Retrieves the secret link associated with the current instance.

Link copied to clipboard
open override fun getMessage(id: String): Flow<Message?>

Retrieves the message with the specified ID.

Link copied to clipboard
open override fun getMessageByThidAndPiuri(thid: String, piuri: String): Flow<Message?>

Retrieves the message with the specified thid.

Link copied to clipboard
open override fun getPairByDID(did: DID): Flow<DIDPair?>

Retrieves a DIDPair object using the provided DID.

Link copied to clipboard
open override fun getPairByName(name: String): Flow<DIDPair?>

Retrieve a DIDPair from a flow by its name.

Link copied to clipboard
open override fun getPrismDIDKeyPathIndex(did: DID): Flow<Int?>

Retrieves the key path index associated with a given Prism DID.

Link copied to clipboard
open override fun getPrismLastKeyPathIndex(): Flow<Int>

Retrieves the last key path index associated with the Prism DID.

Link copied to clipboard
open override fun insertAvailableClaim(credentialId: String, claim: String)

Inserts an available claim for a specific credential.

Link copied to clipboard
open override fun insertAvailableClaims(credentialId: String, claims: Array<String>)

Inserts the available claims for a given credential ID.

Link copied to clipboard

Provides a flow to listen for revoked credentials.

Link copied to clipboard
open override fun revokeCredential(credentialId: String)

Revokes an existing credential using the credential ID.

Link copied to clipboard
open suspend override fun start(context: Any?)

Starts the database service.

Link copied to clipboard
fun stop()

Closes the connection to the database.

Link copied to clipboard
open override fun storeCredential(storableCredential: StorableCredential)

Stores a credential in the system.

Link copied to clipboard
open override fun storeCredentialMetadata(name: String, metadata: CredentialRequestMeta)
open override fun storeCredentialMetadata(name: String, linkSecretName: String, json: String)

Stores the metadata associated with a credential request.

Link copied to clipboard
open override fun storeDIDPair(host: DID, receiver: DID, name: String)

Stores a pair of Distributed Identifier (DID) and a receiver DID with a given name.

Link copied to clipboard
open override fun storeLinkSecret(linkSecret: String)

Stores a link secret in the system.

Link copied to clipboard
open override fun storeMediator(mediator: DID, host: DID, routing: DID)

Stores a mediator in the system.

Link copied to clipboard
open override fun storeMessage(message: Message)

Stores a message in the system.

Link copied to clipboard
open override fun storeMessages(messages: List<Message>)

Stores a list of messages in the system.

Link copied to clipboard
open override fun storePeerDID(did: DID)

Stores the PeerDID in the system.

Link copied to clipboard
open override fun storePrismDIDAndPrivateKeys(did: DID, keyPathIndex: Int?, alias: String?, privateKeys: List<StorableKey>)

Stores the Prism DID, key path index, alias, and private keys.

Link copied to clipboard
open override fun storePrivate(sorableKey: StorableKey, recoveryId: String)

Stores a private key with its recovery ID.

Link copied to clipboard
open override fun storePrivateKeys(storableKey: StorableKey, did: DID, keyPathIndex: Int?, metaId: String?)

Stores the private key along with additional information.