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 ro...@apache.org on 2019/07/18 12:55:35 UTC

[james-project] 02/11: JAMES-2812 new module for BlobStore based DeletedMessageVault

This is an automated email from the ASF dual-hosted git repository.

rouazana pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit fa5897d75c305169fa4dd9cf3f12b78e85c5ee18
Author: Tran Tien Duc <dt...@linagora.com>
AuthorDate: Mon Jul 8 10:42:48 2019 +0700

    JAMES-2812 new module for BlobStore based DeletedMessageVault
---
 .../apache/james/vault/metadata/MetadataDAO.java   |  2 +-
 .../vault/BlobStoreDeletedMessageVaultModule.java  | 42 ++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/MetadataDAO.java b/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/MetadataDAO.java
index 4669a5e..de7f22d 100644
--- a/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/MetadataDAO.java
+++ b/mailbox/plugin/deleted-messages-vault-cassandra/src/main/java/org/apache/james/vault/metadata/MetadataDAO.java
@@ -41,7 +41,7 @@ import com.datastax.driver.core.Session;
 import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
-class MetadataDAO {
+public class MetadataDAO {
     private final CassandraAsyncExecutor cassandraAsyncExecutor;
     private final PreparedStatement addStatement;
     private final PreparedStatement removeStatement;
diff --git a/server/container/guice/mailbox-plugin-deleted-messages-vault-guice/src/main/java/org/apache/james/modules/vault/BlobStoreDeletedMessageVaultModule.java b/server/container/guice/mailbox-plugin-deleted-messages-vault-guice/src/main/java/org/apache/james/modules/vault/BlobStoreDeletedMessageVaultModule.java
new file mode 100644
index 0000000..fce185b
--- /dev/null
+++ b/server/container/guice/mailbox-plugin-deleted-messages-vault-guice/src/main/java/org/apache/james/modules/vault/BlobStoreDeletedMessageVaultModule.java
@@ -0,0 +1,42 @@
+/****************************************************************
+ * 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.modules.vault;
+
+import org.apache.james.vault.DeletedMessageVault;
+import org.apache.james.vault.blob.BlobStoreDeletedMessageVault;
+import org.apache.james.vault.memory.metadata.MemoryDeletedMessageMetadataVault;
+import org.apache.james.vault.metadata.DeletedMessageMetadataVault;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Scopes;
+
+public class BlobStoreDeletedMessageVaultModule extends AbstractModule {
+
+    @Override
+    protected void configure() {
+        bind(MemoryDeletedMessageMetadataVault.class).in(Scopes.SINGLETON);
+        bind(DeletedMessageMetadataVault.class)
+            .to(MemoryDeletedMessageMetadataVault.class);
+
+        bind(BlobStoreDeletedMessageVault.class).in(Scopes.SINGLETON);
+        bind(DeletedMessageVault.class)
+            .to(BlobStoreDeletedMessageVault.class);
+    }
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org