-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move PublicAsset APIs to jmap-extensions-api
- Loading branch information
1 parent
1c373ca
commit 9de2c0d
Showing
17 changed files
with
167 additions
and
148 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
34 changes: 34 additions & 0 deletions
34
...-api/src/main/scala/com/linagora/tmail/james/jmap/publicAsset/PublicAssetRepository.scala
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,34 @@ | ||
package com.linagora.tmail.james.jmap.publicAsset | ||
|
||
import org.apache.james.blob.api.BlobId | ||
import org.apache.james.core.Username | ||
import org.apache.james.jmap.api.model.IdentityId | ||
import org.reactivestreams.Publisher | ||
import reactor.core.scala.publisher.SMono | ||
|
||
trait PublicAssetRepository { | ||
def create(username: Username, creationRequest: PublicAssetCreationRequest): Publisher[PublicAssetStorage] | ||
|
||
def update(username: Username, id: PublicAssetId, identityIds: Set[IdentityId]): Publisher[Void] | ||
|
||
def remove(username: Username, id: PublicAssetId): Publisher[Void] | ||
|
||
def revoke(username: Username): Publisher[Void] | ||
|
||
def get(username: Username, ids: Set[PublicAssetId]): Publisher[PublicAssetStorage] | ||
|
||
def get(username: Username, id: PublicAssetId): Publisher[PublicAssetStorage] = get(username, Set(id)) | ||
|
||
def list(username: Username): Publisher[PublicAssetStorage] | ||
|
||
def listPublicAssetMetaDataOrderByIdAsc(username: Username): Publisher[PublicAssetMetadata] | ||
|
||
def listAllBlobIds(): Publisher[BlobId] | ||
|
||
def updateIdentityIds(username: Username, id: PublicAssetId, identityIdsToAdd: Seq[IdentityId], identityIdsToRemove: Seq[IdentityId]): Publisher[Void] = | ||
SMono(get(username, id)) | ||
.map(publicAsset => (publicAsset.identityIds.toSet ++ identityIdsToAdd.toSet) -- identityIdsToRemove.toSet) | ||
.flatMap(identityIds => SMono(update(username, id, identityIds))) | ||
|
||
def getTotalSize(username: Username): Publisher[Long] | ||
} |
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
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
Oops, something went wrong.