BasicMediatorHandler

class BasicMediatorHandler(val mediatorDID: DID, mercury: Mercury, store: MediatorRepository) : MediationHandler(source)

A class that provides an implementation of MediationHandler using a Pluto instance and a Mercury instance. It can be used to register, retrieve and update mediator information, achieve mediation, pick up unread messages, and register messages as read.

Constructors

Link copied to clipboard
constructor(mediatorDID: DID, mercury: Mercury, store: MediatorRepository)

Types

Link copied to clipboard

A class that provides an implementation of MediatorRepository using a Pluto instance.

Properties

Link copied to clipboard
open override var mediator: Mediator?

The active mediator associated with the mediator handler

Link copied to clipboard
open override val mediatorDID: DID

The DID of the mediator associated with the mediator handler

Functions

Link copied to clipboard
open override fun achieveMediation(host: DID): Flow<Mediator>

Achieves mediation with the mediatorDID with the specified host DID as a user.

Link copied to clipboard
open suspend override fun bootRegisteredMediator(): Mediator?

Boots the registered mediator associated with the mediator handler.

Link copied to clipboard
open suspend override fun listenUnreadMessages(serviceEndpointUri: String, onMessageCallback: OnMessageCallback)

Listens for unread messages from a specified WebSocket service endpoint.

Link copied to clipboard
open override fun pickupUnreadMessages(limit: Int): Flow<Array<Pair<String, Message>>>

Picks up the specified number of unread messages.

Link copied to clipboard
open suspend override fun registerMessagesAsRead(ids: Array<String>)

Registers the specified message IDs as read.

Link copied to clipboard
open suspend override fun updateKeyListWithDIDs(dids: Array<DID>)

Updates the key list with the specified DIDs.