PrivmxEndpoint

class PrivmxEndpoint @JvmOverloads constructor(enableModule: Set<Modules>, userPrivateKey: String, solutionId: String, bridgeUrl: String, verificationOptions: PKIVerificationOptions? = null) : BasicPrivmxEndpoint, AutoCloseable

Extends BasicPrivmxEndpoint with event callbacks dispatcher.

Parameters

enableModule

set of modules to initialize; should contain Modules.THREAD to enable Thread module or Modules.STORE to enable Store module

bridgeUrl

Bridge Server URL

solutionId

SolutionId of the current project

userPrivateKey

user private key used to authorize; generated from: CryptoApi.generatePrivateKey or CryptoApi.derivePrivateKey2

verificationOptions

PrivMX Bridge server instance verification options using a PKI server

Throws

thrown if there is an exception during init modules

thrown if there is a problem during login

thrown if there is an unknown problem during login

Constructors

Link copied to clipboard
constructor(enableModule: Set<Modules>, userPrivateKey: String, solutionId: String, bridgeUrl: String, verificationOptions: PKIVerificationOptions? = null)

Properties

Link copied to clipboard

Reference to Connection module.

Link copied to clipboard

Reference to CustomEvent module.

Link copied to clipboard

Reference to Inbox module.

Link copied to clipboard

Reference to KVDB module.

Link copied to clipboard

Reference to Store module.

Link copied to clipboard

Reference to Thread module.

Functions

Link copied to clipboard
open override fun close()

Disconnects from PrivMX Bridge and frees memory.

Link copied to clipboard
suspend fun handleEvent(event: Event<out Any>)

Handles event and invokes all related callbacks. It should only be called by event loops.

Link copied to clipboard
suspend fun <T : Any> registerCallback(callbackGroup: Any, eventType: EventType<T>, callback: EventCallback<T>): RegistrationResult

Registers single callback for a specified event type. If you need to register multiple callbacks simultaneously, consider using the registerManyCallbacks.

Link copied to clipboard
suspend fun registerManyCallbacks(vararg registrations: CallbackRegistration<out Any>): List<RegistrationResult>

Registers multiple callbacks in a batch. This method allows for the registration of several event listeners at once, which is more efficient than registering each callback individually, because the number of requests can be minimized.

Link copied to clipboard
suspend fun unregisterAll()

Unregisters all callbacks registered by registerCallback.

Link copied to clipboard
suspend fun unregisterCallbacks(vararg callbackGroups: Any)

Unregisters all callbacks associated with the given group references.