james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [07/19] james-project git commit: JAMES-2616 Remove un needed getters in MessageSearchIndex
Date Fri, 07 Dec 2018 01:10:30 GMT
JAMES-2616 Remove un needed getters in MessageSearchIndex


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/d242d9b3
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/d242d9b3
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/d242d9b3

Branch: refs/heads/master
Commit: d242d9b3886a93341bcc97b7c42cfe2f2297d932
Parents: 372930c
Author: tran tien duc <dtran@linagora.com>
Authored: Tue Dec 4 17:20:36 2018 +0700
Committer: Benoit Tellier <btellier@linagora.com>
Committed: Fri Dec 7 07:52:51 2018 +0700

----------------------------------------------------------------------
 .../META-INF/spring/mailbox-index-lucene.xml      |  2 ++
 .../META-INF/spring/mailbox-index-lucene.xml      |  2 ++
 .../store/search/LazyMessageSearchIndex.java      |  9 ++++++---
 .../store/search/ListeningMessageSearchIndex.java | 18 ------------------
 4 files changed, 10 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/d242d9b3/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
----------------------------------------------------------------------
diff --git a/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml b/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
index 1ed21f4..e44882b 100644
--- a/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
+++ b/mailbox/lucene/src/main/resources/META-INF/spring/mailbox-index-lucene.xml
@@ -29,6 +29,8 @@
 
     <bean id="lazyIndex" class="org.apache.james.mailbox.store.search.LazyMessageSearchIndex">
         <constructor-arg index="0" ref="luceneIndex"/>
+        <constructor-arg index="1" ref="messageMapperFactory"/>
+        <constructor-arg index="2" ref="mailboxmanager"/>
     </bean>
     <bean id="luceneIndex" class="org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex">
         <constructor-arg index="0" ref="messageMapperFactory"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d242d9b3/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
----------------------------------------------------------------------
diff --git a/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml b/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
index 31c5790..5cf7f8e 100644
--- a/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
+++ b/mailbox/spring/src/test/resources/META-INF/spring/mailbox-index-lucene.xml
@@ -29,6 +29,8 @@
 
     <bean id="lazyIndex" class="org.apache.james.mailbox.store.search.LazyMessageSearchIndex">
         <constructor-arg index="0" ref="luceneIndex"/>
+        <constructor-arg index="1" ref="messageMapperFactory"/>
+        <constructor-arg index="2" ref="mailboxmanager"/>
     </bean>
     <bean id="luceneIndex" class="org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex">
         <constructor-arg index="0" ref="messageMapperFactory"/>

http://git-wip-us.apache.org/repos/asf/james-project/blob/d242d9b3/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
index 766ffd6..5ede660 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java
@@ -36,6 +36,7 @@ import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.mail.MessageMapper.FetchType;
+import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.slf4j.Logger;
@@ -58,11 +59,13 @@ public class LazyMessageSearchIndex extends ListeningMessageSearchIndex
{
 
     private final ListeningMessageSearchIndex index;
     private final ConcurrentHashMap<MailboxId, Object> indexed = new ConcurrentHashMap<>();
+    private final MessageMapperFactory factory;
     
     
-    public LazyMessageSearchIndex(ListeningMessageSearchIndex index) {
-        super(index.getFactory(), index.getMailboxManager());
+    public LazyMessageSearchIndex(ListeningMessageSearchIndex index, MessageMapperFactory
factory, MailboxManager mailboxManager) {
+        super(factory, mailboxManager);
         this.index = index;
+        this.factory = factory;
     }
 
     @Override
@@ -109,7 +112,7 @@ public class LazyMessageSearchIndex extends ListeningMessageSearchIndex
{
                 done = oldDone;
             }
             synchronized (done) {
-                Iterator<MailboxMessage> messages = getFactory().getMessageMapper(session).findInMailbox(mailbox,
MessageRange.all(), FetchType.Full, -1);
+                Iterator<MailboxMessage> messages = factory.getMessageMapper(session).findInMailbox(mailbox,
MessageRange.all(), FetchType.Full, -1);
                 while (messages.hasNext()) {
                     final MailboxMessage message = messages.next();
                     try {

http://git-wip-us.apache.org/repos/asf/james-project/blob/d242d9b3/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
----------------------------------------------------------------------
diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
index ff5ac8e..aff8454 100644
--- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
+++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
@@ -56,24 +56,6 @@ public abstract class ListeningMessageSearchIndex implements MessageSearchIndex,
     }
 
     /**
-     * Return the {@link MessageMapperFactory}
-     * 
-     * @return factory
-     */
-    protected MessageMapperFactory getFactory() {
-        return factory;
-    }
-
-    /**
-     * Return the {@link MailboxManager}
-     *
-     * @return mailboxManager
-     */
-    protected MailboxManager getMailboxManager() {
-        return mailboxManager;
-    }
-
-    /**
      * Process the {@link org.apache.james.mailbox.Event} and update the index if
      * something relevant is received
      */


---------------------------------------------------------------------
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