ConnectionManagerImpl

class ConnectionManagerImpl(mercury: Mercury, castor: Castor, pluto: Pluto, val mediationHandler: MediationHandler, pairings: MutableList<DIDPair>, pollux: Pollux, experimentLiveModeOptIn: Boolean = false, scope: CoroutineScope = CoroutineScope(Dispatchers.IO)) : ConnectionManager, ConnectionsManager, DIDCommConnection(source)

ConnectionManager is responsible for managing connections and communication between entities.

Constructors

Link copied to clipboard
constructor(mercury: Mercury, castor: Castor, pluto: Pluto, mediationHandler: MediationHandler, pairings: MutableList<DIDPair>, pollux: Pollux, experimentLiveModeOptIn: Boolean = false, scope: CoroutineScope = CoroutineScope(Dispatchers.IO))

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

The instance of the MediationHandler interface used for handling mediation.

Functions

Link copied to clipboard
open suspend override fun addConnection(paired: DIDPair)

Adds a connection to the manager.

Link copied to clipboard
open suspend override fun awaitMessageResponse(id: String): Message?

Awaits a response to a specified message ID from the connection.

Link copied to clipboard
open suspend override fun awaitMessages(): Flow<Array<Pair<String, Message>>>

Awaits messages from the connection.

Link copied to clipboard
open suspend override fun registerMediator(host: DID)

Registers a mediator with the given host DID.

Link copied to clipboard
open suspend override fun removeConnection(pair: DIDPair): DIDPair?

Removes a connection from the manager.

Link copied to clipboard
open suspend override fun sendMessage(message: Message): Message?

Sends a message over the connection.

Link copied to clipboard
open override fun startFetchingMessages(requestInterval: Int)

Starts the process of fetching messages at a regular interval.

Link copied to clipboard
open suspend override fun startMediator()

Suspends the current coroutine and boots the registered mediator associated with the mediator handler. If no mediator is available, a EdgeAgentError.NoMediatorAvailableError is thrown.

Link copied to clipboard
open override fun stopConnection()

Stops a connection