You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by bt...@apache.org on 2019/07/30 12:10:55 UTC
[james-project] branch master updated (88a160b -> 67e384d)
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 88a160b JAMES-2836 BlobStoreDeletedMessageVault grafana board
new 982ef60 JAMES-2839 fix some broken links in the documentation
new a2cdbaf JAMES-2839 add in site missing items in Configure James menu bar
new aa94ab0 JAMES-2839 little corrections on vault section in the webadmin documentation
new c2140ed JAMES-2839 Update vault configuration documentation
new 2699e74 JAMES-2839 Update the how-to vault documentation
new 055764c JAMES-2839 Add more clarity to the docker-compose file
new cabec67 JAMES-2839 Update deletedMessageVault.properties files with new documented configuration
new a483fae JAMES-2813 implement MigrationTask serialization
new 67e384d Fix Checkstyle and Eclipse warnings
The 9 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:
backends-common/cassandra/pom.xml | 9 +
.../cassandra/migration/MigrationTask.java | 37 +++-
.../james/backends/cassandra/CassandraCluster.java | 2 +-
.../backends/cassandra/CassandraClusterTest.java | 2 +-
.../migration/CassandraMigrationServiceTest.java | 1 -
.../migration/MigrationTaskSerializationTest.java | 41 ++--
dockerfiles/run/docker-compose.yml | 3 +
.../conf/deletedMessageVault.properties | 5 +-
.../conf/deletedMessageVault.properties | 5 +-
.../conf/deletedMessageVault.properties | 5 +-
.../conf/deletedMessageVault.properties | 5 +-
.../conf/deletedMessageVault.properties | 5 +-
.../mail/migration/AttachmentV2MigrationTest.java | 1 -
.../james/vault/dto/query/QueryTranslator.java | 6 +-
...aultGarbageCollectionTaskSerializationTest.java | 2 +-
.../mpt/imapmailbox/jpa/host/JPAHostSystem.java | 1 -
.../routes/DeletedMessagesVaultDeleteTask.java | 2 +-
.../routes/DeletedMessagesVaultExportTask.java | 2 +-
.../routes/DeletedMessagesVaultRestoreTask.java | 2 +-
.../server/task/json/TaskSerializationTest.java | 6 +-
src/homepage/howTo/deleted-messages-vault.html | 233 ++++++++++++++-------
src/site/markdown/server/manage-webadmin.md | 24 +--
src/site/site.xml | 2 +
src/site/xdoc/server/config-vault.xml | 18 +-
24 files changed, 281 insertions(+), 138 deletions(-)
copy mailbox/tools/indexer/src/test/java/org/apache/mailbox/tools/indexer/FullReindexingTaskSerializationTest.java => backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/MigrationTaskSerializationTest.java (54%)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 04/09: JAMES-2839 Update vault configuration
documentation
Posted by bt...@apache.org.
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 c2140ed5a4e1796e710155fbd4a7388506942976
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Jul 26 14:15:05 2019 +0700
JAMES-2839 Update vault configuration documentation
---
src/site/xdoc/server/config-vault.xml | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/site/xdoc/server/config-vault.xml b/src/site/xdoc/server/config-vault.xml
index 59b7954..6eab331 100644
--- a/src/site/xdoc/server/config-vault.xml
+++ b/src/site/xdoc/server/config-vault.xml
@@ -35,21 +35,27 @@
<p>
Note: This feature requires Guice wiring.
- To make James use DeletedMessageVault, you also need to configure the PreDeletionHook for it.
+ To make James use DeletedMessageVault, you need to configure the PreDeletionHook for it.
Example is at <a href="/server/config-listeners.html">Mailbox Listener Configuration</a>
</p>
+ <p>
+ The Deleted Messages Vault also stores and manages deleted messages into a BlobStore. The BlobStore can be either
+ based on an object storage or on Cassandra. For configuring the BlobStore the vault will use, you can look at
+ <a href="/server/config-blobstore.xml">BlobStore Configuration</a>.
+ </p>
+
<subsection name="deletedMessageVault.properties">
<p>Consult <a href="https://github.com/apache/james-project/blob/master/dockerfiles/run/guice/cassandra/destination/conf/deletedMessageVault.properties">deletedMessageVault.properties</a>
to get some examples and hints.</p>
<br/>
<dl>
- <dt><strong>urlPrefix</strong></dt>
- <dd>Define prefix value of namespace in MailRepository where deleted messages are stored (default: default mail repository protocol + var/deletedMessages/vault)</dd>
-
<dt><strong>retentionPeriod</strong></dt>
- <dd>Deleted messages stored in the Deleted Messages Vault are expired after this period, (default: 1 year)</dd>
+ <dd>
+ Deleted messages stored in the Deleted Messages Vault are expired after this period (default: 1 year).
+ It can be expressed in <b>y</b> years, <b>d</b> days, <b>h</b> hours, ...
+ </dd>
</dl>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 03/09: JAMES-2839 little corrections on vault
section in the webadmin documentation
Posted by bt...@apache.org.
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 aa94ab0b2c55346424aa173621cb0f76a4028612
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Thu Jul 25 17:46:17 2019 +0700
JAMES-2839 little corrections on vault section in the webadmin documentation
---
src/site/markdown/server/manage-webadmin.md | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/site/markdown/server/manage-webadmin.md b/src/site/markdown/server/manage-webadmin.md
index 1fe66a1..8badba6 100644
--- a/src/site/markdown/server/manage-webadmin.md
+++ b/src/site/markdown/server/manage-webadmin.md
@@ -2758,7 +2758,7 @@ Not implemented yet.
## Deleted Messages Vault
-The 'Deleted Message Vault plugin' allows you to keep users deleted messages during a given retention time. This set of routes allow you to *restore* users deleted messages or export them in an archive (not implemented yet).
+The 'Deleted Message Vault plugin' allows you to keep users deleted messages during a given retention time. This set of routes allow you to *restore* users deleted messages or export them in an archive.
To move deleted messages in the vault, you need to specifically configure the DeletedMessageVault PreDeletionHook.
@@ -2769,7 +2769,7 @@ Here are the following actions available on the 'Deleted Messages Vault'
- [Purge Deleted Messages](#Purge_Deleted_Messages)
- [Permanently Remove Deleted Message](#Permanently_Remove_Deleted_Message)
- Note that the 'Deleted Messages Vault' feature is only supported on top of Cassandra-Guice.
+ Note that the 'Deleted Messages Vault' feature is supported on top of all available Guice products.
### Restore Deleted Messages
@@ -2778,7 +2778,7 @@ Deleted messages of a specific user can be restored by calling the following end
```
curl -XPOST http://ip:port/deletedMessages/users/userToRestore@domain.ext?action=restore
-{"
+{
"combinator": "and",
"criteria": [
{
@@ -2820,17 +2820,17 @@ curl -XPOST http://ip:port/deletedMessages/users/userToRestore@domain.ext?action
};
```
-The requested Json body is made from list of criterion objects which have following structure:
+The requested Json body is made from a list of criterion objects which have the following structure:
```
{
"fieldName": "supportedFieldName",
"operator": "supportedOperator",
- "value": "A plain string represents for the matching value of the corresponding field"
+ "value": "A plain string representing the matching value of the corresponding field"
}
```
-Deleted Messages which are matched with **all** criterions in the query body will be restored. Here are list of supported fieldName for the restoring:
+Deleted Messages which are matched with the **all** criterion in the query body will be restored. Here are a list of supported fieldName for the restoring:
- subject: represents for deleted message `subject` field matching. Supports below string operators:
- contains
@@ -2852,13 +2852,13 @@ Deleted Messages which are matched with **all** criterions in the query body wil
- originMailboxes: represents for deleted message `originMailboxes` field matching. Tested value is a string serialized of mailbox id. Supports list mailbox id operators:
- contains: does the tested deleted message's originMailbox ids contain tested mailbox id ?
-Messages in the Deleted Messages Vault of an specified user that are matched with Query Json Object in the body will be appended to his 'Restored-Messages' mailbox, which will be created if needed.
+Messages in the Deleted Messages Vault of a specified user that are matched with Query Json Object in the body will be appended to his 'Restored-Messages' mailbox, which will be created if needed.
**Note**:
- - Query parameter `action` is required and should have value `restore` to represent for restoring feature. Otherwise, a bad request response will be returned
+ - Query parameter `action` is required and should have the value `restore` to represent the restoring feature. Otherwise, a bad request response will be returned
- Query parameter `action` is case sensitive
- - fieldName & operator for passing to the routes are case sensitive
+ - fieldName & operator passed to the routes are case sensitive
- Currently, we only support query combinator `and` value, otherwise, requests will be rejected
- If you only want to restore by only one criterion, the json body could be simplified to a single criterion:
@@ -2870,7 +2870,7 @@ Messages in the Deleted Messages Vault of an specified user that are matched wit
}
```
- - For restoring all deleted messages, passing a query json with empty criterion list to represent `matching all deleted messages`:
+ - For restoring all deleted messages, passing a query json with an empty criterion list to represent `matching all deleted messages`:
```
{
@@ -2951,9 +2951,9 @@ while:
### Purge Deleted Messages
-You can overwrite 'retentionPeriod' configuration in 'deletedMessageVault' configuration file or use default value is 1 year.
+You can overwrite 'retentionPeriod' configuration in 'deletedMessageVault' configuration file or use the default value of 1 year.
-Purge all deleted messages older than configured 'retentionPeriod'
+Purge all deleted messages older than the configured 'retentionPeriod'
```
curl -XDEL http://ip:port/deletedMessages?scope=expired
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 08/09: JAMES-2813 implement MigrationTask
serialization
Posted by bt...@apache.org.
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 a483fae393325339fc09ae126501d3aa9da8ae4d
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Thu Jul 25 11:55:11 2019 +0200
JAMES-2813 implement MigrationTask serialization
---
backends-common/cassandra/pom.xml | 9 ++++
.../cassandra/migration/MigrationTask.java | 37 +++++++++++++-
.../migration/MigrationTaskSerializationTest.java | 57 ++++++++++++++++++++++
3 files changed, 102 insertions(+), 1 deletion(-)
diff --git a/backends-common/cassandra/pom.xml b/backends-common/cassandra/pom.xml
index 8cdd17c..be63401 100644
--- a/backends-common/cassandra/pom.xml
+++ b/backends-common/cassandra/pom.xml
@@ -49,6 +49,10 @@
</dependency>
<dependency>
<groupId>${james.groupId}</groupId>
+ <artifactId>james-server-task-json</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${james.groupId}</groupId>
<artifactId>james-server-util</artifactId>
</dependency>
<dependency>
@@ -94,6 +98,11 @@
<version>0.3.0</version>
</dependency>
<dependency>
+ <groupId>net.javacrumbs.json-unit</groupId>
+ <artifactId>json-unit-assertj</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<scope>test</scope>
diff --git a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
index 16c4d81..632fdc0 100644
--- a/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
+++ b/backends-common/cassandra/src/main/java/org/apache/james/backends/cassandra/migration/MigrationTask.java
@@ -22,17 +22,22 @@ package org.apache.james.backends.cassandra.migration;
import static org.apache.james.backends.cassandra.versions.CassandraSchemaVersionManager.DEFAULT_VERSION;
import java.util.Optional;
+import java.util.function.Function;
import javax.inject.Inject;
import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionDAO;
import org.apache.james.backends.cassandra.versions.SchemaTransition;
import org.apache.james.backends.cassandra.versions.SchemaVersion;
+import org.apache.james.json.DTOModule;
+import org.apache.james.server.task.json.dto.TaskDTO;
+import org.apache.james.server.task.json.dto.TaskDTOModule;
import org.apache.james.task.Task;
import org.apache.james.task.TaskExecutionDetails;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.fge.lambdas.Throwing;
import com.google.common.annotations.VisibleForTesting;
import reactor.util.function.Tuple2;
@@ -40,6 +45,35 @@ import reactor.util.function.Tuples;
public class MigrationTask implements Task {
+ @VisibleForTesting
+ static final Function<Factory, TaskDTOModule<MigrationTask, MigrationTaskDTO>> SERIALIZATION_MODULE =
+ factory -> DTOModule.forDomainObject(MigrationTask.class)
+ .convertToDTO(MigrationTaskDTO.class)
+ .toDomainObjectConverter(dto -> factory.create(new SchemaVersion(dto.targetVersion)))
+ .toDTOConverter((task, type) -> new MigrationTaskDTO(type, task.target.getValue()))
+ .typeName("cassandra-migration-task")
+ .withFactory(TaskDTOModule::new);
+
+ private static class MigrationTaskDTO implements TaskDTO {
+
+ private final String type;
+ private final int targetVersion;
+
+ MigrationTaskDTO(@JsonProperty("type") String type, @JsonProperty("targetVersion") int targetVersion) {
+ this.type = type;
+ this.targetVersion = targetVersion;
+ }
+
+ @Override
+ public String getType() {
+ return type;
+ }
+
+ public int getTargetVersion() {
+ return targetVersion;
+ }
+ }
+
public interface Factory {
MigrationTask create(SchemaVersion target);
}
@@ -132,7 +166,7 @@ public class MigrationTask implements Task {
private String failureMessage(SchemaVersion newVersion) {
return String.format("Migrating to version %d partially done. " +
- "Please check logs for cause of failure and re-run this migration.", newVersion.getValue());
+ "Please check logs for cause of failure and re-run this migration.", newVersion.getValue());
}
@Override
@@ -144,4 +178,5 @@ public class MigrationTask implements Task {
public Optional<TaskExecutionDetails.AdditionalInformation> details() {
return Optional.of(new Details(target));
}
+
}
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/MigrationTaskSerializationTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/MigrationTaskSerializationTest.java
new file mode 100644
index 0000000..9fde422
--- /dev/null
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/MigrationTaskSerializationTest.java
@@ -0,0 +1,57 @@
+/****************************************************************
+ * 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.backends.cassandra.migration;
+
+import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Mockito.mock;
+
+import java.io.IOException;
+
+import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionDAO;
+import org.apache.james.backends.cassandra.versions.SchemaVersion;
+import org.apache.james.server.task.json.JsonTaskSerializer;
+import org.junit.jupiter.api.Test;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+
+class MigrationTaskSerializationTest {
+
+ private static final int SCHEMA_VERSION = 12;
+ private static final String SERIALIZED_TASK = "{\"type\": \"cassandra-migration-task\", \"targetVersion\": 12}";
+
+ private final CassandraSchemaVersionDAO cassandraSchemaVersionDAO = mock(CassandraSchemaVersionDAO.class);
+ private final CassandraSchemaTransitions transitions = mock(CassandraSchemaTransitions.class);
+ private final MigrationTask.Factory factory = target -> new MigrationTask(cassandraSchemaVersionDAO, transitions, target);
+ private final JsonTaskSerializer taskSerializer = new JsonTaskSerializer(MigrationTask.SERIALIZATION_MODULE.apply(factory));
+
+ @Test
+ void taskShouldBeSerializable() throws JsonProcessingException {
+ MigrationTask task = factory.create(new SchemaVersion(SCHEMA_VERSION));
+ assertThatJson(taskSerializer.serialize(task)).isEqualTo(SERIALIZED_TASK);
+ }
+
+ @Test
+ void taskShouldBeDeserializable() throws IOException {
+ MigrationTask task = factory.create(new SchemaVersion(SCHEMA_VERSION));
+ assertThat(taskSerializer.deserialize(SERIALIZED_TASK))
+ .isEqualToComparingFieldByField(task);
+ }
+
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 01/09: JAMES-2839 fix some broken links in the
documentation
Posted by bt...@apache.org.
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 982ef6029cd3871fe37440a7734e49ab77b78624
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Wed Jul 24 16:00:21 2019 +0700
JAMES-2839 fix some broken links in the documentation
---
src/homepage/howTo/deleted-messages-vault.html | 2 +-
src/site/xdoc/server/config-vault.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/homepage/howTo/deleted-messages-vault.html b/src/homepage/howTo/deleted-messages-vault.html
index 34d4459..d1c5824 100644
--- a/src/homepage/howTo/deleted-messages-vault.html
+++ b/src/homepage/howTo/deleted-messages-vault.html
@@ -241,7 +241,7 @@ blob.export.implementation=localFile
</code></pre>
<p>
- More details about configuration & example at <a href="/server/config-blob-expor.html">Blob Export Configuration</a>
+ More details about configuration & example at <a href="/server/config-blob-export.html">Blob Export Configuration</a>
</p>
</div>
<footer class="major">
diff --git a/src/site/xdoc/server/config-vault.xml b/src/site/xdoc/server/config-vault.xml
index 289a339..59b7954 100644
--- a/src/site/xdoc/server/config-vault.xml
+++ b/src/site/xdoc/server/config-vault.xml
@@ -36,7 +36,7 @@
<p>
Note: This feature requires Guice wiring.
To make James use DeletedMessageVault, you also need to configure the PreDeletionHook for it.
- Example is at <a href="server/config-listeners.html">Mailbox Listener Configuration</a>
+ Example is at <a href="/server/config-listeners.html">Mailbox Listener Configuration</a>
</p>
<subsection name="deletedMessageVault.properties">
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 06/09: JAMES-2839 Add more clarity to the
docker-compose file
Posted by bt...@apache.org.
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 055764cdd9552e382f5a32f2fb0f370297f5cbea
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Jul 26 15:41:44 2019 +0700
JAMES-2839 Add more clarity to the docker-compose file
---
dockerfiles/run/docker-compose.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/dockerfiles/run/docker-compose.yml b/dockerfiles/run/docker-compose.yml
index 814d930..b9611e3 100644
--- a/dockerfiles/run/docker-compose.yml
+++ b/dockerfiles/run/docker-compose.yml
@@ -31,13 +31,16 @@ services:
image: cassandra:3.11.3
ports:
- "9042:9042"
+
tika:
image: logicalspark/docker-tikaserver:1.20
+
rabbitmq:
image: rabbitmq:3.7.7-management
ports:
- "5672:5672"
- "15672:15672"
+
swift:
image: linagora/openstack-keystone-swift:pike
ports:
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 07/09: JAMES-2839 Update
deletedMessageVault.properties files with new documented configuration
Posted by bt...@apache.org.
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 cabec6753c9b2c3f12a5106d6aec482c53ae6ba7
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Mon Jul 29 14:14:29 2019 +0700
JAMES-2839 Update deletedMessageVault.properties files with new documented configuration
---
.../cassandra-ldap/destination/conf/deletedMessageVault.properties | 5 ++++-
.../destination/conf/deletedMessageVault.properties | 5 ++++-
.../destination/conf/deletedMessageVault.properties | 5 ++++-
.../guice/cassandra/destination/conf/deletedMessageVault.properties | 5 ++++-
.../run/guice/memory/destination/conf/deletedMessageVault.properties | 5 ++++-
5 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/dockerfiles/run/guice/cassandra-ldap/destination/conf/deletedMessageVault.properties b/dockerfiles/run/guice/cassandra-ldap/destination/conf/deletedMessageVault.properties
index 8c14c8e..ab1e3ee 100644
--- a/dockerfiles/run/guice/cassandra-ldap/destination/conf/deletedMessageVault.properties
+++ b/dockerfiles/run/guice/cassandra-ldap/destination/conf/deletedMessageVault.properties
@@ -1 +1,4 @@
-urlPrefix=cassandra://var/deletedMessages/vault
\ No newline at end of file
+# ============================================= Deleted Messages Vault Configuration ==================================
+# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/deletedMessageVault.properties b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/deletedMessageVault.properties
index 8c14c8e..ab1e3ee 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/deletedMessageVault.properties
+++ b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/deletedMessageVault.properties
@@ -1 +1,4 @@
-urlPrefix=cassandra://var/deletedMessages/vault
\ No newline at end of file
+# ============================================= Deleted Messages Vault Configuration ==================================
+# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/deletedMessageVault.properties b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/deletedMessageVault.properties
index 8c14c8e..ab1e3ee 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/deletedMessageVault.properties
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/deletedMessageVault.properties
@@ -1 +1,4 @@
-urlPrefix=cassandra://var/deletedMessages/vault
\ No newline at end of file
+# ============================================= Deleted Messages Vault Configuration ==================================
+# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/destination/conf/deletedMessageVault.properties b/dockerfiles/run/guice/cassandra/destination/conf/deletedMessageVault.properties
index 8c14c8e..ab1e3ee 100644
--- a/dockerfiles/run/guice/cassandra/destination/conf/deletedMessageVault.properties
+++ b/dockerfiles/run/guice/cassandra/destination/conf/deletedMessageVault.properties
@@ -1 +1,4 @@
-urlPrefix=cassandra://var/deletedMessages/vault
\ No newline at end of file
+# ============================================= Deleted Messages Vault Configuration ==================================
+# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
\ No newline at end of file
diff --git a/dockerfiles/run/guice/memory/destination/conf/deletedMessageVault.properties b/dockerfiles/run/guice/memory/destination/conf/deletedMessageVault.properties
index 56942d0..7ac88e8 100644
--- a/dockerfiles/run/guice/memory/destination/conf/deletedMessageVault.properties
+++ b/dockerfiles/run/guice/memory/destination/conf/deletedMessageVault.properties
@@ -1 +1,4 @@
-urlPrefix=memory://var/deletedMessages/vault
+# ============================================= Deleted Messages Vault Configuration ==================================
+# Retention period for your deleted messages into the vault, after which they expire and can be potentially cleaned up
+# Optional, default 1y
+# retentionPeriod=1y
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 05/09: JAMES-2839 Update the how-to vault
documentation
Posted by bt...@apache.org.
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 2699e74e6d9b347de6aa627d682c5d297d3cb2cb
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Fri Jul 26 15:41:21 2019 +0700
JAMES-2839 Update the how-to vault documentation
---
src/homepage/howTo/deleted-messages-vault.html | 233 ++++++++++++++++---------
1 file changed, 155 insertions(+), 78 deletions(-)
diff --git a/src/homepage/howTo/deleted-messages-vault.html b/src/homepage/howTo/deleted-messages-vault.html
index d1c5824..6459044 100644
--- a/src/homepage/howTo/deleted-messages-vault.html
+++ b/src/homepage/howTo/deleted-messages-vault.html
@@ -28,38 +28,39 @@ layout: howTo
<div class="">
<div class="content align-left">
<header class="major">
- <h1><b>Deleted Messages Vault</b></h1>
+ <h1>Deleted Messages Vault</h1>
</header>
<p>
- This document will help you understand what is Deleted Messages Vault. And finally,
- present to you, how to setup James Server with this feature.
+ The goal of this document is to help you to understand better about this feature and to present you the following topics:
</p>
<ul>
- <li>What is Deleted Messages Vault</li>
+ <li>What is Deleted Messages Vault ?</li>
<li>How to setup James with Deleted Messages Vault</li>
- <li>How to administrate Deleted Messages Vault</li>
+ <li>Deleted Messages Vault administration</li>
+ <li>Example: Starting James with enabled Deleted Messages Vault by docker compose</li>
</ul>
<header class="major">
- <h2><b>What is Deleted Messages Vault</b></h2>
+ <h2>What is Deleted Messages Vault ?</h2>
</header>
- <p>Deleted Messages Vault is a feature in James, it allows you to:</p>
+ <p>Deleted Messages Vault is a feature in James allowing you to:</p>
<ul>
- <li>retain user deleted messages for some time</li>
+ <li>retain users deleted messages for some time</li>
<li>restore & export deleted messages by various criteria</li>
<li>permanently delete some retained messages</li>
</ul>
<p>
- If Deleted Messages Vault is enabled, when users delete their mails, James will retain these mails into Deleted Messages Vault.
+ If the Deleted Messages Vault is enabled, when users delete their mails, and by that we mean when he tries
+ to definitely delete them by emptying the trash, James will retain these mails into the Deleted Messages Vault.
And only administrators can interact with this component via WebAdmin REST APIs.
</p>
<p>
One useful use of that feature is to allow an administrator to restore some mails an user may have deleted by accident.
- However, mails are not retained forever as you have to configure a retention period before using it (we'll see later how to trigger the collection of mails).
+ However, mails are not retained forever as you have to configure a retention period before using it (with a one year retention by default if not defined).
It's also possible to permanently delete a mail if needed.
</p>
<p>
@@ -67,34 +68,39 @@ layout: howTo
At the moment, these are supported mail properties for filtering:
</p>
<ul>
- <li>deletion date(ISO-8601 Date String)
+ <li>deletion date (ISO-8601 Date String)
<ul>
<li>supports before or equals operator</li>
<li>supports after or equals operator</li>
</ul>
</li>
- <li>delivery date(ISO-8601 Date String)
+ <li>delivery date (ISO-8601 Date String)
<ul>
<li>supports before or equals operator</li>
<li>supports after or equals operator</li>
</ul>
</li>
- <li>recipients(List of string)
+ <li>recipients (List of strings)
<ul>
<li>supports contains operator</li>
</ul>
</li>
- <li>sender(String)
+ <li>sender (String)
<ul>
<li>supports equal matching operator</li>
</ul>
</li>
- <li>has attachment(Boolean)
+ <li>has attachment (Boolean)
<ul>
<li>supports equal matching operator</li>
</ul>
</li>
- <li>subject(String)
+ <li>origin mailboxes (List of strings)
+ <ul>
+ <li>supports contains matching operator</li>
+ </ul>
+ </li>
+ <li>subject (String)
<ul>
<li>supports equal matching operator</li>
<li>supports equal ignore case matching operator</li>
@@ -105,32 +111,93 @@ layout: howTo
</ul>
<header class="major">
- <h2><b>How to setup James with Deleted Messages Vault</b></h2>
+ <h2>How to setup James with Deleted Messages Vault</h2>
</header>
<p>
- In this section, we will guide you to setup James with Deleted Message Vault by following below steps:
+ In this section, we will guide you to setup James with Deleted Messages Vault by following the steps below:
</p>
<ul>
- <li>Enable Deleted Messages Vault</li>
- <li>Make James uses Deleted Messages Vault by configuring Pre Deletion Hooks</li>
- <li>Starting James with enabled Deleted Message Vault by docker compose</li>
+ <li>Enable Deleted Messages Vault by configuring Pre Deletion Hooks</li>
+ <li>Configuring your BlobStore</li>
+ <li>Configuring the retention time for the Deleted Messages Vault</li>
</ul>
<header class="major">
- <h3><b>Enable Deleted Messages Vault</b></h3>
+ <h4>Enable Deleted Messages Vault by configuring Pre Deletion Hooks</h4>
</header>
<p>
- To do this, you have to create a configuration file <b>deletedMessageVault.properties</b>, then put it into <b>conf</b> directory of James.
- There are two available properties you may want to configure:
+ By default, you need to configure a Pre Deletion Hook to let James use it.
+ Before deleting a mail in James, PreDeletionHooks will be triggered to execute all declared hooks. If all hook executions success, then James will process to delete that mail.
+ There is already a DeletedMessageVaultHook in James, its job is to store deleted mails into Deleted Messages Vault. Thus, you need to configure this hook in listeners.xml configuration file.
+ </p>
+
+ <p>
+ Sample DeletedMessageVaultHook configuration:
+ </p>
+ <pre><code>
+<listeners>
+ <listener>
+ ...
+ </listener>
+ ...
+ <preDeletionHook>
+ <class>org.apache.james.vault.DeletedMessageVaultHook</class>
+ </preDeletionHook>
+</listeners>
+ </code></pre>
+ <p>
+ More details about configuration & example is at <a href="/server/config-listeners.html">Pre Deletion Hook Configuration</a>
+ </p>
+
+ <header class="major">
+ <h4>Configuring your BlobStore</h4>
+ </header>
+
+ <p>
+ The Deleted Messages Vault is using a BlobStore to store and manage the deleted messages. A BlobStore is a dedicated
+ component to store blobs, non-indexable content. There is different implementations available for the BlobStore on top
+ of Cassandra or file object storage services like Openstack Swift and AWS S3.
+ </p>
+
+ <p>
+ Let's consider that we want to store those deleted messages into an Openstack Swift object storage. So the configuration
+ in the blob.properties file should look similar to this:
+ </p>
+
+ <pre><code>
+implementation=objectstorage
+
+# Configuration for swift BlobStore
+objectstorage.payload.codec=DEFAULT
+objectstorage.provider=swift
+objectstorage.namespace=james
+objectstorage.swift.authapi=tmpauth
+objectstorage.swift.endpoint=http://swift:8080/auth/v1.0
+objectstorage.swift.credentials=testing
+objectstorage.swift.tempauth.username=tester
+objectstorage.swift.tempauth.tenantname=test
+objectstorage.swift.tempauth.passheadername=X-Storage-Pass
+objectstorage.swift.tempauth.userheadername=X-Storage-User
+ </code></pre>
+
+ <p>
+ If you want to dig deeper into the subject, or use an other implementation, you can find more details about this at the
+ <a href="/server/config-blobstore.html">BlobStore Configuration</a> page.
+ </p>
+
+ <header class="major">
+ <h4>Configuring the retention time for the Deleted Messages Vault</h4>
+ </header>
+
+ <p>
+ To do this, you have to create a configuration file <b>deletedMessageVault.properties</b>, then put it into the <b>conf</b> directory of James.
+ There is only one available property you may want to configure at the moment:
</p>
<ul>
<li>
- <b>urlPrefix</b>: represent for the prefix of namespace Deleted Messages Vault will use to store deleted messages.
- </li>
- <li>
- <b>retentionPeriod</b>: represent for the period deleted messages allowed to be stored in Deleted Messages Vault.
+ <b>retentionPeriod</b>: represent for the period deleted messages allowed to be stored in Deleted Messages Vault (default of one year).
</li>
</ul>
@@ -138,112 +205,122 @@ layout: howTo
Example:
</p>
<pre><code>
-urlPrefix=cassandra://var/deletedMessages/vault
-retentionPeriod=1 year
+retentionPeriod=1y
</code></pre>
<p>
- More details about configuration & example is at <a href="/server/config-vault.html">Deleted Messages Vault Configuration</a>
+ More details about configuration & example can be found at
+ <a href="/server/config-vault.html">Deleted Messages Vault Configuration</a>
</p>
<header class="major">
- <h3><b>Make James uses Deleted Messages Vault by configuring Pre Deletion Hooks</b></h3>
+ <h2>Deleted Messages Vault administration</h2>
</header>
<p>
- By default, although Deleted Messages Vault has been configured, but, to make it really work, you still need to configure Pre Deletion Hooks to lets James use it.
- Before deleting a mail in James, PreDeletionHooks will be triggered to execute all hooks. If all hook executions success, then James will process to delete that mail.
- There is already a DeletedMessageVaultHook in James, its job to store deleted mails into Deleted Messages Vault. Thus, you need to configure this hook in listeners.xml configuration file.
+ These are supported WebAdmin features on top of Deleted Messages Vault.
+ You can have a look at the WebAdmin Deleted Messages Vault documentation <a href="/server/manage-webadmin.html#Deleted_Messages_Vault">here</a>
</p>
+ <header class="major">
+ <h4>WebAdmin Deleted Messages Vault exporting</h4>
+ </header>
+
<p>
- Sample DeletedMessageVaultHook configuration:
+ When the administrator needs to export some user's deleted messages, you are able to choose which exporting mechanism should be used.
+ At the moment there are two available exporting mechanisms:
</p>
+
+ <ul>
+ <li>
+ <b>localFile</b>: This is a simple exporting mechanism. Through an export request, it retrieves deleted mails from Deleted Messages Vault,
+ then store them as a zip file in James Server local file system. Then it sends a mail with the absolute path of exported file to the targeted mail address.
+ </li>
+ <li>
+ <b>linshare</b>: Instead of exporting blobs to the local file system, using
+ <a href="https://www.linshare.org/en/index.html">LinShare</a> helps you upload your blobs and people
+ you have been sharing to can access those blobs by accessing the LinShare server and download them.
+ </li>
+ </ul>
+
+ <p>
+ You can configure which kind of export mechanism you want to use in James by specifying <b>blob.export.implementation</b> property in blob.properties configuration file.
+ E.g:
+ </p>
+
<pre><code>
-<listeners>
- <listener>
- ...
- </listener>
- ...
- <preDeletionHook>
- <class>org.apache.james.vault.DeletedMessageVaultHook</class>
- </preDeletionHook>
-</listeners>
+blob.export.implementation=localFile
</code></pre>
+
<p>
- More details about configuration & example is at <a href="/server/config-listener.html">Pre Deletion Hook Configuration</a>
+ You can find more details about configuration & example at <a href="/server/config-blob-export.html">Blob Export Configuration</a> page
</p>
<header class="major">
- <h3><b>Starting James with enabled Deleted Message Vault by docker compose</b></h3>
+ <h2>Example: Starting James with enabled Deleted Messages Vault by docker compose</h2>
</header>
- <p>We will take James cassandra product for the example</p>
+ <p>
+ And now to sum up everything we have seen until now and put it into practice, we will take
+ James cassandra-rabbitmq product for the example
+ </p>
+
+ <p>First, get the template cassandra-rabbitmq product configuration:</p>
- <p>First, get template cassandra product configuration:</p>
<pre><code>
$ git clone https://github.com/apache/james-project
-$ cp -rf james-project/dockerfiles/run/guice/cassandra/destination/conf conf
+$ cp -rf james-project/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf conf
</code></pre>
<p>Then create the keystore file in the conf/ directory with the default password <code>james72laBalle</code>
+
<pre><code>
$ keytool -genkey -alias james -keyalg RSA -keystore conf/keystore
</code></pre>
- <p>Second, modify deletedMessageVault.properties configuration file like an example at previous paragraph</p>
+ <p>Second, modify deletedMessageVault.properties configuration file like in the previous example</p>
<p>Third, modify listeners.xml to configure DeletedMessageVaultHook by adding preDeletionHook section at previous paragraph</p>
- <p>Fourth, We will create a local folder for holding data out of the container:</p>
+ <p>
+ Fourth, modify blob.properties file to configure the BlobStore that will be used and the file exporting mechanism, like
+ we saw previously as well.
+ </p>
+
+ <p>Fifth, we will create a local folder for holding data out of the container:</p>
+
<pre><code>
-mkdir var
+$ mkdir var
</code></pre>
<p>Finally, starting a James Server by docker compose</p>
+
<p>Getting James docker-compose.yml</p>
+
<pre><code>
$ wget https://raw.githubusercontent.com/apache/james-project/master/dockerfiles/run/docker-compose.yml
</code></pre>
<p>Add the following volumes for james service:</p>
+
<pre><code>
volumes:
- $PWD/conf:/root/conf/
- $PWD/var:/root/var/
</code></pre>
- <header class="major">
- <h2><b>How to administrate Deleted Messages Vault</b></h2>
- </header>
-
<p>
- These are supported WebAdmin features on top of Deleted Messages Vault.
- You can have a look at WebAdmin Deleted Messages Vault document at <a href="https://james.apache.org/server/manage-webadmin.html#Deleted_Messages_Vault">here</a>
+ Then you can run it and you should have a James server with an enabled Deleted Messages Vault. You can then
+ refer to <a href="/server/manage-webadmin.html">WebAdmin documentation</a> to create a few users, domains,
+ mailboxes, and then connecting to it your favorite mail client to start sending messages between
+ those users and deleting them.
</p>
- <header class="major">
- <h3><b>WebAdmin Deleted Messages Vault exporting</b></h3>
- </header>
-
- <p>
- This part is a bit special to you, you are able to choose which exporting mechanism to be used. At the moment there are one available exporting mechanism
- </p>
- <ul>
- <li><b>localFile</b>: This is a simple exporting mechanism while with an export request, it retrieves deleted mails from Deleted Messages Vault,
- then store them as a zip file in local file system in James Server. Then sending a mail with the absolute path of exported file to the targeted mail address.</li>
- </ul>
<p>
- You can configure which kind of export mechanism to use in James by specifying <b>blob.export.implementation</b> in blobStore.properties configuration file.
- E.g:
+ And finally you can check more specifically the <a href="/server/manage-webadmin.html#Deleted_Messages_Vault">WebAdmin Deleted Messages Vault documentation</a> to explore all the possibilities of the vault.
</p>
- <pre><code>
-blob.export.implementation=localFile
- </code></pre>
- <p>
- More details about configuration & example at <a href="/server/config-blob-export.html">Blob Export Configuration</a>
- </p>
</div>
+
<footer class="major">
<ul class="actions align-center">
<li><a href="index.html" class="button">go back to other how-tos</a></li>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 02/09: JAMES-2839 add in site missing items in
Configure James menu bar
Posted by bt...@apache.org.
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 a2cdbafe83e582d6223e70b3cbd526738c24660c
Author: Rene Cordier <rc...@linagora.com>
AuthorDate: Wed Jul 24 17:25:22 2019 +0700
JAMES-2839 add in site missing items in Configure James menu bar
---
src/site/site.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/site/site.xml b/src/site/site.xml
index 59f6d31..1d34f43 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -120,6 +120,7 @@
<item name="BlobStore" href="/server/config-blobstore.html" />
<item name="Cassandra" href="/server/config-cassandra.html" />
<item name="ElasticSearch" href="/server/config-elasticsearch.html" />
+ <item name="Deleted Messages Vault" href="/server/config-vault.html" />
<item name="DNS Service" href="/server/config-dnsservice.html" />
<item name="Domain List" href="/server/config-domainlist.html" />
<item name="Events" href="/server/config-events.html" />
@@ -140,6 +141,7 @@
<item name="System" href="/server/config-system.html" />
<item name="Spring JPA Postgres" href="/server/config-spring-jpa-postgres.html" />
<item name="Users" href="/server/config-users.html" />
+ <item name="WebAdmin" href="/server/config-webadmin.html" />
</item>
<item name="5. Manage" href="/server/manage.html" collapse="true" >
<item name="Command line" href="/server/manage-cli.html" />
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 09/09: Fix Checkstyle and Eclipse warnings
Posted by bt...@apache.org.
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 67e384d3d2e82e8a7cf89be7f9ed495564aa81d2
Author: Raphael Ouazana <ra...@linagora.com>
AuthorDate: Mon Jul 29 15:27:54 2019 +0200
Fix Checkstyle and Eclipse warnings
---
.../java/org/apache/james/backends/cassandra/CassandraCluster.java | 2 +-
.../org/apache/james/backends/cassandra/CassandraClusterTest.java | 2 +-
.../backends/cassandra/migration/CassandraMigrationServiceTest.java | 1 -
.../mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java | 1 -
.../main/java/org/apache/james/vault/dto/query/QueryTranslator.java | 6 +++++-
.../vault/utils/VaultGarbageCollectionTaskSerializationTest.java | 2 +-
.../org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java | 1 -
.../james/webadmin/vault/routes/DeletedMessagesVaultDeleteTask.java | 2 +-
.../james/webadmin/vault/routes/DeletedMessagesVaultExportTask.java | 2 +-
.../webadmin/vault/routes/DeletedMessagesVaultRestoreTask.java | 2 +-
.../org/apache/james/server/task/json/TaskSerializationTest.java | 6 +++---
11 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
index 1517e00..6c95990 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraCluster.java
@@ -49,7 +49,7 @@ public final class CassandraCluster implements AutoCloseable {
}
private static void assertClusterNotRunning() {
- startStackTrace.ifPresent( e -> {
+ startStackTrace.ifPresent(e -> {
throw new IllegalStateException("Cluster already running, look at the cause for the initial connection creation call trace", e);
});
}
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraClusterTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraClusterTest.java
index 6046770..acccefc 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraClusterTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/CassandraClusterTest.java
@@ -61,7 +61,7 @@ class CassandraClusterTest {
connection.close();
assertThatCode(() -> {
try (CassandraCluster cluster = createCluster()) {
-
+ // Trigger autoclose
}
}).doesNotThrowAnyException();
}
diff --git a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
index 0410313..d99ca30 100644
--- a/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
+++ b/backends-common/cassandra/src/test/java/org/apache/james/backends/cassandra/migration/CassandraMigrationServiceTest.java
@@ -29,7 +29,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
-import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
diff --git a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
index 2100a37..ffcf48a 100644
--- a/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
+++ b/mailbox/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/migration/AttachmentV2MigrationTest.java
@@ -31,7 +31,6 @@ 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.init.configuration.CassandraConfiguration;
-import org.apache.james.backends.cassandra.migration.Migration;
import org.apache.james.blob.api.BucketName;
import org.apache.james.blob.api.HashBlobId;
import org.apache.james.blob.cassandra.CassandraBlobModule;
diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryTranslator.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryTranslator.java
index 0467343..cfc9c26 100644
--- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryTranslator.java
+++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/dto/query/QueryTranslator.java
@@ -117,6 +117,7 @@ public class QueryTranslator {
FieldValueSerializer<Boolean> BOOLEAN_SERIALIZER = Object::toString;
FieldValueSerializer<MailAddress> MAIL_ADDRESS_SERIALIZER = MailAddress::asString;
+ @SuppressWarnings("rawtypes")
static Optional<FieldValueSerializer> getSerializerForValue(Object value) {
if (value instanceof MailboxId) {
return Optional.of(MAILBOX_ID_SERIALIZER);
@@ -205,12 +206,15 @@ public class QueryTranslator {
Operator operator = criterion.getValueMatcher().operator();
Object value = criterion.getValueMatcher().expectedValue();
+ @SuppressWarnings("rawtypes")
FieldValueSerializer fieldValueSerializer = FieldValueSerializer.getSerializerForValue(value).orElseThrow(
() -> new IllegalArgumentException("Value of type " + value.getClass().getSimpleName()
+ "' is not handled by the combinaison of operator : " + operator.name()
+ " and field :" + fieldName.name()));
- return new CriterionDTO(fieldName.getValue(), operator.getValue(), fieldValueSerializer.serialize(value));
+ @SuppressWarnings("unchecked")
+ CriterionDTO result = new CriterionDTO(fieldName.getValue(), operator.getValue(), fieldValueSerializer.serialize(value));
+ return result;
}
Query translate(QueryDTO queryDTO) throws QueryTranslatorException {
diff --git a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/utils/VaultGarbageCollectionTaskSerializationTest.java b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/utils/VaultGarbageCollectionTaskSerializationTest.java
index 60c8cb9..07d5b89 100644
--- a/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/utils/VaultGarbageCollectionTaskSerializationTest.java
+++ b/mailbox/plugin/deleted-messages-vault/src/test/java/org/apache/james/vault/utils/VaultGarbageCollectionTaskSerializationTest.java
@@ -46,7 +46,7 @@ class VaultGarbageCollectionTaskSerializationTest {
taskSerializer = new JsonTaskSerializer(moduleVaultGarbageCollection());
}
- private TaskDTOModule moduleVaultGarbageCollection() {
+ private TaskDTOModule<VaultGarbageCollectionTask, VaultGarbageCollectionTask.VaultGarbageCollectionTaskDTO> moduleVaultGarbageCollection() {
VaultGarbageCollectionTask.Factory factory = new VaultGarbageCollectionTask.Factory(vault);
return TaskDTOModule
.forTask(VaultGarbageCollectionTask.class)
diff --git a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
index debbecd..2f4b58b 100644
--- a/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
+++ b/mpt/impl/imap-mailbox/jpa/src/test/java/org/apache/james/mpt/imapmailbox/jpa/host/JPAHostSystem.java
@@ -29,7 +29,6 @@ import org.apache.james.imap.encode.main.DefaultImapEncoderFactory;
import org.apache.james.imap.main.DefaultImapDecoderFactory;
import org.apache.james.imap.processor.main.DefaultImapProcessorFactory;
import org.apache.james.mailbox.MailboxManager;
-import org.apache.james.mailbox.MailboxSession;
import org.apache.james.mailbox.SubscriptionManager;
import org.apache.james.mailbox.acl.GroupMembershipResolver;
import org.apache.james.mailbox.acl.MailboxACLResolver;
diff --git a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultDeleteTask.java b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultDeleteTask.java
index 9672878..1af3326 100644
--- a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultDeleteTask.java
+++ b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultDeleteTask.java
@@ -40,7 +40,7 @@ public class DeletedMessagesVaultDeleteTask implements Task {
static final String TYPE = "deletedMessages/delete";
- public static final Function<DeletedMessagesVaultDeleteTask.Factory, TaskDTOModule> MODULE = (factory) ->
+ public static final Function<DeletedMessagesVaultDeleteTask.Factory, TaskDTOModule<DeletedMessagesVaultDeleteTask, DeletedMessagesVaultDeleteTaskDTO>> MODULE = (factory) ->
DTOModule
.forDomainObject(DeletedMessagesVaultDeleteTask.class)
.convertToDTO(DeletedMessagesVaultDeleteTask.DeletedMessagesVaultDeleteTaskDTO.class)
diff --git a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultExportTask.java b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultExportTask.java
index 26092eb..9b65c20 100644
--- a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultExportTask.java
+++ b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultExportTask.java
@@ -47,7 +47,7 @@ class DeletedMessagesVaultExportTask implements Task {
static final String TYPE = "deletedMessages/export";
- public static final Function<DeletedMessagesVaultExportTask.Factory, TaskDTOModule> MODULE = (factory) ->
+ public static final Function<DeletedMessagesVaultExportTask.Factory, TaskDTOModule<DeletedMessagesVaultExportTask, DeletedMessagesVaultExportTaskDTO>> MODULE = (factory) ->
DTOModule
.forDomainObject(DeletedMessagesVaultExportTask.class)
.convertToDTO(DeletedMessagesVaultExportTask.DeletedMessagesVaultExportTaskDTO.class)
diff --git a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRestoreTask.java b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRestoreTask.java
index 0bae69e..786a73b 100644
--- a/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRestoreTask.java
+++ b/server/protocols/webadmin/webadmin-mailbox-deleted-message-vault/src/main/java/org/apache/james/webadmin/vault/routes/DeletedMessagesVaultRestoreTask.java
@@ -47,7 +47,7 @@ class DeletedMessagesVaultRestoreTask implements Task {
static final String TYPE = "deletedMessages/restore";
- public static final Function<DeletedMessagesVaultRestoreTask.Factory, TaskDTOModule> MODULE = (factory) ->
+ public static final Function<DeletedMessagesVaultRestoreTask.Factory, TaskDTOModule<DeletedMessagesVaultRestoreTask, DeletedMessagesVaultRestoreTaskDTO>> MODULE = (factory) ->
DTOModule
.forDomainObject(DeletedMessagesVaultRestoreTask.class)
.convertToDTO(DeletedMessagesVaultRestoreTask.DeletedMessagesVaultRestoreTaskDTO.class)
diff --git a/server/task-json/src/test/java/org/apache/james/server/task/json/TaskSerializationTest.java b/server/task-json/src/test/java/org/apache/james/server/task/json/TaskSerializationTest.java
index 103e6e9..b33b953 100644
--- a/server/task-json/src/test/java/org/apache/james/server/task/json/TaskSerializationTest.java
+++ b/server/task-json/src/test/java/org/apache/james/server/task/json/TaskSerializationTest.java
@@ -38,7 +38,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
class TaskSerializationTest {
private static final String SERIALIZED_FAILED_TASK = "{\"type\": \"failed-task\"}";
- private TaskDTOModule failedTaskModule = DTOModule
+ private TaskDTOModule<FailedTask, FailedTaskDTO> failedTaskModule = DTOModule
.forDomainObject(FailedTask.class)
.convertToDTO(FailedTaskDTO.class)
.toDomainObjectConverter(dto -> new FailedTask())
@@ -47,7 +47,7 @@ class TaskSerializationTest {
.withFactory(TaskDTOModule::new);
private static final String SERIALIZED_COMPLETED_TASK = "{\"type\": \"completed-task\"}";
- private TaskDTOModule completedTaskModule = DTOModule
+ private TaskDTOModule<CompletedTask, CompletedTaskDTO> completedTaskModule = DTOModule
.forDomainObject(CompletedTask.class)
.convertToDTO(CompletedTaskDTO.class)
.toDomainObjectConverter(dto -> new CompletedTask())
@@ -56,7 +56,7 @@ class TaskSerializationTest {
.withFactory(TaskDTOModule::new);
private static final String SERIALIZED_THROWING_TASK = "{\"type\": \"throwing-task\"}";
- private TaskDTOModule throwingTaskModule = DTOModule
+ private TaskDTOModule<ThrowingTask, ThrowingTaskDTO> throwingTaskModule = DTOModule
.forDomainObject(ThrowingTask.class)
.convertToDTO(ThrowingTaskDTO.class)
.toDomainObjectConverter(dto -> new ThrowingTask())
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org