-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from modelix/advanced-model-server-api
MODELIX-54 Higher level API for the advanced-model-client
- Loading branch information
Showing
51 changed files
with
1,823 additions
and
442 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
model-client/src/commonMain/kotlin/org/modelix/model/IVersion.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.modelix.model | ||
|
||
import org.modelix.model.api.ITree | ||
|
||
interface IVersion { | ||
fun getShaHash(): String | ||
fun getTree(): ITree | ||
} |
45 changes: 45 additions & 0 deletions
45
model-client/src/commonMain/kotlin/org/modelix/model/client2/IModelClientV2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.modelix.model.client2 | ||
|
||
import org.modelix.model.IVersion | ||
import org.modelix.model.api.IIdGenerator | ||
import org.modelix.model.lazy.BranchReference | ||
import org.modelix.model.lazy.RepositoryId | ||
import org.modelix.model.server.api.ModelQuery | ||
|
||
interface IModelClientV2 { | ||
fun getClientId(): Int | ||
fun getIdGenerator(): IIdGenerator | ||
fun getUserId(): String? | ||
|
||
suspend fun initRepository(repository: RepositoryId): IVersion | ||
suspend fun listRepositories(): List<RepositoryId> | ||
|
||
suspend fun listBranches(repository: RepositoryId): List<BranchReference> | ||
|
||
suspend fun loadVersion(versionHash: String, baseVersion: IVersion?): IVersion | ||
|
||
/** | ||
* The pushed version is merged automatically by the server with the current head. | ||
* The merge result is returned. | ||
*/ | ||
suspend fun push(branch: BranchReference, version: IVersion): IVersion | ||
|
||
suspend fun pull(branch: BranchReference, lastKnownVersion: IVersion?): IVersion | ||
suspend fun pull(branch: BranchReference, lastKnownVersion: IVersion?, filter: ModelQuery): IVersion | ||
|
||
suspend fun poll(branch: BranchReference, lastKnownVersion: IVersion?): IVersion | ||
suspend fun poll(branch: BranchReference, lastKnownVersion: IVersion?, filter: ModelQuery): IVersion | ||
} |
Oops, something went wrong.