[james-project] branch master updated: JAMES-2821 memory product should use logback for logging
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git The following commit(s) were added to refs/heads/master by this push: new 300eb24 JAMES-2821 memory product should use logback for logging new 6a87529 Merge branch 'pr-2507' 300eb24 is described below commit 300eb247750641c4d28d8de93ff5f952e43ba0fe Author: Matthieu Baechler AuthorDate: Mon May 13 16:22:29 2019 +0200 JAMES-2821 memory product should use logback for logging --- server/container/guice/memory-guice/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/server/container/guice/memory-guice/pom.xml b/server/container/guice/memory-guice/pom.xml index e558b01..057a9b6 100644 --- a/server/container/guice/memory-guice/pom.xml +++ b/server/container/guice/memory-guice/pom.xml @@ -188,7 +188,6 @@ ch.qos.logback logback-classic -test io.rest-assured - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (JAMES-2821) No logs on in memory product
[ https://issues.apache.org/jira/browse/JAMES-2821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rémi Kowalski closed JAMES-2821. Resolution: Fixed Fixed by https://github.com/linagora/james-project/pull/2507 > No logs on in memory product > > > Key: JAMES-2821 > URL: https://issues.apache.org/jira/browse/JAMES-2821 > Project: James Server > Issue Type: Bug >Reporter: Rémi Kowalski >Priority: Major > Fix For: 3.4.0 > > > Logback dependency is missing -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 01/03: JAMES-2809 Implement a BlobStore based version of the DeletedMessageVault
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit f5644bd231ea1c83b2b1d2522951443803a775d3 Author: Benoit Tellier AuthorDate: Thu Jul 4 15:16:45 2019 +0200 JAMES-2809 Implement a BlobStore based version of the DeletedMessageVault Not supported operations: - retention: will be implemented in JAMES-2811 - delete: will be implemented later - userWithVault: this not generic enough operation will be refactored out of the contract --- mailbox/plugin/deleted-messages-vault/pom.xml | 5 + .../vault/blob/BlobStoreDeletedMessageVault.java | 99 +++ .../james/vault/blob/BucketNameGenerator.java | 40 ++ .../blob/BlobStoreDeletedMessageVaultTest.java | 134 + .../james/vault/blob/BucketNameGeneratorTest.java | 48 5 files changed, 326 insertions(+) diff --git a/mailbox/plugin/deleted-messages-vault/pom.xml b/mailbox/plugin/deleted-messages-vault/pom.xml index f7bff9c..8d973c0 100644 --- a/mailbox/plugin/deleted-messages-vault/pom.xml +++ b/mailbox/plugin/deleted-messages-vault/pom.xml @@ -82,6 +82,11 @@ ${james.groupId} +blob-memory +test + + +${james.groupId} james-server-core diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java new file mode 100644 index 000..4f5aa16 --- /dev/null +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java @@ -0,0 +1,99 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * to you 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.apache.james.vault.blob; + +import java.io.InputStream; + +import org.apache.commons.lang3.NotImplementedException; +import org.apache.james.blob.api.BlobStore; +import org.apache.james.blob.api.BucketName; +import org.apache.james.core.User; +import org.apache.james.mailbox.model.MessageId; +import org.apache.james.task.Task; +import org.apache.james.vault.DeletedMessage; +import org.apache.james.vault.DeletedMessageVault; +import org.apache.james.vault.metadata.DeletedMessageMetadataVault; +import org.apache.james.vault.metadata.DeletedMessageWithStorageInformation; +import org.apache.james.vault.metadata.StorageInformation; +import org.apache.james.vault.search.Query; +import org.reactivestreams.Publisher; + +import com.google.common.base.Preconditions; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +public class BlobStoreDeletedMessageVault implements DeletedMessageVault { +private final DeletedMessageMetadataVault messageMetadataVault; +private final BlobStore blobStore; +private final BucketNameGenerator nameGenerator; + +public BlobStoreDeletedMessageVault(DeletedMessageMetadataVault messageMetadataVault, BlobStore blobStore, BucketNameGenerator nameGenerator) { +this.messageMetadataVault = messageMetadataVault; +this.blobStore = blobStore; +this.nameGenerator = nameGenerator; +} + +@Override +public Publisher append(User user, DeletedMessage deletedMessage, InputStream mimeMessage) { +Preconditions.checkNotNull(user); +Preconditions.checkNotNull(deletedMessage); +Preconditions.checkNotNull(mimeMessage); +BucketName bucketName = nameGenerator.currentBucket(); +return blobStore.save(bucketName, mimeMessage) +.map(blobId -> new StorageInformation(bucketName, blobId)) +.map(storageInformation -> new DeletedMe
[james-project] 02/03: JAMES-2809 Remove DeletedMessageVault::userWithVault
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit f35e24117360cde59859c2fef2f8276c77386f55 Author: Benoit Tellier AuthorDate: Thu Jul 4 15:26:34 2019 +0200 JAMES-2809 Remove DeletedMessageVault::userWithVault Tis not generic enough operation is refactored out of the contract (this was used internally to implement retention but is not required with the new DeletedMessageVault implementation) --- .../apache/james/vault/DeletedMessageVault.java| 2 -- .../vault/blob/BlobStoreDeletedMessageVault.java | 5 .../vault/memory/MemoryDeletedMessagesVault.java | 13 ++ .../james/vault/utils/DeleteByQueryExecutor.java | 9 +-- .../james/vault/DeletedMessageVaultContract.java | 29 +++--- .../blob/BlobStoreDeletedMessageVaultTest.java | 12 +++-- .../vault/utils/DeleteByQueryExecutorTest.java | 6 ++--- .../vault/MailRepositoryDeletedMessageVault.java | 12 - .../routes/DeletedMessagesVaultRoutesTest.java | 4 +-- 9 files changed, 43 insertions(+), 49 deletions(-) diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVault.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVault.java index 420c7cd..dcee403 100644 --- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVault.java +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVault.java @@ -36,7 +36,5 @@ public interface DeletedMessageVault { Publisher search(User user, Query query); -Publisher usersWithVault(); - Task deleteExpiredMessagesTask(); } diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java index 4f5aa16..ed56d3a 100644 --- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java @@ -88,11 +88,6 @@ public class BlobStoreDeletedMessageVault implements DeletedMessageVault { } @Override -public Publisher usersWithVault() { -throw new NotImplementedException("Will be implemented later"); -} - -@Override public Task deleteExpiredMessagesTask() { throw new NotImplementedException("Will be implemented later"); } diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/memory/MemoryDeletedMessagesVault.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/memory/MemoryDeletedMessagesVault.java index ecee56e..a887576 100644 --- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/memory/MemoryDeletedMessagesVault.java +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/memory/MemoryDeletedMessagesVault.java @@ -56,7 +56,7 @@ public class MemoryDeletedMessagesVault implements DeletedMessageVault { private DeleteByQueryExecutor deleteByQueryExecutor; public MemoryDeletedMessagesVault(RetentionConfiguration retentionConfiguration, Clock clock) { -this.deleteByQueryExecutor = new DeleteByQueryExecutor(this); +this.deleteByQueryExecutor = new DeleteByQueryExecutor(this, this::usersWithVault); this.retentionConfiguration = retentionConfiguration; this.clock = clock; this.table = HashBasedTable.create(); @@ -111,11 +111,14 @@ public class MemoryDeletedMessagesVault implements DeletedMessageVault { .filter(query.toPredicate()); } -@Override +@VisibleForTesting public Publisher usersWithVault() { -synchronized (table) { -return Flux.fromIterable(ImmutableList.copyOf(table.rowKeySet())); -} +return Flux.defer( +() -> { +synchronized (table) { +return Flux.fromIterable(ImmutableList.copyOf(table.rowKeySet())); +} +}); } public Task deleteExpiredMessagesTask() { diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/utils/DeleteByQueryExecutor.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/utils/DeleteByQueryExecutor.java index 97fe2b1..6226474 100644 --- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/utils/DeleteByQueryExecutor.java +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/utils/DeleteByQueryExecutor.java @@ -19,12 +19,15 @@ package org.apache.james.vault.
[james-project] 03/03: JAMES-2809 DeletedMessageVault contract did not include search test filtering
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 225103b0b12242ef82825436e65ef32e4a5f951a Author: Benoit Tellier AuthorDate: Fri Jul 5 14:07:00 2019 +0200 JAMES-2809 DeletedMessageVault contract did not include search test filtering --- .../apache/james/vault/DeletedMessageVaultContract.java | 16 1 file changed, 16 insertions(+) diff --git a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultContract.java b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultContract.java index ef872b0..52c8862 100644 --- a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultContract.java +++ b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/DeletedMessageVaultContract.java @@ -23,9 +23,11 @@ import static org.apache.james.vault.DeletedMessageFixture.CONTENT; import static org.apache.james.vault.DeletedMessageFixture.DELETED_MESSAGE; import static org.apache.james.vault.DeletedMessageFixture.DELETED_MESSAGE_2; import static org.apache.james.vault.DeletedMessageFixture.DELETED_MESSAGE_GENERATOR; +import static org.apache.james.vault.DeletedMessageFixture.DELETED_MESSAGE_WITH_SUBJECT; import static org.apache.james.vault.DeletedMessageFixture.MESSAGE_ID; import static org.apache.james.vault.DeletedMessageFixture.NOW; import static org.apache.james.vault.DeletedMessageFixture.OLD_DELETED_MESSAGE; +import static org.apache.james.vault.DeletedMessageFixture.SUBJECT; import static org.apache.james.vault.DeletedMessageFixture.USER; import static org.apache.james.vault.DeletedMessageFixture.USER_2; import static org.apache.james.vault.search.Query.ALL; @@ -39,6 +41,8 @@ import java.time.Duration; import org.apache.james.mailbox.inmemory.InMemoryMessageId; import org.apache.james.task.Task; import org.apache.james.util.concurrency.ConcurrentTestRunner; +import org.apache.james.vault.search.CriterionFactory; +import org.apache.james.vault.search.Query; import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; @@ -127,6 +131,18 @@ public interface DeletedMessageVaultContract { } @Test +default void searchShouldReturnMatchingItems() { +Mono.from(getVault().append(USER, DELETED_MESSAGE_2, new ByteArrayInputStream(CONTENT))).block(); +Mono.from(getVault().append(USER, DELETED_MESSAGE_WITH_SUBJECT, new ByteArrayInputStream(CONTENT))).block(); + +assertThat( +Flux.from(getVault().search(USER, + Query.of(CriterionFactory.subject().containsIgnoreCase(SUBJECT +.collectList().block()) +.containsOnly(DELETED_MESSAGE_WITH_SUBJECT); +} + +@Test default void vaultShouldBePartitionnedByUser() { Mono.from(getVault().append(USER, DELETED_MESSAGE, new ByteArrayInputStream(CONTENT))).block(); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] branch master updated (6a87529 -> 225103b)
This is an automated email from the ASF dual-hosted git repository. btellier pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git. from 6a87529 Merge branch 'pr-2507' new f5644bd JAMES-2809 Implement a BlobStore based version of the DeletedMessageVault new f35e241 JAMES-2809 Remove DeletedMessageVault::userWithVault new 225103b JAMES-2809 DeletedMessageVault contract did not include search test filtering The 3 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: mailbox/plugin/deleted-messages-vault/pom.xml | 5 + .../apache/james/vault/DeletedMessageVault.java| 2 - .../vault/blob/BlobStoreDeletedMessageVault.java | 94 +++ .../james/vault/blob/BucketNameGenerator.java | 23 ++-- .../vault/memory/MemoryDeletedMessagesVault.java | 13 ++- .../james/vault/utils/DeleteByQueryExecutor.java | 9 +- .../james/vault/DeletedMessageVaultContract.java | 45 +--- .../blob/BlobStoreDeletedMessageVaultTest.java | 128 + .../james/vault/blob/BucketNameGeneratorTest.java | 35 +++--- .../vault/utils/DeleteByQueryExecutorTest.java | 6 +- .../vault/MailRepositoryDeletedMessageVault.java | 12 +- .../routes/DeletedMessagesVaultRoutesTest.java | 4 +- 12 files changed, 316 insertions(+), 60 deletions(-) create mode 100644 mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java copy backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/utils/LightweightTransactionException.java => mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BucketNameGenerator.java (71%) create mode 100644 mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVaultTest.java copy server/data/data-api/src/test/java/org/apache/james/rrt/lib/DomainRewriterTest.java => mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/blob/BucketNameGeneratorTest.java (59%) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Resolved] (JAMES-2809) DeletedMessageVault implementation of append & search (full scan version) on top of BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit resolved JAMES-2809. --- Resolution: Fixed Fix Version/s: 3.5.0 > DeletedMessageVault implementation of append & search (full scan version) on > top of BlobStore > - > > Key: JAMES-2809 > URL: https://issues.apache.org/jira/browse/JAMES-2809 > Project: James Server > Issue Type: Sub-task > Components: deletedMessageVault >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.5.0 > > > You will write a BlobStore based DeletedMessageVault implementation where it > has: > - a dedicated component(DeletedMessageMetadataVault) to store metadata in > order to have reasonable searching performance (JAMES-2807) > - the capability of choosing bucket in BlobStore as the proposal JAMES-2806 > described > > # Append > you also have to implement a related method loadMimeMessage() > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > private final DeletedMessageMetadataVault metadataVault; > private final BlobStore blobStore; > Mono append(User user, DeletedMessage message, InputStream > mimeMessage) { > BlobId deletedMessageFileName = calculateFileName(message); > blobStore > .store(mimeMessage, deletedMessageFileName, > calculateCurrentBucket()); > metadataVault.store(calculateCurrentBucket(), message); > } > Mono loadMimeMessage(User user, MessageId messageId) { > > } > } > {code} > Pattern for BucketName: `deletedMessages-2019-06-01` where 2019 is the year > and 06 the month. 01 is used to later allow smaller bucket definition. > # Searching ontop of DeletedMessageMetadataVault JAMES-2807 > - retrieve all available buckets from DeletedMessageMetadataVault > - for each bucket, use retrieve all deleted message metadata of > corresponding user >- filter records match with query criteria > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > > private DeletedMessageMetadataVault metadataVault; > Flux search(User user, Query query) { > return metadataVault.listContainers() > .flatMap(containerName -> > metadataVault.listMessages(containerName, user)) > .filter(deletedMessage -> matches(deletedMessage, query)); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-2809) DeletedMessageVault implementation of append & search (full scan version) on top of BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881012#comment-16881012 ] Tellier Benoit commented on JAMES-2809: --- https://github.com/linagora/james-project/pull/2499 solved this... > DeletedMessageVault implementation of append & search (full scan version) on > top of BlobStore > - > > Key: JAMES-2809 > URL: https://issues.apache.org/jira/browse/JAMES-2809 > Project: James Server > Issue Type: Sub-task > Components: deletedMessageVault >Reporter: Tellier Benoit >Priority: Major > > You will write a BlobStore based DeletedMessageVault implementation where it > has: > - a dedicated component(DeletedMessageMetadataVault) to store metadata in > order to have reasonable searching performance (JAMES-2807) > - the capability of choosing bucket in BlobStore as the proposal JAMES-2806 > described > > # Append > you also have to implement a related method loadMimeMessage() > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > private final DeletedMessageMetadataVault metadataVault; > private final BlobStore blobStore; > Mono append(User user, DeletedMessage message, InputStream > mimeMessage) { > BlobId deletedMessageFileName = calculateFileName(message); > blobStore > .store(mimeMessage, deletedMessageFileName, > calculateCurrentBucket()); > metadataVault.store(calculateCurrentBucket(), message); > } > Mono loadMimeMessage(User user, MessageId messageId) { > > } > } > {code} > Pattern for BucketName: `deletedMessages-2019-06-01` where 2019 is the year > and 06 the month. 01 is used to later allow smaller bucket definition. > # Searching ontop of DeletedMessageMetadataVault JAMES-2807 > - retrieve all available buckets from DeletedMessageMetadataVault > - for each bucket, use retrieve all deleted message metadata of > corresponding user >- filter records match with query criteria > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > > private DeletedMessageMetadataVault metadataVault; > Flux search(User user, Query query) { > return metadataVault.listContainers() > .flatMap(containerName -> > metadataVault.listMessages(containerName, user)) > .filter(deletedMessage -> matches(deletedMessage, query)); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Updated] (JAMES-2809) DeletedMessageVault implementation of append & search (full scan version) on top of BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit updated JAMES-2809: -- Fix Version/s: (was: 3.5.0) 3.4.0 > DeletedMessageVault implementation of append & search (full scan version) on > top of BlobStore > - > > Key: JAMES-2809 > URL: https://issues.apache.org/jira/browse/JAMES-2809 > Project: James Server > Issue Type: Sub-task > Components: deletedMessageVault >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You will write a BlobStore based DeletedMessageVault implementation where it > has: > - a dedicated component(DeletedMessageMetadataVault) to store metadata in > order to have reasonable searching performance (JAMES-2807) > - the capability of choosing bucket in BlobStore as the proposal JAMES-2806 > described > > # Append > you also have to implement a related method loadMimeMessage() > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > private final DeletedMessageMetadataVault metadataVault; > private final BlobStore blobStore; > Mono append(User user, DeletedMessage message, InputStream > mimeMessage) { > BlobId deletedMessageFileName = calculateFileName(message); > blobStore > .store(mimeMessage, deletedMessageFileName, > calculateCurrentBucket()); > metadataVault.store(calculateCurrentBucket(), message); > } > Mono loadMimeMessage(User user, MessageId messageId) { > > } > } > {code} > Pattern for BucketName: `deletedMessages-2019-06-01` where 2019 is the year > and 06 the month. 01 is used to later allow smaller bucket definition. > # Searching ontop of DeletedMessageMetadataVault JAMES-2807 > - retrieve all available buckets from DeletedMessageMetadataVault > - for each bucket, use retrieve all deleted message metadata of > corresponding user >- filter records match with query criteria > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > > private DeletedMessageMetadataVault metadataVault; > Flux search(User user, Query query) { > return metadataVault.listContainers() > .flatMap(containerName -> > metadataVault.listMessages(containerName, user)) > .filter(deletedMessage -> matches(deletedMessage, query)); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (JAMES-2809) DeletedMessageVault implementation of append & search (full scan version) on top of BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit closed JAMES-2809. - > DeletedMessageVault implementation of append & search (full scan version) on > top of BlobStore > - > > Key: JAMES-2809 > URL: https://issues.apache.org/jira/browse/JAMES-2809 > Project: James Server > Issue Type: Sub-task > Components: deletedMessageVault >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You will write a BlobStore based DeletedMessageVault implementation where it > has: > - a dedicated component(DeletedMessageMetadataVault) to store metadata in > order to have reasonable searching performance (JAMES-2807) > - the capability of choosing bucket in BlobStore as the proposal JAMES-2806 > described > > # Append > you also have to implement a related method loadMimeMessage() > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > private final DeletedMessageMetadataVault metadataVault; > private final BlobStore blobStore; > Mono append(User user, DeletedMessage message, InputStream > mimeMessage) { > BlobId deletedMessageFileName = calculateFileName(message); > blobStore > .store(mimeMessage, deletedMessageFileName, > calculateCurrentBucket()); > metadataVault.store(calculateCurrentBucket(), message); > } > Mono loadMimeMessage(User user, MessageId messageId) { > > } > } > {code} > Pattern for BucketName: `deletedMessages-2019-06-01` where 2019 is the year > and 06 the month. 01 is used to later allow smaller bucket definition. > # Searching ontop of DeletedMessageMetadataVault JAMES-2807 > - retrieve all available buckets from DeletedMessageMetadataVault > - for each bucket, use retrieve all deleted message metadata of > corresponding user >- filter records match with query criteria > {code:java} > class BlobStoreDeletedMessageVault implements DeletedMessageVault { > > private DeletedMessageMetadataVault metadataVault; > Flux search(User user, Query query) { > return metadataVault.listContainers() > .flatMap(containerName -> > metadataVault.listMessages(containerName, user)) > .filter(deletedMessage -> matches(deletedMessage, query)); > } > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 03/06: JAMES-2806 bucket name resolving logic
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit d45176054fecb771c932a995107696be7027cb21 Author: Tran Tien Duc AuthorDate: Mon Jul 8 13:34:33 2019 +0700 JAMES-2806 bucket name resolving logic --- .../objectstorage/ObjectStorageBucketName.java | 5 + .../ObjectStorageBucketNameResolver.java | 104 + .../ObjectStorageBucketNameResolverTest.java | 124 + 3 files changed, 233 insertions(+) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java index 62bd0c0..2eb90c8 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java @@ -22,12 +22,17 @@ package org.apache.james.blob.objectstorage; import java.util.Objects; import org.apache.commons.lang3.StringUtils; +import org.apache.james.blob.api.BucketName; import com.google.common.base.MoreObjects; import com.google.common.base.Preconditions; class ObjectStorageBucketName { +static ObjectStorageBucketName of(BucketName bucketName) { +return of(bucketName.asString()); +} + static ObjectStorageBucketName of(String value) { return new ObjectStorageBucketName(value); } diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolver.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolver.java new file mode 100644 index 000..136e9c7 --- /dev/null +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolver.java @@ -0,0 +1,104 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * to you 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.apache.james.blob.objectstorage; + +import java.util.Optional; + +import org.apache.james.blob.api.BucketName; + +import com.google.common.base.Preconditions; + +class ObjectStorageBucketNameResolver { + +static class Builder { + +@FunctionalInterface +interface RequirePrefix { +RequireNamespace prefix(Optional prefix); + +default RequireNamespace noPrefix() { +return prefix(Optional.empty()); +} + +default RequireNamespace prefix(String prefix) { +return prefix(Optional.ofNullable(prefix)); +} +} + +@FunctionalInterface +interface RequireNamespace { +ReadyToBuild namespace(Optional namespace); + +default ReadyToBuild namespace(BucketName namespace) { +return namespace(Optional.ofNullable(namespace)); +} + +default ReadyToBuild noNamespace() { +return namespace(Optional.empty()); +} +} + +static final class ReadyToBuild { +private final Optional namespace; +private final Optional prefix; + +ReadyToBuild(Optional namespace, Optional prefix) { +this.namespace = namespace; +this.prefix = prefix; +} + +ObjectStorageBucketNameResolver build() { +return new ObjectStorageBucketNameResolver(namespace, prefix); +} +} +} + +static Builder.RequirePrefix builder() { +return prefix -> namespace -> new Builder.ReadyToBuild(namespace, prefix); +} + +private final Optional names
[james-project] 05/06: JAMES-2806 Resolving bucket names in ObjectStorageBlobsDAO
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 9f13e43bb30a43dbb3dded6822be7bacc2dd6bb3 Author: Tran Tien Duc AuthorDate: Mon Jul 8 14:21:40 2019 +0700 JAMES-2806 Resolving bucket names in ObjectStorageBlobsDAO --- .../java/org/apache/james/blob/objectstorage/BlobPutter.java | 5 ++--- .../james/blob/objectstorage/ObjectStorageBlobsDAO.java | 12 +--- .../blob/objectstorage/ObjectStorageBlobsDAOBuilder.java | 8 +++- .../james/blob/objectstorage/ObjectStorageBucketName.java| 4 ++-- .../james/blob/objectstorage/StreamCompatibleBlobPutter.java | 11 +-- .../james/blob/objectstorage/aws/AwsS3ObjectStorage.java | 12 ++-- 6 files changed, 31 insertions(+), 21 deletions(-) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/BlobPutter.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/BlobPutter.java index a48c8f2..4a229bf 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/BlobPutter.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/BlobPutter.java @@ -22,7 +22,6 @@ package org.apache.james.blob.objectstorage; import java.util.function.Supplier; import org.apache.james.blob.api.BlobId; -import org.apache.james.blob.api.BucketName; import org.jclouds.blobstore.domain.Blob; /** @@ -37,7 +36,7 @@ import org.jclouds.blobstore.domain.Blob; public interface BlobPutter { -void putDirectly(BucketName bucketName, Blob blob); +void putDirectly(ObjectStorageBucketName bucketName, Blob blob); -BlobId putAndComputeId(BucketName bucketName, Blob initialBlob, Supplier blobIdSupplier); +BlobId putAndComputeId(ObjectStorageBucketName bucketName, Blob initialBlob, Supplier blobIdSupplier); } diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java index a316ab3..4659144 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java @@ -58,16 +58,18 @@ public class ObjectStorageBlobsDAO implements BlobStore { private final org.jclouds.blobstore.BlobStore blobStore; private final BlobPutter blobPutter; private final PayloadCodec payloadCodec; +private final ObjectStorageBucketNameResolver bucketNameResolver; ObjectStorageBlobsDAO(BucketName defaultBucketName, BlobId.Factory blobIdFactory, org.jclouds.blobstore.BlobStore blobStore, BlobPutter blobPutter, - PayloadCodec payloadCodec) { + PayloadCodec payloadCodec, ObjectStorageBucketNameResolver bucketNameResolver) { this.blobIdFactory = blobIdFactory; this.defaultBucketName = defaultBucketName; this.blobStore = blobStore; this.blobPutter = blobPutter; this.payloadCodec = payloadCodec; +this.bucketNameResolver = bucketNameResolver; } public static ObjectStorageBlobsDAOBuilder.RequireBlobIdFactory builder(SwiftTempAuthObjectStorage.Configuration testConfig) { @@ -89,6 +91,8 @@ public class ObjectStorageBlobsDAO implements BlobStore { @Override public Mono save(BucketName bucketName, byte[] data) { Preconditions.checkNotNull(data); +ObjectStorageBucketName resolvedBucketName = bucketNameResolver.resolve(bucketName); + BlobId blobId = blobIdFactory.forPayload(data); Payload payload = payloadCodec.write(data); @@ -97,7 +101,7 @@ public class ObjectStorageBlobsDAO implements BlobStore { .contentLength(payload.getLength().orElse(new Long(data.length))) .build(); -return Mono.fromRunnable(() -> blobPutter.putDirectly(bucketName, blob)) +return Mono.fromRunnable(() -> blobPutter.putDirectly(resolvedBucketName, blob)) .thenReturn(blobId); } @@ -130,6 +134,8 @@ public class ObjectStorageBlobsDAO implements BlobStore { } private Mono saveBigStream(BucketName bucketName, InputStream data) { +ObjectStorageBucketName resolvedBucketName = bucketNameResolver.resolve(bucketName); + BlobId tmpId = blobIdFactory.randomId(); HashingInputStream hashingInputStream = new HashingInputStream(Hashing.sha256(), data); Payload payload = payloadCodec.write(hashingInputStream); @@ -138,7 +144,7 @@ public class ObjectStorageBlobsDAO implements BlobStore { .build(); Supplier blobIdSu
[james-project] 01/06: JAMES-2806 Make defaultBucketName become optional in the Builder
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit cc18f9366acae1280f9cbf614555679367cdfa48 Author: Tran Tien Duc AuthorDate: Mon Jul 8 10:09:17 2019 +0700 JAMES-2806 Make defaultBucketName become optional in the Builder And rename it to namespace to be more clear --- .../blob/objectstorage/ObjectStorageBlobsDAO.java | 8 +++ .../ObjectStorageBlobsDAOBuilder.java | 28 -- .../blob/objectstorage/aws/AwsS3ObjectStorage.java | 2 +- .../swift/SwiftKeystone2ObjectStorage.java | 2 +- .../swift/SwiftKeystone3ObjectStorage.java | 2 +- .../swift/SwiftTempAuthObjectStorage.java | 2 +- .../blob/objectstorage/DockerAwsS3Singleton.java | 2 +- .../blob/objectstorage/DockerSwiftSingleton.java | 2 +- .../ObjectStorageBlobsDAOAWSTest.java | 2 +- .../objectstorage/ObjectStorageBlobsDAOTest.java | 8 +++ .../aws/AwsS3ObjectStorageBlobsDAOBuilderTest.java | 16 +++-- ...tKeystone2ObjectStorageBlobsDAOBuilderTest.java | 18 -- ...tKeystone3ObjectStorageBlobsDAOBuilderTest.java | 18 -- ...ftTempAuthObjectStorageBlobsDAOBuilderTest.java | 18 -- .../ObjectStorageBlobConfiguration.java| 7 +++--- .../ObjectStorageDependenciesModule.java | 4 ++-- .../objectstorage/swift/SwiftObjectStorage.java| 8 +++ .../ObjectStorageBlobConfigurationTest.java| 6 ++--- 18 files changed, 58 insertions(+), 95 deletions(-) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java index 3a0bf83..a316ab3 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java @@ -70,19 +70,19 @@ public class ObjectStorageBlobsDAO implements BlobStore { this.payloadCodec = payloadCodec; } -public static ObjectStorageBlobsDAOBuilder.RequireDefaultBucketName builder(SwiftTempAuthObjectStorage.Configuration testConfig) { +public static ObjectStorageBlobsDAOBuilder.RequireBlobIdFactory builder(SwiftTempAuthObjectStorage.Configuration testConfig) { return SwiftTempAuthObjectStorage.daoBuilder(testConfig); } -public static ObjectStorageBlobsDAOBuilder.RequireDefaultBucketName builder(SwiftKeystone2ObjectStorage.Configuration testConfig) { +public static ObjectStorageBlobsDAOBuilder.RequireBlobIdFactory builder(SwiftKeystone2ObjectStorage.Configuration testConfig) { return SwiftKeystone2ObjectStorage.daoBuilder(testConfig); } -public static ObjectStorageBlobsDAOBuilder.RequireDefaultBucketName builder(SwiftKeystone3ObjectStorage.Configuration testConfig) { +public static ObjectStorageBlobsDAOBuilder.RequireBlobIdFactory builder(SwiftKeystone3ObjectStorage.Configuration testConfig) { return SwiftKeystone3ObjectStorage.daoBuilder(testConfig); } -public static ObjectStorageBlobsDAOBuilder.RequireDefaultBucketName builder(AwsS3AuthConfiguration testConfig) { +public static ObjectStorageBlobsDAOBuilder.RequireBlobIdFactory builder(AwsS3AuthConfiguration testConfig) { return AwsS3ObjectStorage.daoBuilder(testConfig); } diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java index 9122c29..b7cb344 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java @@ -31,13 +31,8 @@ import com.google.common.base.Preconditions; public class ObjectStorageBlobsDAOBuilder { -public static RequireDefaultBucketName forBlobStore(Supplier supplier) { -return bucketName -> blobIdFactory -> new ReadyToBuild(supplier, blobIdFactory, bucketName); -} - -@FunctionalInterface -public interface RequireDefaultBucketName { -RequireBlobIdFactory defaultBucketName(BucketName bucketName); +public static RequireBlobIdFactory forBlobStore(Supplier supplier) { +return blobIdFactory -> new ReadyToBuild(supplier, blobIdFactory); } @FunctionalInterface @@ -48,17 +43,17 @@ public class ObjectStorageBlobsDAOBuilder { public static class ReadyToBuild { private final Supplier supplier; -private final BucketName defaultBucketName; private final B
[james-project] 02/06: JAMES-2806 new ObjectStorageBucketName POJO
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit e52e97198d5f3b9d96db5e3d39074c6171a03c30 Author: Tran Tien Duc AuthorDate: Mon Jul 8 11:51:27 2019 +0700 JAMES-2806 new ObjectStorageBucketName POJO Because the BucketName passed into ObjectStorageBlobsDAO will be re calculated to take care about bucket prefix which is only the matter with ObjectStorage concern. To avoid confusing of return type when resolving BucketName, we create another type. --- .../objectstorage/ObjectStorageBucketName.java | 68 ++ .../objectstorage/ObjectStorageBucketNameTest.java | 55 + 2 files changed, 123 insertions(+) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java new file mode 100644 index 000..62bd0c0 --- /dev/null +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java @@ -0,0 +1,68 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * to you 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.apache.james.blob.objectstorage; + +import java.util.Objects; + +import org.apache.commons.lang3.StringUtils; + +import com.google.common.base.MoreObjects; +import com.google.common.base.Preconditions; + +class ObjectStorageBucketName { + +static ObjectStorageBucketName of(String value) { +return new ObjectStorageBucketName(value); +} + +private final String value; + +private ObjectStorageBucketName(String value) { +Preconditions.checkNotNull(value); +Preconditions.checkArgument(StringUtils.isNotBlank(value), "`value` cannot be blank"); + +this.value = value; +} + +String asString() { +return value; +} + +@Override +public final boolean equals(Object o) { +if (o instanceof ObjectStorageBucketName) { +ObjectStorageBucketName that = (ObjectStorageBucketName) o; +return Objects.equals(this.value, that.value); +} +return false; +} + +@Override +public final int hashCode() { +return Objects.hash(value); +} + +@Override +public String toString() { +return MoreObjects.toStringHelper(this) +.add("value", value) +.toString(); +} +} diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameTest.java b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameTest.java new file mode 100644 index 000..58d48d6 --- /dev/null +++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameTest.java @@ -0,0 +1,55 @@ +/ + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information* + * regarding copyright ownership. The ASF licenses this file * + * to you 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 distr
[james-project] 06/06: JAMES-2806 apply prefix configuration for the builder
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 9e040a40872f7a2bd7d4b7b4575a75affb399553 Author: Tran Tien Duc AuthorDate: Mon Jul 8 14:25:32 2019 +0700 JAMES-2806 apply prefix configuration for the builder --- .../james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java | 5 + .../modules/objectstorage/ObjectStorageBlobConfiguration.java| 9 - .../modules/objectstorage/ObjectStorageDependenciesModule.java | 1 + .../objectstorage/ObjectStorageBlobConfigurationTest.java| 6 +++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java index d085565..21a1bb8 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java @@ -83,6 +83,11 @@ public class ObjectStorageBlobsDAOBuilder { return this; } +public ReadyToBuild bucketPrefix(Optional bucketPrefix) { +this.bucketPrefix = bucketPrefix; +return this; +} + public ReadyToBuild bucketPrefix(String prefix) { this.bucketPrefix = Optional.ofNullable(prefix); return this; diff --git a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobConfiguration.java b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobConfiguration.java index 58e082b..e6ea529 100644 --- a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobConfiguration.java +++ b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobConfiguration.java @@ -173,8 +173,6 @@ public class ObjectStorageBlobConfiguration { .orElseThrow(() -> new IllegalStateException("AES code requires an non-empty password parameter")); } -String bucketPrefix = this.bucketPrefix.orElse(DEFAULT_BUCKET_PREFIX); - return new ObjectStorageBlobConfiguration(payloadCodecFactory, bucketPrefix, provider, defaultBucketName, specificAuthConfiguration, aesSalt, aesPassword); } @@ -183,15 +181,16 @@ public class ObjectStorageBlobConfiguration { } private final PayloadCodecFactory payloadCodec; -private final String bucketPrefix; private final ObjectStorageProvider provider; private final SpecificAuthConfiguration specificAuthConfiguration; private Optional namespace; private Optional aesSalt; private Optional aesPassword; +private Optional bucketPrefix; @VisibleForTesting -ObjectStorageBlobConfiguration(PayloadCodecFactory payloadCodec, String bucketPrefix, +ObjectStorageBlobConfiguration(PayloadCodecFactory payloadCodec, + Optional bucketPrefix, ObjectStorageProvider provider, Optional namespace, SpecificAuthConfiguration specificAuthConfiguration, @@ -234,7 +233,7 @@ public class ObjectStorageBlobConfiguration { return aesPassword; } -public String getBucketPrefix() { +public Optional getBucketPrefix() { return bucketPrefix; } diff --git a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java index 23def65..e7b0c5c 100644 --- a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java +++ b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java @@ -70,6 +70,7 @@ public class ObjectStorageDependenciesModule extends AbstractModule { .payloadCodec(configuration.getPayloadCodec()) .blobPutter(putBlob(blobIdFactory, configuration, awsS3ObjectStorageProvider)) .namespace(configuration.getNamespace()) +.bucketPrefix(configuration.getBucketPrefix()) .build(); return dao; } diff --git a/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/ObjectSt
[james-project] branch master updated (225103b -> 9e040a4)
This is an automated email from the ASF dual-hosted git repository. btellier pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git. from 225103b JAMES-2809 DeletedMessageVault contract did not include search test filtering new cc18f93 JAMES-2806 Make defaultBucketName become optional in the Builder new e52e971 JAMES-2806 new ObjectStorageBucketName POJO new d451760 JAMES-2806 bucket name resolving logic new 69183fa JAMES-2806 bucketPrefix inside the builder new 9f13e43 JAMES-2806 Resolving bucket names in ObjectStorageBlobsDAO new 9e040a4 JAMES-2806 apply prefix configuration for the builder The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../james/blob/objectstorage/BlobPutter.java | 5 +- .../blob/objectstorage/ObjectStorageBlobsDAO.java | 20 ++-- .../ObjectStorageBlobsDAOBuilder.java | 48 +--- .../objectstorage/ObjectStorageBucketName.java}| 20 ++-- .../ObjectStorageBucketNameResolver.java | 104 + .../objectstorage/StreamCompatibleBlobPutter.java | 11 +- .../blob/objectstorage/aws/AwsS3ObjectStorage.java | 14 +-- .../swift/SwiftKeystone2ObjectStorage.java | 2 +- .../swift/SwiftKeystone3ObjectStorage.java | 2 +- .../swift/SwiftTempAuthObjectStorage.java | 2 +- .../blob/objectstorage/DockerAwsS3Singleton.java | 2 +- .../blob/objectstorage/DockerSwiftSingleton.java | 2 +- .../ObjectStorageBlobsDAOAWSTest.java | 2 +- .../objectstorage/ObjectStorageBlobsDAOTest.java | 8 +- .../ObjectStorageBucketNameResolverTest.java | 124 + .../ObjectStorageBucketNameTest.java} | 14 +-- .../aws/AwsS3ObjectStorageBlobsDAOBuilderTest.java | 16 +-- ...tKeystone2ObjectStorageBlobsDAOBuilderTest.java | 18 +-- ...tKeystone3ObjectStorageBlobsDAOBuilderTest.java | 18 +-- ...ftTempAuthObjectStorageBlobsDAOBuilderTest.java | 18 +-- .../ObjectStorageBlobConfiguration.java| 16 ++- .../ObjectStorageDependenciesModule.java | 5 +- .../objectstorage/swift/SwiftObjectStorage.java| 8 +- .../ObjectStorageBlobConfigurationTest.java| 12 +- 24 files changed, 354 insertions(+), 137 deletions(-) copy server/blob/{blob-api/src/main/java/org/apache/james/blob/api/BucketName.java => blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketName.java} (79%) create mode 100644 server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolver.java create mode 100644 server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolverTest.java copy server/blob/{blob-api/src/test/java/org/apache/james/blob/api/BucketNameTest.java => blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameTest.java} (82%) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 04/06: JAMES-2806 bucketPrefix inside the builder
This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 69183fa080e7a3f1db7ef62ff87bcc5f89a4479c Author: Tran Tien Duc AuthorDate: Mon Jul 8 13:59:39 2019 +0700 JAMES-2806 bucketPrefix inside the builder --- .../james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java | 7 +++ .../objectstorage/ObjectStorageBucketNameResolverTest.java | 10 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java index b7cb344..d6c289c 100644 --- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java +++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java @@ -47,6 +47,7 @@ public class ObjectStorageBlobsDAOBuilder { private Optional payloadCodec; private Optional blobPutter; private Optional namespace; +private Optional bucketPrefix; public ReadyToBuild(Supplier supplier, BlobId.Factory blobIdFactory) { this.blobIdFactory = blobIdFactory; @@ -54,6 +55,7 @@ public class ObjectStorageBlobsDAOBuilder { this.supplier = supplier; this.blobPutter = Optional.empty(); this.namespace = Optional.empty(); +this.bucketPrefix = Optional.empty(); } public ReadyToBuild payloadCodec(PayloadCodec payloadCodec) { @@ -81,6 +83,11 @@ public class ObjectStorageBlobsDAOBuilder { return this; } +public ReadyToBuild bucketPrefix(String prefix) { +this.bucketPrefix = Optional.ofNullable(prefix); +return this; +} + public ObjectStorageBlobsDAO build() { Preconditions.checkState(blobIdFactory != null); diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolverTest.java b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolverTest.java index 43119d1..3edee3f 100644 --- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolverTest.java +++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBucketNameResolverTest.java @@ -60,12 +60,12 @@ class ObjectStorageBucketNameResolverTest { @Test void resolveShouldReturnPassedValueWithPrefix() { ObjectStorageBucketNameResolver resolver = ObjectStorageBucketNameResolver.builder() -.prefix("prefix-") +.prefix("bucketPrefix-") .noNamespace() .build(); assertThat(resolver.resolve(BucketName.of("bucketName"))) -.isEqualTo(ObjectStorageBucketName.of("prefix-bucketName")); + .isEqualTo(ObjectStorageBucketName.of("bucketPrefix-bucketName")); } } @@ -90,18 +90,18 @@ class ObjectStorageBucketNameResolverTest { @Test void resolveShouldReturnPassedValueWithPrefix() { ObjectStorageBucketNameResolver resolver = ObjectStorageBucketNameResolver.builder() -.prefix("prefix-") +.prefix("bucketPrefix-") .namespace(BucketName.of("namespace")) .build(); assertThat(resolver.resolve(BucketName.of("bucketName"))) -.isEqualTo(ObjectStorageBucketName.of("prefix-bucketName")); + .isEqualTo(ObjectStorageBucketName.of("bucketPrefix-bucketName")); } @Test void resolveShouldReturnNamespaceWhenPassingNamespace() { ObjectStorageBucketNameResolver resolver = ObjectStorageBucketNameResolver.builder() -.prefix("prefix-") +.prefix("bucketPrefix-") .namespace(BucketName.of("namespace")) .build(); - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Resolved] (JAMES-2806) Adding bucket capability into BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit resolved JAMES-2806. --- Resolution: Fixed > Adding bucket capability into BlobStore > --- > > Key: JAMES-2806 > URL: https://issues.apache.org/jira/browse/JAMES-2806 > Project: James Server > Issue Type: Sub-task > Components: Blob >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You should update current BlobStore API to be able to customize the way we > storeBlob: > - We want to store a blob in a specified bucket > {code:java} > public interface BlobStore { > Publisher save(BucketName, byte[] data); > Publisher save(BucketName, InputStream data); > Publisher readBytes(BucketName, BlobId blobId); > InputStream read(BucketName, BlobId blobId); > } > {code} > And to implement the feature of deleting buckets exceed retention time, we > need to have another additional method of deleting bucket: > {code:java} > public interface BlobStore { > Publisher delete(BucketName bucket); > } > {code} > Scope: API change, contract test, memory + object storage implementation - > cassandra will be done in a later task -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-2806) Adding bucket capability into BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881034#comment-16881034 ] Tellier Benoit commented on JAMES-2806: --- https://github.com/linagora/james-project/pull/2497 allowed multiple James to be sharing the same object storage and playing well, while not breaking retro-compatibility > Adding bucket capability into BlobStore > --- > > Key: JAMES-2806 > URL: https://issues.apache.org/jira/browse/JAMES-2806 > Project: James Server > Issue Type: Sub-task > Components: Blob >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You should update current BlobStore API to be able to customize the way we > storeBlob: > - We want to store a blob in a specified bucket > {code:java} > public interface BlobStore { > Publisher save(BucketName, byte[] data); > Publisher save(BucketName, InputStream data); > Publisher readBytes(BucketName, BlobId blobId); > InputStream read(BucketName, BlobId blobId); > } > {code} > And to implement the feature of deleting buckets exceed retention time, we > need to have another additional method of deleting bucket: > {code:java} > public interface BlobStore { > Publisher delete(BucketName bucket); > } > {code} > Scope: API change, contract test, memory + object storage implementation - > cassandra will be done in a later task -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Closed] (JAMES-2806) Adding bucket capability into BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Tellier Benoit closed JAMES-2806. - > Adding bucket capability into BlobStore > --- > > Key: JAMES-2806 > URL: https://issues.apache.org/jira/browse/JAMES-2806 > Project: James Server > Issue Type: Sub-task > Components: Blob >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You should update current BlobStore API to be able to customize the way we > storeBlob: > - We want to store a blob in a specified bucket > {code:java} > public interface BlobStore { > Publisher save(BucketName, byte[] data); > Publisher save(BucketName, InputStream data); > Publisher readBytes(BucketName, BlobId blobId); > InputStream read(BucketName, BlobId blobId); > } > {code} > And to implement the feature of deleting buckets exceed retention time, we > need to have another additional method of deleting bucket: > {code:java} > public interface BlobStore { > Publisher delete(BucketName bucket); > } > {code} > Scope: API change, contract test, memory + object storage implementation - > cassandra will be done in a later task -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
svn commit: r34809 - /release/james/KEYS
Author: matthieu Date: Tue Jul 9 09:45:25 2019 New Revision: 34809 Log: Update matth...@apache.org signature Modified: release/james/KEYS Modified: release/james/KEYS == --- release/james/KEYS (original) +++ release/james/KEYS Tue Jul 9 09:45:25 2019 @@ -1434,42 +1434,6 @@ M5XOx/fwubwLLJTCeJdF0Hei6vtfjIx/B/9s64WC RRwqVg49 =fHZf -END PGP PUBLIC KEY BLOCK- -pub rsa2048 2016-10-11 [SC] - 80A3C47E6C59C0BB18BEF1CAE1507A9AB21B1536 -uid [ unknown] Matthieu Baechler -sig 3E1507A9AB21B1536 2016-10-11 Matthieu Baechler -sub rsa2048 2016-10-11 [E] -sig E1507A9AB21B1536 2016-10-11 Matthieu Baechler - --BEGIN PGP PUBLIC KEY BLOCK- - -mQENBFf9DX8BCADRLDrXZ8CPqKJDOelRGscR0MnbRLhTSWvxY/NgT79S4FVO+9Jl -mw7H5MfUiWrUcm+rMFLIcmcpPyOR7Xb1GteZLsi7fMQHMXUP5F4hAeJYlM5J2G0k -s5YohWf5ki9oST0O3dMERA10tZb7SjvGHTQeoy11Byv8WDkl2DyBuNySZQ6z2vw/ -VqAcnahhQxUPI5vbkUKJd9OqRTMra4WiqAeJG4w2Lujb3R7e12U0NtTXYHdLqdiH -eDSbLMT+rX2EofWKDi9s/2VpPZTTp2X/iU/M1b2oUbA4edYxCiVEtrAqexG72Mfw -DEjcxWVz/wFUvp+3gjbA8shGKaSeGjZIpspfABEBAAG0J01hdHRoaWV1IEJhZWNo -bGVyIDxtYXR0aGlldUBhcGFjaGUub3JnPokBNwQTAQgAIQUCV/0NfwIbAwULCQgH -AgYVCAkKCwIEFgIDAQIeAQIXgAAKCRDhUHqashsVNmpmCACB54Urt9TpYN2aEhzQ -98VIIWhWqRL0yvDaLT/w4oJLagWjAYzJ/rqy4uvGUQB+QtZ9EhUnjkPoHVComLsu -np4yRd29ngf+34nI6y81vutth11RtK64aqZ+pLhRxrxkWTJjoI5Ycg9u80J5qOxJ -1yrctBNpwvBf8FnxcCDA6tKsPIfF717PgshUbiPQtfd/eYT67xb6cjys+ggmL4fg -y9PG4+iba3H9eBlt6LOi1xlHxO7eKEbJK74lUsk2WDeCWZdM+jmz49D7JA0pDqKP -iuMFY4YaKW70JyYj5ybaCQ+KaDvYNwYa7Wnc3JTB7vACREzNAggJo7I5Eg+jWa6r -EvRUuQENBFf9DX8BCADinpsrjiuNUt/L+AKwmkiVrvLbZB1xdYFUk22oIi5vJ1vg -mlILIYTiB54sXn+vLXqt2ItWnHFDI1EPkfqf+/Y5N/owwxmoEJdr6bbpJ+qxKd1q -FlRai40Ql2JRe8bAUTvYrW13s8K/7nyJULyc9sTNgBeFmmxn+r2bAmn49ts6+e7t -Bx/okIK6DHBRAZMPE2gh6i4WDJMz/YgL4u6Bs+uu6DjXtP6h+2DJUXymUxuBp4Fd -d+4vcl6tRBYzVTFRL+NOk8PmxsHQr+wb5j0NJRhXHcm+qpWGDDDnwJ1korgNYdFk -IHTci/e6/lgiUq+cbCQ1U65nuoW3Tu8qaE0KqMKzABEBAAGJAR8EGAEIAAkFAlf9 -DX8CGwwACgkQ4VB6mrIbFTadpQgAn5+rmaQixLPUWjRbyN2o1L0rvyuZSXf2AoRf -4ND3rjLjHvF/MeNOU7zcd5ncQD8TP4khAWUV9YSgaWH8lmMSVZTZLS3ArGUD9j2M -Al33l67VGz7sc6LwoiWVCfs3lazUc5NiOzqL30GmU55n87glqvEkjUmacV8te6zp -75V8cXm/ucXLB0+KAXT0sGp3xDAXF8sidcnxtwLJJ3nT/TIsoD1Prg3TTQA6Wuij -YM84M6MbzAQgrHOhvTWowCS9dEUmnBbTo9xtYnGxl3TxpvvqzZ8yyV+JlYa8XcEv -4y04r7PwLuIpljfpKbW9bEDp8FJM90z2k+Dov3SoGiWQaPkyhw== -=UJBK --END PGP PUBLIC KEY BLOCK- pub rsa2048 2016-10-10 [SC] 16786C85121310443EBE4F4B0E1C43C3FB35B6CE uid [ultimate] Benoit Tellier @@ -1506,3 +1470,91 @@ nJaGC5X6sKMEADIJG0eUhw3jrQXARkG6C+HER3/N wkdW1MswluzE9XRHKG2q985W+a7f2i86PwHJ9em9aHHYag== =vudL -END PGP PUBLIC KEY BLOCK- +pub rsa4096 2019-04-01 [SC] [expires: 2035-03-28] + A6A31CD736BE4F9B5BE5348FCCE9DA2FC39E90A1 +uid [ unknown] Matthieu Baechler +sig 3CCE9DA2FC39E90A1 2019-04-01 Matthieu Baechler +uid [ unknown] Matthieu Baechler +sig 3CCE9DA2FC39E90A1 2019-04-01 Matthieu Baechler +uid [ unknown] Matthieu Baechler +sig 3CCE9DA2FC39E90A1 2019-04-01 Matthieu Baechler +sub rsa4096 2019-04-01 [E] [expires: 2035-03-28] +sig CCE9DA2FC39E90A1 2019-04-01 Matthieu Baechler + +-BEGIN PGP PUBLIC KEY BLOCK- + +mQINBFyhw5MBEACqjSNWIHM5Xj9HMx4PIebklBzH0bNFpaeLfbrhs4kGrEiNVi+I +bBcBqaJ0BwQ9fU8EoerTnTMMba6l5ScjLGmV0/yJhDwmHnBcRYDxEV0m3286Wen2 +XwXhy7bkInTufqpvK28U8ZkEL0lXSyH2BW9OV3onn0QQ/BhJZsUQyZ/jXJ8tVbLf +oblpDHgBtihrvJNrem0hLJvuLIK7WRE47hf2MX6n0YjyRd/6nOCBojqqUBvjcm3e +GLLNixbqdlLQfPRaWPUxeBqBEaSpeLNweMKLW7yD2eWvnqrbkGaobtXPNeWck2ZP +ZtXKK5h3Psc0m0y2Dp6KhkNCIMf0lbgUoGYvC3PxNGcA70fsXbQJgQs4zreDhScj +aAI/cb91Or9SKuo2V2tp/qyF8Br3VYCfMENt/4XpyzyWUnwr+15dvgDdaMyx02yY +LOKZlBAYK2bOwSr69ffOjhRxD2TGWnriKtOpISzmk7lVSjyHserbZgmOtu9dt3MR +gJdRQ0BWZfOHHJyxohJx3Gs7ZExMTNA6dmxoZO/xYNzO8GR2Wsw7HDIeudjpeQnS +HscYxVYtaax5BhT7ZDQ3FLqlj70FFWK44CwXxIo2HsAHi85tIq/Q2J2qyQ2RIe3M +Hzr8g6vcJpxoPl/mCugux/3VCWZ0IM8/3gInLc9kdRUzlmlCcoeTn0WsdwARAQAB +tCdNYXR0aGlldSBCYWVjaGxlciA8bWF0dGhpZXVAYXBhY2hlLm9yZz6JAjgEEwEI +ACwFAlyhw5MJEMzp2i/DnpChAhsDBQkeEzgAAhkBBAsHCQMFFQgKAgMEFgABAgAA +mfgP/jpmJGSQ/J0DuaE5+SNhsZRlXRRId/RW5Ivtz7LafDpa0O1ELkFdGOrz04Qh +wCHU0QfeO7CiVKfzPl0T3UPxm0ffYuXpIpqn+5fn09NORfKmnSp6lJmU3c3ix1xl +SCUYeoniqqSDi8bhlgb1usw4/oWFlWgR5Z0Sw3mh2hmZhoKwEV9PpTyiDmsyhaSR +Lu3RBiMdAwvILM5qjdRWiWxPkO8vSxllpHO6RhDaVt5EZsIhgWeigANUg535RHZb +wIVrlr6sznYbUR0dj23wsXrOsoVoOeVVGjpDWY8yvcc5ThTbIqAGgP6Ga+iFM9I9 +UAkkGZr9vbxHSsE99+IS8nda0RujWIXmz9Y2/rzb6zXZjlQx0KGjin1aXks/PBCD +JOG9waq87ag/vaCqt+eLcxixXgu5Q9fSWHqzocLE2K1lOPbVH4ShW3PXcz29HFst +VCjpqoZYG4rRM3FkNriuSu2n0iCFLksFZajF7E9DYuB1QCBYfgxn9jx8frwAkgNC +BolHfIAxSsnwoRI51OhfNM6CWNQd52jv4X0bOm6jN4wyl9KCy+bi/McnQkU0GQsB +GCuIcSsvu3BwSXDUFAxPeBi+MIN9CooLCVZj+HviNdFoKCag8rA3Py5FQlaiy3SI +OpgE1dPZ6oelGcr+2Ui9XWgtjcyzaLRRGKwTON5y391EIbhxtCZNYXR0aGlldSBC +YWVjaGxlciA8bS5iYWVjaGxlckBmcmVlLmZyPokCNQQTAQgAKQUCXKHDkwkQzOna +L8OekKECGwMFCR4TOAAECwcJAwUVCAo
[james-project] 05/08: Merge branch 'pr-2504'
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 86b2a8bb53bdd819beb969d89e2d69c9704981f1 Merge: 230cc6b 739f1a4 Author: Matthieu Baechler AuthorDate: Tue Jul 9 14:41:11 2019 +0200 Merge branch 'pr-2504' pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 08/08: Merge branch 'pr-2506'
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit b60d8734df81530c332a3adc17c485402abe014c Merge: cee777c df569a4 Author: Matthieu Baechler AuthorDate: Tue Jul 9 14:42:22 2019 +0200 Merge branch 'pr-2506' .../apache/james/blob/union/UnionBlobStore.java| 32 -- 1 file changed, 17 insertions(+), 15 deletions(-) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 06/08: JAMES-2822 Document usersrepository.xml options
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 48d214215c7584a031af95f811cf6d4302b741c3 Author: Gautier DI FOLCO AuthorDate: Mon Jul 8 13:30:10 2019 +0200 JAMES-2822 Document usersrepository.xml options --- src/site/xdoc/server/config-users.xml | 41 +++ 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/site/xdoc/server/config-users.xml b/src/site/xdoc/server/config-users.xml index 198ad80..3056ba4 100644 --- a/src/site/xdoc/server/config-users.xml +++ b/src/site/xdoc/server/config-users.xml @@ -15,7 +15,7 @@ "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. + under the License. --> @@ -26,19 +26,32 @@ - + - + User repositories are required to store James user information and authentication data - + Consult https://github.com/apache/james-project/tree/master/server/app/src/main/resources/usersrepository.xml";>usersrepository.xml in GIT to get some examples and hints. - + + + + + + All Users Repositories provide at least these two options + + +enableVirtualHosting +true or false. Add domain support for users (default: false, except for Cassandra Users Repository) +administratorId +user's name. Allow an user to access to the https://tools.ietf.org/html/rfc4616#section-2";>impersonation command, acting on the behalf of any user. + + - + - + JPA (database via OpenJPA) based user repository. This is the default implementation. - + The usersrepository tag as 2 attributes: name="LocalUsers" and class="org.apache.james.user.file.UsersFileRepository"> The class tag should be specified for Spring, but is not taken into acount by Guice. @@ -54,12 +67,12 @@ - + The File UsersRepository implementations below are DEPRECATED and will get removed in the next release It just listed here for backward-compatibility File-based user repositories Use these configurations to store user info in the filesystem. - + The usersrepository tag as 2 attributes:name="LocalUsers" class="org.apache.james.user.file.UsersFileRepository"> @@ -78,20 +91,20 @@ - + The JDBC UsersRepository implementations below are DEPRECATED and will get removed in the next release. It just listed here for backward-compatibility. - + Read-Only LDAP based UsersRepository - + Example: -- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 04/08: Merge branch 'pr-2509'
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 230cc6b2448cc056056d54ebdbe5e8e263d78a1b Merge: 9e040a4 b742f35 Author: Matthieu Baechler AuthorDate: Tue Jul 9 14:40:15 2019 +0200 Merge branch 'pr-2509' .../cassandra/CassandraMailRepositoryCountDAOTest.java | 5 - .../james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java | 5 - .../james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java| 5 - 3 files changed, 12 insertions(+), 3 deletions(-) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 02/08: JAMES-2820 Reduce Mono.defer usages in UnionBlobStore
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit df569a41672707a403e6ecfef6f566283690d955 Author: Gautier DI FOLCO AuthorDate: Mon Jul 8 11:30:43 2019 +0200 JAMES-2820 Reduce Mono.defer usages in UnionBlobStore Mono.defer ensure that nothing is running before a subscription is done, it's already a supplier. Using another one will do nothing more. --- .../apache/james/blob/union/UnionBlobStore.java| 32 -- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java b/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java index 74481de..9c765e5 100644 --- a/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java +++ b/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.PushbackInputStream; import java.util.Optional; +import java.util.function.BiFunction; import java.util.function.Function; -import java.util.function.Supplier; import org.apache.james.blob.api.BlobId; import org.apache.james.blob.api.BlobStore; @@ -85,9 +85,9 @@ public class UnionBlobStore implements BlobStore { @Override public Mono save(BucketName bucketName, byte[] data) { try { -return saveToCurrentFallbackIfFails( -Mono.defer(() -> currentBlobStore.save(bucketName, data)), -() -> Mono.defer(() -> legacyBlobStore.save(bucketName, data))); +return saveToCurrentFallbackIfFails(bucketName, data, +currentBlobStore::save, +legacyBlobStore::save); } catch (Exception e) { LOGGER.error("exception directly happens while saving bytes data, fall back to legacy blob store", e); return legacyBlobStore.save(bucketName, data); @@ -97,9 +97,9 @@ public class UnionBlobStore implements BlobStore { @Override public Mono save(BucketName bucketName, String data) { try { -return saveToCurrentFallbackIfFails( -Mono.defer(() -> currentBlobStore.save(bucketName, data)), -() -> Mono.defer(() -> legacyBlobStore.save(bucketName, data))); +return saveToCurrentFallbackIfFails(bucketName, data, +currentBlobStore::save, +legacyBlobStore::save); } catch (Exception e) { LOGGER.error("exception directly happens while saving String data, fall back to legacy blob store", e); return legacyBlobStore.save(bucketName, data); @@ -120,9 +120,9 @@ public class UnionBlobStore implements BlobStore { @Override public Mono save(BucketName bucketName, InputStream data) { try { -return saveToCurrentFallbackIfFails( -Mono.defer(() -> currentBlobStore.save(bucketName, data)), -() -> Mono.defer(() -> legacyBlobStore.save(bucketName, data))); +return saveToCurrentFallbackIfFails(bucketName, data, +currentBlobStore::save, +legacyBlobStore::save); } catch (Exception e) { LOGGER.error("exception directly happens while saving InputStream data, fall back to legacy blob store", e); return legacyBlobStore.save(bucketName, data); @@ -180,13 +180,15 @@ public class UnionBlobStore implements BlobStore { .switchIfEmpty(legacyBlobStore.readBytes(bucketName, blobId)); } -private Mono saveToCurrentFallbackIfFails( -Mono currentSavingOperation, -Supplier> fallbackSavingOperationSupplier) { +private Mono saveToCurrentFallbackIfFails( +BucketName bucketName, +T data, +BiFunction> currentSavingOperation, +BiFunction> fallbackSavingOperationSupplier) { -return currentSavingOperation +return Mono.defer(() -> currentSavingOperation.apply(bucketName, data)) .onErrorResume(this::logAndReturnEmpty) -.switchIfEmpty(fallbackSavingOperationSupplier.get()); +.switchIfEmpty(Mono.defer(() -> fallbackSavingOperationSupplier.apply(bucketName, data))); } private Mono logAndReturnEmpty(Throwable throwable) { - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 01/08: JAMES-2819 upgrade pdfbox to fix a security issue
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit 739f1a4286dbb7a20ba738c7fb72f87c1d11fe9b Author: Matthieu Baechler AuthorDate: Mon Jul 8 09:30:17 2019 +0200 JAMES-2819 upgrade pdfbox to fix a security issue --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 52b56ab..ddd7826 100644 --- a/pom.xml +++ b/pom.xml @@ -2452,7 +2452,7 @@ org.apache.pdfbox pdfbox -2.0.12 +2.0.16 commons-logging - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 07/08: Merge branch 'pr-2508'
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit cee777c0998ecaafffa037caecf45b2b8ccfa366 Merge: 86b2a8b 48d2142 Author: Matthieu Baechler AuthorDate: Tue Jul 9 14:41:52 2019 +0200 Merge branch 'pr-2508' src/site/xdoc/server/config-users.xml | 41 +++ 1 file changed, 27 insertions(+), 14 deletions(-) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[james-project] 03/08: JAMES-2823 fix the 3 tests that fail because of the lack of CassandraSchemaVersion table
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git commit b742f357f19063c9c8c9e6cc18cde9fc3e404f40 Author: Matthieu Baechler AuthorDate: Mon Jul 8 15:41:28 2019 +0200 JAMES-2823 fix the 3 tests that fail because of the lack of CassandraSchemaVersion table --- .../cassandra/CassandraMailRepositoryCountDAOTest.java | 5 - .../james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java | 5 - .../james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java| 5 - 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java b/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java index 471efd4..2cc685c 100644 --- a/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java +++ b/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java @@ -24,6 +24,8 @@ import static org.assertj.core.api.Assertions.assertThat; import org.apache.james.backends.cassandra.CassandraCluster; import org.apache.james.backends.cassandra.CassandraClusterExtension; import org.apache.james.backends.cassandra.CassandraRestartExtension; +import org.apache.james.backends.cassandra.components.CassandraModule; +import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule; import org.apache.james.mailrepository.api.MailRepositoryUrl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -36,7 +38,8 @@ class CassandraMailRepositoryCountDAOTest { static final MailRepositoryUrl URL2 = MailRepositoryUrl.from("proto://url2"); @RegisterExtension -static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailRepositoryModule.MODULE); +static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension( + CassandraModule.aggregateModules(CassandraSchemaVersionModule.MODULE,CassandraMailRepositoryModule.MODULE)); CassandraMailRepositoryCountDAO testee; diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java index c427d44..0042f12 100644 --- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java +++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java @@ -25,6 +25,8 @@ import java.time.Instant; import org.apache.james.backends.cassandra.CassandraCluster; import org.apache.james.backends.cassandra.CassandraClusterExtension; +import org.apache.james.backends.cassandra.components.CassandraModule; +import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule; import org.apache.james.queue.rabbitmq.MailQueueName; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -40,7 +42,8 @@ class BrowseStartDAOTest { private static final Instant NOW_PLUS_TEN_SECONDS = NOW.plusSeconds(10); @RegisterExtension -static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailQueueViewModule.MODULE); +static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension( + CassandraModule.aggregateModules(CassandraSchemaVersionModule.MODULE,CassandraMailQueueViewModule.MODULE)); private BrowseStartDAO testee; diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java index 94145c5..ee352d4 100644 --- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java +++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java @@ -27,6 +27,8 @@ import java.util.List; import org.apache.james.backends.cassandra.CassandraCluster; import org.apache.james.backends.cassandra.CassandraClusterExtension; +import org.apache.james.backends.cassandra.components.CassandraModule; +import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule; import org.apache.james.blob.api.BlobId; import org.apache.james.blob.api.HashBlobId; import org.apache.james.blob.mail.MimeMessagePartsId; @@ -60,7 +62,8 @@ class Enqueue
[james-project] branch master updated (9e040a4 -> b60d873)
This is an automated email from the ASF dual-hosted git repository. matthieu pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git. from 9e040a4 JAMES-2806 apply prefix configuration for the builder new b742f35 JAMES-2823 fix the 3 tests that fail because of the lack of CassandraSchemaVersion table new 230cc6b Merge branch 'pr-2509' new 739f1a4 JAMES-2819 upgrade pdfbox to fix a security issue new 86b2a8b Merge branch 'pr-2504' new 48d2142 JAMES-2822 Document usersrepository.xml options new cee777c Merge branch 'pr-2508' new df569a4 JAMES-2820 Reduce Mono.defer usages in UnionBlobStore new b60d873 Merge branch 'pr-2506' The 8 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: pom.xml| 2 +- .../apache/james/blob/union/UnionBlobStore.java| 32 + .../CassandraMailRepositoryCountDAOTest.java | 5 ++- .../view/cassandra/BrowseStartDAOTest.java | 5 ++- .../view/cassandra/EnqueuedMailsDaoTest.java | 5 ++- src/site/xdoc/server/config-users.xml | 41 ++ 6 files changed, 57 insertions(+), 33 deletions(-) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-2806) Adding bucket capability into BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881219#comment-16881219 ] Raphaël Ouazana commented on JAMES-2806: Why not using the (future) brand new task manager for asking rotation / creating a new buckets for the next deleted messages? When finished, this task would be responsible to update a bucket name somewhere, and it will then be used everywhere in the deleted message vault. > Adding bucket capability into BlobStore > --- > > Key: JAMES-2806 > URL: https://issues.apache.org/jira/browse/JAMES-2806 > Project: James Server > Issue Type: Sub-task > Components: Blob >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You should update current BlobStore API to be able to customize the way we > storeBlob: > - We want to store a blob in a specified bucket > {code:java} > public interface BlobStore { > Publisher save(BucketName, byte[] data); > Publisher save(BucketName, InputStream data); > Publisher readBytes(BucketName, BlobId blobId); > InputStream read(BucketName, BlobId blobId); > } > {code} > And to implement the feature of deleting buckets exceed retention time, we > need to have another additional method of deleting bucket: > {code:java} > public interface BlobStore { > Publisher delete(BucketName bucket); > } > {code} > Scope: API change, contract test, memory + object storage implementation - > cassandra will be done in a later task -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-2805) Top level implementation of the DeletedMessageVault
[ https://issues.apache.org/jira/browse/JAMES-2805?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881225#comment-16881225 ] Tellier Benoit commented on JAMES-2805: --- Story: {code:java} As an admin, using webAdmin, I want to definitly delete a deletedMessage For instance, if it contains some critical information hence I want to delete it sooner than the retention period {code} Regarding the 'single message delete' of the deletedMessageVault, we had two choices: - Deleting the metadata, which unreferences the blob, and let blob background deletion task do it's job This is bad as the content the admin wishes to deletes is still in the DeletedMessageVault. - Deleting the blob in the objectStore Then it means deleting other deletedMessages sharing this blob. This is acceptable as it is an admin triggered operation, and the side effect actually ensure all messages sharing the same MIME message would also no longer exist. We decided to implement the latest, of course documenting this behaviour will be needed. > Top level implementation of the DeletedMessageVault > --- > > Key: JAMES-2805 > URL: https://issues.apache.org/jira/browse/JAMES-2805 > Project: James Server > Issue Type: Improvement >Reporter: Tellier Benoit >Priority: Major > > While working on the deletedMessageVault, we targeted in MAILBOX-381 a first > implementation on top of MailRepositories > That decision was unfortunate as then one can browse the content of the > deletedMessageVault vault through webAdmin. > Thus we decided to implement DeletedMessageVault as a separate component. > That component has the following considerations: > - Should have a low storage cost > - Cold storage and delays upon reads are acceptable as one does not expect a > restore/export to be fast > - Find an efficient way to implement retention (deleting too old emails) > without a full scan > We decided to provide an implementation above the blobStore and a metaData > store (cassandra) > Retention will be implemented with object storage buckets (one month = 1 > bucket). We could then simply delete a bucket when all the mails it contains > are older than the retention period. > Querying the deleteMessageVault will first be done with a full scan. Later > enhancement can be done by providing a per-bucket (immutable) Lucene index - > once the bucket is no longer the latest one. -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org
[jira] [Commented] (JAMES-2806) Adding bucket capability into BlobStore
[ https://issues.apache.org/jira/browse/JAMES-2806?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16881227#comment-16881227 ] Tellier Benoit commented on JAMES-2806: --- > Why not using the (future) brand new task manager for asking rotation / > creating a new buckets for the next deleted messages? When finished, this > task would be responsible to update a bucket name somewhere, and it will then > be used everywhere in the deleted message vault. I don't understand the proposal, it's context nor how it interacts with the work on task management. > Adding bucket capability into BlobStore > --- > > Key: JAMES-2806 > URL: https://issues.apache.org/jira/browse/JAMES-2806 > Project: James Server > Issue Type: Sub-task > Components: Blob >Reporter: Tellier Benoit >Priority: Major > Fix For: 3.4.0 > > > You should update current BlobStore API to be able to customize the way we > storeBlob: > - We want to store a blob in a specified bucket > {code:java} > public interface BlobStore { > Publisher save(BucketName, byte[] data); > Publisher save(BucketName, InputStream data); > Publisher readBytes(BucketName, BlobId blobId); > InputStream read(BucketName, BlobId blobId); > } > {code} > And to implement the feature of deleting buckets exceed retention time, we > need to have another additional method of deleting bucket: > {code:java} > public interface BlobStore { > Publisher delete(BucketName bucket); > } > {code} > Scope: API change, contract test, memory + object storage implementation - > cassandra will be done in a later task -- This message was sent by Atlassian JIRA (v7.6.3#76005) - To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org