Package-level declarations

Types

Link copied to clipboard

Defines all APIs for managing the hub-account, this includes the registration phase.

Link copied to clipboard

A builder for address DSL. To create an instance of builder, use Address factory function.

Link copied to clipboard

Defines APIs to create upload and download attachment URL.

Link copied to clipboard
annotation class BlockingBridgeApi

Marks declarations in SDK-Hub API that are blocking bridges between suspended and non-suspended code — they have limited use-case and shall be used with care in general code. Carefully read documentation of any declaration marked as BlockingBridgeApi.

Link copied to clipboard

Defines all the APIs for the contact discovery.

Link copied to clipboard

Defines all the APIs for discovering and managing the user's devices. Also, it extends the registration phase when the user's msisdn has already a registered account.

Link copied to clipboard
typealias EmptyPayload = Payload

A marker which indicates the Payload is empty.

Link copied to clipboard

Defines a strategy for bridging non-blocking with blocking code.

Link copied to clipboard

The HubRSocketClient provides an abstraction over the RSocket implementation, to interact with the hub-server's RSocket APIs.

Link copied to clipboard

A builder class for HubRSocketClient DSL. To create an instance of builder, use HubRSocketClient factory function.

Link copied to clipboard
typealias HubRSocketConnector = RSocketConnector

The rsocket-connector which the HubRSocketClient will be based on.

Link copied to clipboard
typealias HubRSocketConnectorBuilder = RSocketConnectorBuilder

A builder class for HubRSocketConnector DSL. To create an instance of builder, use HubRSocketConnector factory function.

Link copied to clipboard

A wrapper around HubRSocketConnector to provide a more Java friendly API.

Link copied to clipboard

HubServerRSocketInstance is used to specify the hub-server instance which the client will connect on. It encapsulates the ServerClient which this client represents and the address of the hub-server's instance.

Link copied to clipboard
data class InetSocketAddress(val hostname: String, val port: Int)

Represents a socket address.

Link copied to clipboard
class KeepAlive @JvmOverloads constructor(intervalMillis: Int = 20 * 1000, maxLifetimeMillis: Int = 90 * 1000)

Represents the time internal for KEEPALIVE frames.

Link copied to clipboard

Defines the core APIs to send and retrieve messages.

Link copied to clipboard
typealias MimeType = io.rsocket.kotlin.core.MimeType

The root of hierarchy of all mime-types.

Link copied to clipboard
typealias MimeTypeWithName = io.rsocket.kotlin.core.MimeTypeWithName

Represents a mime-type with name. We can use it to access the MimeType through text (see MimeType).

Link copied to clipboard
typealias PayloadMimeType = io.rsocket.kotlin.payload.PayloadMimeType

Represents the Encoding MIME Type for encoding of Data and Metadata.

Link copied to clipboard
class ReconnectPredicate(val cause: Throwable, val attempt: Long)

Represents the predicate for retry logic.

Link copied to clipboard

Defines APIs for the registration phase. The registration phase is the main entry point to imahub's services, where one should retrieve his imahub-uuid at the end of it.

Link copied to clipboard

Defines APIs for configuring a server-client. These APIs can be used after authorization phase by a server-client to configure his capabilities.

Link copied to clipboard
class SetupPayload @JvmOverloads constructor(data: ByteReadPacket, metadata: ByteReadPacket? = null) : Closeable

Represents the Setup Frame that is sent by the client to inform the server of the parameters under which it desires to operate.

Link copied to clipboard

Defines all the APIs for managing the signal-protocol compliant keys.

Link copied to clipboard
typealias WellKnownMimeType = io.rsocket.kotlin.core.WellKnownMimeType

Predefined well-known mime-types (see MimeType).

Functions

Link copied to clipboard
fun Address(builderAction: AddressBuilder.() -> Unit): InetSocketAddress

A builder function for creating an address.

Link copied to clipboard

Blocking-call variant of SignalKeys.countKeys.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "deleteAccount")
fun Accounts.blockingDeleteAccount(targetAccount: UUID)

Blocking-call variant of Accounts.deleteAccount.

Link copied to clipboard

Blocking-call variant of Contacts.getContacts.

Link copied to clipboard

Blocking-call variant of Contacts.getContacts.

Link copied to clipboard

Blocking-call variant of Devices.getDevices.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "from")
fun blockingHubRSocketClient(hubInstance: HubServerRSocketInstance, connector: HubServerConnector, context: CoroutineContext = getHubClientCoroutineContext()): HubRSocketClient

A blocking builder function for creating a HubRSocketClient.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "verifyRetrievedMessage")
fun Messages.blockingVerifyRetrievedMessage(messageId: Int)

Blocking-call variant of Messages.verifyRetrievedMessage.

Link copied to clipboard

Configures HubRSocketConnector to be compatible with hub-server and stores client-name, jwt token with proper mimeType.

Link copied to clipboard
fun RSocketConnectorBuilder.ConnectionConfigBuilder.configureSetupPayload(clientName: String, jwt: String)

Configures setupPayload to store clientName and jwt token in proper format.

Link copied to clipboard
Link copied to clipboard
fun Contacts.getContacts(msisdnNumbers: Flux<Msisdn>): Flux<HubPayload<Contact>>

Flux variant of Contacts.getContacts stream.

Link copied to clipboard

Returns the hub-client's CoroutineContext strategy.

Link copied to clipboard
suspend fun HubRSocketClient(client: ServerClient, builderAction: HubRSocketClientBuilder.() -> Unit): HubRSocketClient
suspend fun HubRSocketClient(clientName: String, builderAction: HubRSocketClientBuilder.() -> Unit): HubRSocketClient

A builder function for creating a HubRSocketClient.

Link copied to clipboard

A builder function for creating HubRSocketConnector.

Link copied to clipboard

Set-ups the configuration to be compatible with hub-server.

Link copied to clipboard
@JvmName(name = "createHubServerConnector")
fun HubServerConnector(reconnectPredicate: ReconnectPredicate? = null, keepAlive: KeepAlive? = null, payloadMimeType: PayloadMimeType? = springServerMimeTypeConfig(), setupPayload: SetupPayload? = null): HubServerConnector

A factory function for creating a HubServerConnector with the given parameters.

Link copied to clipboard

A factory function for creating a PayloadMimeType with data and metadata as MimeTypeWithName.

Link copied to clipboard
fun <T> HubClientCoroutineContextStrategy.runBlockingWithContext(block: suspend CoroutineScope.() -> T): T

Runs a new coroutine in HubClientCoroutineContextStrategy.clientCoroutineContext context and blocks the current thread until its completion. This function should not be used from a coroutine.

Link copied to clipboard
@JvmName(name = "createSetupPayload")
fun SetupPayload(data: ByteArray, metadata: ByteArray? = null): SetupPayload

A factory function for creating SetupPayload with data and metadata as ByteArray.

@JvmName(name = "createSetupPayload")
fun SetupPayload(data: String, metadata: String? = null): SetupPayload

A factory function for creating SetupPayload with data and metadata as String.

Link copied to clipboard

By default, springboot's RSocket implementations is using mime-type metadata of MessageRSocketCompositeMetadata.

Link copied to clipboard
suspend fun Messages.streamMessages(messages: Flow<Message>)

Streams messages to hub-server.

fun Messages.streamMessages(messages: Flux<Message>)

Flux variant of Messages.streamMessages.