james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject svn commit: r1688163 - /james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
Date Mon, 29 Jun 2015 08:59:03 GMT
Author: btellier
Date: Mon Jun 29 08:59:03 2015
New Revision: 1688163

URL: http://svn.apache.org/r1688163
Log:
MAILBOX-245 Adding text extractor - Contributed by Antoine Duprat

Modified:
    james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java

Modified: james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
URL: http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java?rev=1688163&r1=1688162&r2=1688163&view=diff
==============================================================================
--- james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
(original)
+++ james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
Mon Jun 29 08:59:03 2015
@@ -31,6 +31,7 @@ import org.apache.james.mailbox.acl.Grou
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
+import org.apache.james.mailbox.elasticsearch.ClientProvider;
 import org.apache.james.mailbox.elasticsearch.ElasticSearchIndexer;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
 import org.apache.james.mailbox.elasticsearch.IndexCreationFactory;
@@ -40,6 +41,7 @@ import org.apache.james.mailbox.elastics
 import org.apache.james.mailbox.elasticsearch.query.CriterionConverter;
 import org.apache.james.mailbox.elasticsearch.query.QueryConverter;
 import org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher;
+import org.apache.james.mailbox.elasticsearch.utils.TestingClientProvider;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
@@ -47,6 +49,7 @@ import org.apache.james.mailbox.model.Ma
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
 import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.MailboxCreationDelegate;
 
@@ -88,8 +91,8 @@ public class ElasticSearchHostSystem ext
     }
 
     private void initFields() {
-        NodeMappingFactory.applyMapping(
-            IndexCreationFactory.createIndex(embeddedElasticSearch.getNode())
+        ClientProvider clientProvider = NodeMappingFactory.applyMapping(
+            IndexCreationFactory.createIndex(new TestingClientProvider(embeddedElasticSearch.getNode()))
         );
 
         userManager = new MockAuthenticator();
@@ -97,14 +100,14 @@ public class ElasticSearchHostSystem ext
 
         ElasticSearchListeningMessageSearchIndex<InMemoryId> searchIndex = new ElasticSearchListeningMessageSearchIndex<>(
             factory,
-            new ElasticSearchIndexer(embeddedElasticSearch.getNode()),
-            new ElasticSearchSearcher<InMemoryId>(embeddedElasticSearch.getNode(),
new QueryConverter(new CriterionConverter())),
-            new MessageToElasticSearchJson());
+            new ElasticSearchIndexer(clientProvider),
+            new ElasticSearchSearcher<>(clientProvider, new QueryConverter(new CriterionConverter())),
+            new MessageToElasticSearchJson(new DefaultTextExtractor()));
 
         MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
         GroupMembershipResolver groupMembershipResolver = new SimpleGroupMembershipResolver();
 
-        mailboxManager = new StoreMailboxManager<InMemoryId>(factory, userManager,
aclResolver, groupMembershipResolver);
+        mailboxManager = new StoreMailboxManager<>(factory, userManager, aclResolver,
groupMembershipResolver);
         mailboxManager.setMessageSearchIndex(searchIndex);
 
         try {



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


Mime
View raw message