IModelClientV2

interface IModelClientV2

This interface is meant exclusively for model client usage.

It is designed to ensure decoupling between model client usage operations and other aspects, such as lifecycle management. Users of this interface cannot incidentally depend on non-usage functionality. See also: Interface segregation principle

Specifically, this interface should not be used for managing the client's lifecycle, as the lifecycle management may vary depending on the specific implementation. If you need to manage the client's lifecycle, use the methods in the class interface of the concrete implementations, such as ModelClientV2.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun deleteBranch(branch: BranchReference): Boolean

Deletes a branch from a repository if it exists.

Link copied to clipboard
abstract suspend fun deleteRepository(repository: RepositoryId): Boolean
Link copied to clipboard
abstract fun getClientId(): Int
Link copied to clipboard
Link copied to clipboard
abstract fun getUserId(): String?
Link copied to clipboard
abstract suspend fun initRepository(repository: RepositoryId, useRoleIds: Boolean = true): IVersion
Link copied to clipboard
abstract suspend fun initRepositoryWithLegacyStorage(repository: RepositoryId): IVersion
Link copied to clipboard
suspend fun IModelClientV2.lazyLoadVersion(branchRef: BranchReference, config: CacheConfiguration = CacheConfiguration()): IVersion

An overload of IModelClientV2.lazyLoadVersion that reads the current version hash of the branch from the server and then loads that version with lazy loading support.

fun IModelClientV2.lazyLoadVersion(repositoryId: RepositoryId, versionHash: String, config: CacheConfiguration = CacheConfiguration()): IVersion

This function loads parts of the model lazily while it is iterated and limits the amount of data that is cached on the client side.

Link copied to clipboard
abstract suspend fun listBranches(repository: RepositoryId): List<BranchReference>
Link copied to clipboard
abstract suspend fun listRepositories(): List<RepositoryId>
Link copied to clipboard
abstract suspend fun loadVersion(versionHash: String, baseVersion: IVersion?): IVersion
abstract suspend fun loadVersion(repositoryId: RepositoryId, versionHash: String, baseVersion: IVersion?): IVersion
Link copied to clipboard
abstract suspend fun poll(branch: BranchReference, lastKnownVersion: IVersion?): IVersion

While pull returns immediately poll returns as soon as a new version, that is different from the given lastKnownVersion, is pushed to the server or after some timeout specified by the server (usually ~30 seconds).

Link copied to clipboard
abstract suspend fun pollHash(branch: BranchReference, lastKnownHash: String?): String
abstract suspend fun pollHash(branch: BranchReference, lastKnownVersion: IVersion?): String
Link copied to clipboard
abstract suspend fun pull(branch: BranchReference, lastKnownVersion: IVersion?): IVersion
Link copied to clipboard
abstract suspend fun pullHash(branch: BranchReference): String
Link copied to clipboard
abstract suspend fun pullIfExists(branch: BranchReference): IVersion?
Link copied to clipboard
abstract suspend fun push(branch: BranchReference, version: IVersion, baseVersion: IVersion?): IVersion

The pushed version is merged automatically by the server with the current head. The merge result is returned.

Link copied to clipboard
abstract suspend fun <R> query(branch: BranchReference, body: (IMonoStep<INode>) -> IMonoStep<R>): R
abstract suspend fun <R> query(repositoryId: RepositoryId, versionHash: String, body: (IMonoStep<INode>) -> IMonoStep<R>): R
Link copied to clipboard
suspend fun <T> IModelClientV2.runWrite(branchRef: BranchReference, body: (INode) -> T): T

Performs a write transaction on the root node of the given branch.

Link copied to clipboard
suspend fun <T> IModelClientV2.runWriteOnBranch(branchRef: BranchReference, body: (IBranch) -> T): T

Performs a write transaction on the root node of the given branch.