JAMES-2555 Guice bindings for webAdmin MessageIdReindexing routes Note that it only makes sens for the Cassandra + ES product: - JPA does not support MessageId yet - Memory iterates over mailbox content thus reIndexing is pointless
Project: http://git-wip-us.apache.org/repos/asf/james-project/repo Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/44ee6434 Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/44ee6434 Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/44ee6434 Branch: refs/heads/master Commit: 44ee6434f7122f7e7a6161c0e7892c7a1cfa6ac9 Parents: 54fcdf3 Author: Benoit Tellier <btell...@linagora.com> Authored: Mon Oct 15 11:41:02 2018 +0700 Committer: Benoit Tellier <btell...@linagora.com> Committed: Tue Oct 23 08:43:46 2018 +0700 ---------------------------------------------------------------------- .../apache/james/CassandraJamesServerMain.java | 4 ++- .../modules/mailbox/CassandraMailboxModule.java | 4 +++ .../server/MessageIdReIndexingModule.java | 34 ++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/james-project/blob/44ee6434/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java ---------------------------------------------------------------------- diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java index dcfd268..94eb6d6 100644 --- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java +++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/CassandraJamesServerMain.java @@ -53,6 +53,7 @@ import org.apache.james.modules.server.JMXServerModule; import org.apache.james.modules.server.MailQueueRoutesModule; import org.apache.james.modules.server.MailRepositoriesRoutesModule; import org.apache.james.modules.server.MailboxRoutesModule; +import org.apache.james.modules.server.MessageIdReIndexingModule; import org.apache.james.modules.server.ReIndexingModule; import org.apache.james.modules.server.SieveQuotaRoutesModule; import org.apache.james.modules.server.SwaggerRoutesModule; @@ -75,7 +76,8 @@ public class CassandraJamesServerMain { new WebAdminServerModule(), new DLPRoutesModule(), new SieveQuotaRoutesModule(), - new ReIndexingModule()); + new ReIndexingModule(), + new MessageIdReIndexingModule()); public static final Module PROTOCOLS = Modules.combine( new CassandraJmapModule(), http://git-wip-us.apache.org/repos/asf/james-project/blob/44ee6434/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java ---------------------------------------------------------------------- diff --git a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java index 4f7d6e2..7668ce8 100644 --- a/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java +++ b/server/container/guice/cassandra-guice/src/main/java/org/apache/james/modules/mailbox/CassandraMailboxModule.java @@ -68,6 +68,7 @@ import org.apache.james.mailbox.cassandra.modules.CassandraModSeqModule; import org.apache.james.mailbox.cassandra.modules.CassandraSubscriptionModule; import org.apache.james.mailbox.cassandra.modules.CassandraUidModule; import org.apache.james.mailbox.exception.MailboxException; +import org.apache.james.mailbox.indexer.MessageIdReIndexer; import org.apache.james.mailbox.indexer.ReIndexer; import org.apache.james.mailbox.model.MailboxId; import org.apache.james.mailbox.model.MessageId; @@ -92,6 +93,7 @@ import org.apache.james.mailbox.store.mail.UidProvider; import org.apache.james.mailbox.store.quota.ListeningCurrentQuotaUpdater; import org.apache.james.modules.Names; import org.apache.james.utils.MailboxManagerDefinition; +import org.apache.mailbox.tools.indexer.MessageIdReIndexerImpl; import org.apache.mailbox.tools.indexer.ReIndexerImpl; import com.google.inject.AbstractModule; @@ -146,6 +148,7 @@ public class CassandraMailboxModule extends AbstractModule { bind(UserRepositoryAuthorizator.class).in(Scopes.SINGLETON); bind(ReIndexerImpl.class).in(Scopes.SINGLETON); + bind(MessageIdReIndexerImpl.class).in(Scopes.SINGLETON); bind(BlobManager.class).to(StoreBlobManager.class); bind(MessageMapperFactory.class).to(CassandraMailboxSessionMapperFactory.class); @@ -168,6 +171,7 @@ public class CassandraMailboxModule extends AbstractModule { bind(RightManager.class).to(StoreRightManager.class); bind(ReIndexer.class).to(ReIndexerImpl.class); + bind(MessageIdReIndexer.class).to(MessageIdReIndexerImpl.class); Multibinder<CassandraModule> cassandraDataDefinitions = Multibinder.newSetBinder(binder(), CassandraModule.class); cassandraDataDefinitions.addBinding().toInstance(CassandraAclModule.MODULE); http://git-wip-us.apache.org/repos/asf/james-project/blob/44ee6434/server/container/guice/protocols/webadmin-mailbox/src/main/java/org/apache/james/modules/server/MessageIdReIndexingModule.java ---------------------------------------------------------------------- diff --git a/server/container/guice/protocols/webadmin-mailbox/src/main/java/org/apache/james/modules/server/MessageIdReIndexingModule.java b/server/container/guice/protocols/webadmin-mailbox/src/main/java/org/apache/james/modules/server/MessageIdReIndexingModule.java new file mode 100644 index 0000000..19f09ba --- /dev/null +++ b/server/container/guice/protocols/webadmin-mailbox/src/main/java/org/apache/james/modules/server/MessageIdReIndexingModule.java @@ -0,0 +1,34 @@ +/**************************************************************** + * 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.server; + +import org.apache.james.webadmin.Routes; +import org.apache.james.webadmin.routes.MessageIdReindexingRoutes; + +import com.google.inject.AbstractModule; +import com.google.inject.multibindings.Multibinder; + +public class MessageIdReIndexingModule extends AbstractModule { + @Override + protected void configure() { + Multibinder<Routes> routesMultibinder = Multibinder.newSetBinder(binder(), Routes.class); + routesMultibinder.addBinding().to(MessageIdReindexingRoutes.class); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org