StoreApi

expect class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

actual class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

actual class StoreApi(connection: Connection) : AutoCloseable

Manages PrivMX Bridge Stores and Files.

Parameters

connection

active connection to PrivMX Bridge

Throws

when given Connection is not connected

Constructors

Link copied to clipboard
expect constructor(connection: Connection)
actual constructor(connection: Connection)
actual constructor(connection: Connection)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
expect fun buildSubscriptionQuery(eventType: StoreEventType, selectorType: StoreEventSelectorType, selectorId: String): String

Generate subscription Query for the Store events.

actual fun buildSubscriptionQuery(eventType: StoreEventType, selectorType: StoreEventSelectorType, selectorId: String): String

Generate subscription Query for the Store events.

actual fun buildSubscriptionQuery(eventType: StoreEventType, selectorType: StoreEventSelectorType, selectorId: String): String

Generate subscription Query for the Store events.

Link copied to clipboard
expect open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

actual open override fun close()

Frees memory.

Link copied to clipboard
expect fun closeFile(fileHandle: Long): String

Closes the file handle.

actual fun closeFile(fileHandle: Long): String

Closes the file handle.

actual external fun closeFile(fileHandle: Long): String

Closes the file handle.

Link copied to clipboard
expect fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long, randomWriteSupport: Boolean = false): Long?

Creates a new file in a Store.

actual fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long, randomWriteSupport: Boolean): Long?

Creates a new file in a Store.

actual external fun createFile(storeId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long, randomWriteSupport: Boolean): Long?

Creates a new file in a Store.

Link copied to clipboard
expect fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy? = null): String

Creates a new Store in given Context.

actual fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy?): String

Creates a new Store in given Context.

actual external fun createStore(contextId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, policies: ContainerPolicy?): String

Creates a new Store in given Context.

Link copied to clipboard
expect fun deleteFile(fileId: String)

Deletes a file by given ID.

actual fun deleteFile(fileId: String)

Deletes a file by given ID.

actual external fun deleteFile(fileId: String)

Deletes a file by given ID.

Link copied to clipboard
expect fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

actual fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

actual external fun deleteStore(storeId: String)

Deletes a Store by given Store ID.

Link copied to clipboard
expect fun getFile(fileId: String): File

Gets a single file by the given file ID.

actual fun getFile(fileId: String): File

Gets a single file by the given file ID.

actual external fun getFile(fileId: String): File

Gets a single file by the given file ID.

Link copied to clipboard
expect fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

actual fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

actual external fun getStore(storeId: String): Store

Gets a single Store by given Store ID.

Link copied to clipboard
expect fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null, queryAsJson: String? = null, sortBy: String? = null): PagingList<File>

Gets a list of files in given Store.

actual fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?, queryAsJson: String?, sortBy: String?): PagingList<File>

Gets a list of files in given Store.

actual external fun listFiles(storeId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?, queryAsJson: String?, sortBy: String?): PagingList<File>

Gets a list of files in given Store.

Link copied to clipboard
expect fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String = "desc", lastId: String? = null, queryAsJson: String? = null, sortBy: String? = null): PagingList<Store>

Gets a list of Stores in given Context.

actual fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?, queryAsJson: String?, sortBy: String?): PagingList<Store>

Gets a list of Stores in given Context.

actual external fun listStores(contextId: String, skip: Long, limit: Long, sortOrder: String, lastId: String?, queryAsJson: String?, sortBy: String?): PagingList<Store>

Gets a list of Stores in given Context.

Link copied to clipboard
expect fun openFile(fileId: String): Long?

Opens a file to read.

actual fun openFile(fileId: String): Long?

Opens a file to read.

actual external fun openFile(fileId: String): Long?

Opens a file to read.

Link copied to clipboard
expect fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

actual external fun readFromFile(fileHandle: Long, length: Long): ByteArray

Reads file data.

Link copied to clipboard
expect fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

actual fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

actual external fun seekInFile(fileHandle: Long, position: Long)

Moves read cursor.

Link copied to clipboard
expect fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the Store events on the given subscription query.

actual fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the Store events on the given subscription query.

actual external fun subscribeFor(subscriptionQueries: List<String>): List<String>

Subscribe for the Store events on the given subscription query.

Link copied to clipboard
expect fun syncFile(handle: Long)

Synchronize file handle data with newest data on server

actual fun syncFile(handle: Long)

Synchronize file handle data with newest data on server

actual external fun syncFile(handle: Long)

Synchronize file handle data with newest data on server

Link copied to clipboard
expect fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.

actual fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.

actual external fun unsubscribeFrom(subscriptionIds: List<String>)

Unsubscribe from events with the given subscriptionId.

Link copied to clipboard
expect fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

actual fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

actual external fun updateFile(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray, size: Long): Long?

Updates an existing file in a Store.

Link copied to clipboard
expect fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

actual fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

actual external fun updateFileMeta(fileId: String, publicMeta: ByteArray, privateMeta: ByteArray)

Updates metadata of an existing file in a Store.

Link copied to clipboard
expect fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean = false, forceGenerateNewKey: Boolean = false, policies: ContainerPolicy? = null)

Updates an existing Store.

actual fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicy?)

Updates an existing Store.

actual external fun updateStore(storeId: String, users: List<UserWithPubKey>, managers: List<UserWithPubKey>, publicMeta: ByteArray, privateMeta: ByteArray, version: Long, force: Boolean, forceGenerateNewKey: Boolean, policies: ContainerPolicy?)

Updates an existing Store.

Link copied to clipboard
expect fun writeToFile(fileHandle: Long, dataChunk: ByteArray, truncate: Boolean = false)

Writes a file data.

actual fun writeToFile(fileHandle: Long, dataChunk: ByteArray, truncate: Boolean)

Writes a file data.

actual external fun writeToFile(fileHandle: Long, dataChunk: ByteArray, truncate: Boolean)

Writes a file data.