james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matth...@apache.org
Subject svn commit: r1724225 [4/5] - in /james/project/trunk: dockerfiles/run/guice/destination/conf/META-INF/ dockerfiles/run/spring/destination/conf/META-INF/ mailbox/caching/src/main/java/org/apache/james/mailbox/caching/ mailbox/cassandra/src/main/java/org...
Date Tue, 12 Jan 2016 13:17:05 GMT
Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java Tue Jan 12 13:17:03 2016
@@ -33,7 +33,7 @@ import org.apache.james.mailbox.store.ma
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
  * {@link MessageSearchIndex} which needs to get registered as global {@link MailboxListener} and so get
@@ -83,9 +83,9 @@ public abstract class ListeningMessageSe
 
                     while (uids.hasNext()) {
                         long next = uids.next();
-                        Iterator<Message<Id>> messages = factory.getMessageMapper(session).findInMailbox(mailbox, MessageRange.one(next), FetchType.Full, -1);
+                        Iterator<MailboxMessage<Id>> messages = factory.getMessageMapper(session).findInMailbox(mailbox, MessageRange.one(next), FetchType.Full, -1);
                         while(messages.hasNext()) {
-                            Message<Id> message = messages.next();
+                            MailboxMessage<Id> message = messages.next();
                             try {
                                 add(session, mailbox, message);
                             } catch (MailboxException e) {
@@ -139,14 +139,14 @@ public abstract class ListeningMessageSe
     }
 
     /**
-     * Add the {@link Message} for the given {@link Mailbox} to the index
+     * Add the {@link MailboxMessage} for the given {@link Mailbox} to the index
      *
      * @param session
      * @param mailbox
      * @param message
      * @throws MailboxException
      */
-    public abstract void add(MailboxSession session, Mailbox<Id> mailbox, Message<Id> message) throws MailboxException;
+    public abstract void add(MailboxSession session, Mailbox<Id> mailbox, MailboxMessage<Id> message) throws MailboxException;
 
     /**
      * Delete the {@link MessageRange} for the given {@link Mailbox} from the index

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearchIndex.java Tue Jan 12 13:17:03 2016
@@ -29,7 +29,7 @@ import org.apache.james.mailbox.store.ma
 
 
 /**
- * An index which can be used to search for Message UID's that match a {@link SearchQuery}.
+ * An index which can be used to search for MailboxMessage UID's that match a {@link SearchQuery}.
  * 
  * A developer should think of building an inverse-index for that.
  * 

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/MessageSearches.java Tue Jan 12 13:17:03 2016
@@ -45,7 +45,7 @@ import org.apache.james.mailbox.model.Se
 import org.apache.james.mailbox.model.SearchQuery.DateResolution;
 import org.apache.james.mailbox.model.SearchQuery.NumericRange;
 import org.apache.james.mailbox.store.ResultUtils;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.comparator.CombinedComparator;
 import org.apache.james.mime4j.MimeException;
 import org.apache.james.mime4j.dom.address.Address;
@@ -66,15 +66,15 @@ import org.slf4j.Logger;
  */
 public class MessageSearches implements Iterable<Long> {
 
-    private Iterator<Message<?>> messages;
+    private Iterator<MailboxMessage<?>> messages;
     private SearchQuery query;
     private Logger log;
 
-    public MessageSearches(Iterator<Message<?>> messages, SearchQuery query) {
+    public MessageSearches(Iterator<MailboxMessage<?>> messages, SearchQuery query) {
         this(messages, query, null);
     }
 
-    public MessageSearches(Iterator<Message<?>> messages, SearchQuery query, Logger log) {
+    public MessageSearches(Iterator<MailboxMessage<?>> messages, SearchQuery query, Logger log) {
         this.messages = messages;
         this.query = query;
         this.log = log;
@@ -87,9 +87,9 @@ public class MessageSearches implements
     }
 
     private Collection<Long> search() {
-        TreeSet<Message<?>> matched = new TreeSet<Message<?>>(CombinedComparator.create(query.getSorts()));
+        TreeSet<MailboxMessage<?>> matched = new TreeSet<MailboxMessage<?>>(CombinedComparator.create(query.getSorts()));
         while (messages.hasNext()) {
-            Message<?> m = messages.next();
+            MailboxMessage<?> m = messages.next();
             try {
                 if (isMatch(query, m, log)) {
                     matched.add(m);
@@ -99,7 +99,7 @@ public class MessageSearches implements
             }
         }
         Set<Long> uids = new HashSet<Long>();
-        Iterator<Message<?>> matchedIt = matched.iterator();
+        Iterator<MailboxMessage<?>> matchedIt = matched.iterator();
         while (matchedIt.hasNext()) {
             uids.add(matchedIt.next().getUid());
         }
@@ -112,14 +112,14 @@ public class MessageSearches implements
      * @param query
      *            <code>SearchQuery</code>, not null
      * @param message
-     *            <code>Message</code>, not null
+     *            <code>MailboxMessage</code>, not null
      * @param log
      *            the logger to use
      * @return <code>true</code> if the row matches the given criteria,
      *         <code>false</code> otherwise
      * @throws MailboxException
      */
-    protected boolean isMatch(final SearchQuery query, final Message<?> message, Logger log) throws MailboxException {
+    protected boolean isMatch(final SearchQuery query, final MailboxMessage<?> message, Logger log) throws MailboxException {
         final List<SearchQuery.Criterion> criteria = query.getCriterias();
         final Collection<Long> recentMessageUids = query.getRecentMessageUids();
         boolean result = true;
@@ -141,7 +141,7 @@ public class MessageSearches implements
      * @param criterion
      *            the criterion to use
      * @param message
-     *            <code>Message</code>, not null
+     *            <code>MailboxMessage</code>, not null
      * @param recentMessageUids
      *            collection of recent message uids
      * @param log
@@ -150,7 +150,7 @@ public class MessageSearches implements
      *         <code>false</code> otherwise
      * @throws MailboxException
      */
-    public boolean isMatch(SearchQuery.Criterion criterion, Message<?> message,
+    public boolean isMatch(SearchQuery.Criterion criterion, MailboxMessage<?> message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         final boolean result;
         if (criterion instanceof SearchQuery.InternalDateCriterion) {
@@ -183,7 +183,7 @@ public class MessageSearches implements
         return result;
     }
 
-    protected boolean matches(SearchQuery.TextCriterion criterion, Message<?> message, Logger log)
+    protected boolean matches(SearchQuery.TextCriterion criterion, MailboxMessage<?> message, Logger log)
             throws MailboxException {
         try {
             final SearchQuery.ContainsOperator operator = criterion.getOperator();
@@ -203,7 +203,7 @@ public class MessageSearches implements
         }
     }
 
-    protected boolean bodyContains(String value, Message<?> message, Logger log) throws IOException, MimeException {
+    protected boolean bodyContains(String value, MailboxMessage<?> message, Logger log) throws IOException, MimeException {
         final InputStream input = message.getFullContent();
         final boolean result = isInMessage(value, input, false, log);
         return result;
@@ -220,13 +220,13 @@ public class MessageSearches implements
         return builder.build().messageMatches(input);
     }
 
-    protected boolean messageContains(String value, Message<?> message, Logger log) throws IOException, MimeException {
+    protected boolean messageContains(String value, MailboxMessage<?> message, Logger log) throws IOException, MimeException {
         final InputStream input = message.getFullContent();
         final boolean result = isInMessage(value, input, true, log);
         return result;
     }
 
-    private boolean matches(SearchQuery.ConjunctionCriterion criterion, Message<?> message,
+    private boolean matches(SearchQuery.ConjunctionCriterion criterion, MailboxMessage<?> message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         final List<SearchQuery.Criterion> criteria = criterion.getCriteria();
         switch (criterion.getType()) {
@@ -241,7 +241,7 @@ public class MessageSearches implements
         }
     }
 
-    private boolean and(final List<SearchQuery.Criterion> criteria, final Message<?> message,
+    private boolean and(final List<SearchQuery.Criterion> criteria, final MailboxMessage<?> message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = true;
         for (Iterator<SearchQuery.Criterion> it = criteria.iterator(); it.hasNext();) {
@@ -255,7 +255,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean or(final List<SearchQuery.Criterion> criteria, final Message<?> message,
+    private boolean or(final List<SearchQuery.Criterion> criteria, final MailboxMessage<?> message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = false;
         for (Iterator<SearchQuery.Criterion> it = criteria.iterator(); it.hasNext();) {
@@ -269,7 +269,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean nor(final List<SearchQuery.Criterion> criteria, final Message<?> message,
+    private boolean nor(final List<SearchQuery.Criterion> criteria, final MailboxMessage<?> message,
             final Collection<Long> recentMessageUids, Logger log) throws MailboxException {
         boolean result = true;
         for (Iterator<SearchQuery.Criterion> it = criteria.iterator(); it.hasNext();) {
@@ -283,7 +283,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean matches(SearchQuery.FlagCriterion criterion, Message<?> message,
+    private boolean matches(SearchQuery.FlagCriterion criterion, MailboxMessage<?> message,
             final Collection<Long> recentMessageUids) {
         final SearchQuery.BooleanOperator operator = criterion.getOperator();
         final boolean isSet = operator.isSet();
@@ -308,7 +308,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean matches(SearchQuery.CustomFlagCriterion criterion, Message<?> message,
+    private boolean matches(SearchQuery.CustomFlagCriterion criterion, MailboxMessage<?> message,
             final Collection<Long> recentMessageUids) {
         final SearchQuery.BooleanOperator operator = criterion.getOperator();
         final boolean isSet = operator.isSet();
@@ -317,7 +317,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean matches(SearchQuery.UidCriterion criterion, Message<?> message) {
+    private boolean matches(SearchQuery.UidCriterion criterion, MailboxMessage<?> message) {
         final SearchQuery.InOperator operator = criterion.getOperator();
         final NumericRange[] ranges = operator.getRange();
         final long uid = message.getUid();
@@ -333,7 +333,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean matches(SearchQuery.HeaderCriterion criterion, Message<?> message, Logger log)
+    private boolean matches(SearchQuery.HeaderCriterion criterion, MailboxMessage<?> message, Logger log)
             throws MailboxException, IOException {
         final SearchQuery.HeaderOperator operator = criterion.getOperator();
         final String headerName = criterion.getHeaderName();
@@ -363,7 +363,7 @@ public class MessageSearches implements
      * @throws IOException
      */
     private boolean matchesAddress(final SearchQuery.AddressOperator operator, final String headerName,
-            final Message<?> message, Logger log) throws MailboxException, IOException {
+                                   final MailboxMessage<?> message, Logger log) throws MailboxException, IOException {
         final String text = operator.getAddress().toUpperCase(Locale.ENGLISH);
         final List<Header> headers = ResultUtils.createHeaders(message);
         for (Header header : headers) {
@@ -396,7 +396,7 @@ public class MessageSearches implements
         return false;
     }
 
-    private boolean exists(String headerName, Message<?> message) throws MailboxException, IOException {
+    private boolean exists(String headerName, MailboxMessage<?> message) throws MailboxException, IOException {
         boolean result = false;
         final List<Header> headers = ResultUtils.createHeaders(message);
 
@@ -411,7 +411,7 @@ public class MessageSearches implements
     }
 
     private boolean matches(final SearchQuery.ContainsOperator operator, final String headerName,
-            final Message<?> message) throws MailboxException, IOException {
+            final MailboxMessage<?> message) throws MailboxException, IOException {
         final String text = operator.getValue().toUpperCase();
         boolean result = false;
         final List<Header> headers = ResultUtils.createHeaders(message);
@@ -430,7 +430,7 @@ public class MessageSearches implements
         return result;
     }
 
-    private boolean matches(final SearchQuery.DateOperator operator, final String headerName, final Message<?> message)
+    private boolean matches(final SearchQuery.DateOperator operator, final String headerName, final MailboxMessage<?> message)
             throws MailboxException {
 
         final Date date = operator.getDate();
@@ -462,7 +462,7 @@ public class MessageSearches implements
         }
     }
 
-    private String headerValue(final String headerName, final Message<?> message) throws MailboxException, IOException {
+    private String headerValue(final String headerName, final MailboxMessage<?> message) throws MailboxException, IOException {
         final List<Header> headers = ResultUtils.createHeaders(message);
         String value = null;
         for (Header header : headers) {
@@ -484,7 +484,7 @@ public class MessageSearches implements
         return cal.getTime();
     }
 
-    private boolean matches(SearchQuery.SizeCriterion criterion, Message<?> message) throws UnsupportedSearchException {
+    private boolean matches(SearchQuery.SizeCriterion criterion, MailboxMessage<?> message) throws UnsupportedSearchException {
         final SearchQuery.NumericOperator operator = criterion.getOperator();
         final long size = message.getFullContentOctets();
         final long value = operator.getValue();
@@ -500,7 +500,7 @@ public class MessageSearches implements
         }
     }
 
-    private boolean matches(SearchQuery.ModSeqCriterion criterion, Message<?> message)
+    private boolean matches(SearchQuery.ModSeqCriterion criterion, MailboxMessage<?> message)
             throws UnsupportedSearchException {
         final SearchQuery.NumericOperator operator = criterion.getOperator();
         final long modSeq = message.getModSeq();
@@ -517,14 +517,14 @@ public class MessageSearches implements
         }
     }
 
-    private boolean matches(SearchQuery.InternalDateCriterion criterion, Message<?> message)
+    private boolean matches(SearchQuery.InternalDateCriterion criterion, MailboxMessage<?> message)
             throws UnsupportedSearchException {
         final SearchQuery.DateOperator operator = criterion.getOperator();
         final boolean result = matchesInternalDate(operator, message);
         return result;
     }
 
-    private boolean matchesInternalDate(final SearchQuery.DateOperator operator, final Message<?> message)
+    private boolean matchesInternalDate(final SearchQuery.DateOperator operator, final MailboxMessage<?> message)
             throws UnsupportedSearchException {
         final Date date = operator.getDate();
         final DateResolution res = operator.getDateResultion();

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java Tue Jan 12 13:17:03 2016
@@ -39,10 +39,10 @@ import org.apache.james.mailbox.store.ma
 import org.apache.james.mailbox.store.mail.MessageMapperFactory;
 import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
- * {@link MessageSearchIndex} which just fetch {@link Message}'s from the {@link MessageMapper} and use {@link MessageSearcher}
+ * {@link MessageSearchIndex} which just fetch {@link MailboxMessage}'s from the {@link MessageMapper} and use {@link MessageSearcher}
  * to match them against the {@link SearchQuery}.
  * 
  * This works with every implementation but is SLOW.
@@ -83,7 +83,7 @@ public class SimpleMessageSearchIndex<Id
     public Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery query) throws MailboxException {
         MessageMapper<Id> mapper = factory.getMessageMapper(session);
 
-        final SortedSet<Message<?>> hitSet = new TreeSet<Message<?>>();
+        final SortedSet<MailboxMessage<?>> hitSet = new TreeSet<MailboxMessage<?>>();
 
         UidCriterion uidCrit = findConjugatedUidCriterion(query.getCriterias());
         if (uidCrit != null) {
@@ -92,16 +92,16 @@ public class SimpleMessageSearchIndex<Id
             NumericRange[] ranges = uidCrit.getOperator().getRange();
             for (int i = 0; i < ranges.length; i++) {
                 NumericRange r = ranges[i];
-                Iterator<Message<Id>> it = mapper.findInMailbox(mailbox, MessageRange.range(r.getLowValue(), r.getHighValue()), FetchType.Metadata, -1);
+                Iterator<MailboxMessage<Id>> it = mapper.findInMailbox(mailbox, MessageRange.range(r.getLowValue(), r.getHighValue()), FetchType.Metadata, -1);
                 while(it.hasNext()) {
                 	hitSet.add(it.next());
                 }
             }
         } else {
         	// we have to fetch all messages
-            Iterator<Message<Id>> messages = mapper.findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
+            Iterator<MailboxMessage<Id>> messages = mapper.findInMailbox(mailbox, MessageRange.all(), FetchType.Full, -1);
             while(messages.hasNext()) {
-            	Message<Id> m = messages.next();
+            	MailboxMessage<Id> m = messages.next();
             	hitSet.add(m);
             }
         }

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/AbstractHeaderComparator.java Tue Jan 12 13:17:03 2016
@@ -26,16 +26,16 @@ import java.util.Locale;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MessageResult.Header;
 import org.apache.james.mailbox.store.ResultUtils;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 
-public abstract class AbstractHeaderComparator implements Comparator<Message<?>>{
+public abstract class AbstractHeaderComparator implements Comparator<MailboxMessage<?>>{
 
     public final static String FROM ="from";
     public final static String TO ="to";
     public final static String CC ="cc";
 
-    protected String getHeaderValue(String headerName, Message<?> message) {
+    protected String getHeaderValue(String headerName, MailboxMessage<?> message) {
         try {
             final List<Header> headers = ResultUtils.createHeaders(message);
             for (Header header : headers) {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/BaseSubjectComparator.java Tue Jan 12 13:17:03 2016
@@ -20,22 +20,22 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.SearchUtil;
 
 public class BaseSubjectComparator extends AbstractHeaderComparator{
 
 
 
-    private final static Comparator<Message<?>> BASESUBJECT = new BaseSubjectComparator();;
-    private final static Comparator<Message<?>> REVERSE_BASESUBJECT = new ReverseComparator(BASESUBJECT);
+    private final static Comparator<MailboxMessage<?>> BASESUBJECT = new BaseSubjectComparator();;
+    private final static Comparator<MailboxMessage<?>> REVERSE_BASESUBJECT = new ReverseComparator(BASESUBJECT);
 
     
     
     private final static String SUBJECT = "subject";
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         String baseSubject1 = SearchUtil.getBaseSubject(getHeaderValue(SUBJECT, o1));
         String baseSubject2 = SearchUtil.getBaseSubject(getHeaderValue(SUBJECT, o2));
 
@@ -43,7 +43,7 @@ public class BaseSubjectComparator exten
     }
 
 
-    public static Comparator<Message<?>> baseSubject(boolean reverse){
+    public static Comparator<MailboxMessage<?>> baseSubject(boolean reverse){
         if (reverse) {
             return REVERSE_BASESUBJECT;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/CombinedComparator.java Tue Jan 12 13:17:03 2016
@@ -23,24 +23,24 @@ import java.util.Comparator;
 import java.util.List;
 
 import org.apache.james.mailbox.model.SearchQuery.Sort;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
- * {@link Comparator} which takes a Array of other {@link Comparator}'s and use them to compare two {@link Message} instances till one of them
+ * {@link Comparator} which takes a Array of other {@link Comparator}'s and use them to compare two {@link MailboxMessage} instances till one of them
  * return <> 0
  *
  */
-public class CombinedComparator implements Comparator<Message<?>>{
+public class CombinedComparator implements Comparator<MailboxMessage<?>>{
 
-    private final Comparator<Message<?>>[] comparators;
-    public CombinedComparator(Comparator<Message<?>>[] comparators) {
+    private final Comparator<MailboxMessage<?>>[] comparators;
+    public CombinedComparator(Comparator<MailboxMessage<?>>[] comparators) {
         if(comparators == null || comparators.length < 1) {
             throw new IllegalArgumentException();
         }
         this.comparators = comparators;
     }
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         int i = 0;
         for (int a = 0; a < comparators.length; a++) {
             i = comparators[a].compare(o1, o2);
@@ -52,12 +52,12 @@ public class CombinedComparator implemen
     }
     
     @SuppressWarnings("unchecked")
-    public static Comparator<Message<?>> create(List<Sort> sorts) {
+    public static Comparator<MailboxMessage<?>> create(List<Sort> sorts) {
         List<Comparator<?>> comps = new ArrayList<Comparator<?>>();
         for (int i = 0; i < sorts.size(); i++) {
             Sort sort = sorts.get(i);
             boolean reverse = sort.isReverse();
-            Comparator<Message<?>> comparator = null;
+            Comparator<MailboxMessage<?>> comparator = null;
             
             switch (sort.getSortClause()) {
             case Arrival:

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderDisplayComparator.java Tue Jan 12 13:17:03 2016
@@ -20,18 +20,18 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.SearchUtil;
 
 public class HeaderDisplayComparator extends AbstractHeaderComparator{
 
 
-    private final static Comparator<Message<?>> FROM_COMPARATOR = new HeaderDisplayComparator(FROM);
-    private final static Comparator<Message<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
+    private final static Comparator<MailboxMessage<?>> FROM_COMPARATOR = new HeaderDisplayComparator(FROM);
+    private final static Comparator<MailboxMessage<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
 
 
-    private final static Comparator<Message<?>> TO_COMPARATOR = new HeaderDisplayComparator(TO);
-    private final static Comparator<Message<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
+    private final static Comparator<MailboxMessage<?>> TO_COMPARATOR = new HeaderDisplayComparator(TO);
+    private final static Comparator<MailboxMessage<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
 
     
     private String headerName;
@@ -41,14 +41,14 @@ public class HeaderDisplayComparator ext
     }
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         String display1 = SearchUtil.getDisplayAddress(getHeaderValue(headerName, o1));
         String display2 = SearchUtil.getDisplayAddress(getHeaderValue(headerName, o2));
         return display1.compareToIgnoreCase(display2);
     }
 
     
-    public static Comparator<Message<?>> from(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> from(boolean reverse) {
         if (reverse) {
             return REVERSE_FROM_COMPARATOR;
         } else {
@@ -57,7 +57,7 @@ public class HeaderDisplayComparator ext
     }
 
     
-    public static Comparator<Message<?>> to(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> to(boolean reverse) {
         if (reverse) {
             return REVERSE_TO_COMPARATOR;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/HeaderMailboxComparator.java Tue Jan 12 13:17:03 2016
@@ -20,23 +20,23 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.SearchUtil;
 
 public class HeaderMailboxComparator extends AbstractHeaderComparator{
 
     private final String headerName;
 
-    private final static Comparator<Message<?>> FROM_COMPARATOR = new HeaderMailboxComparator(FROM);
-    private final static Comparator<Message<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
+    private final static Comparator<MailboxMessage<?>> FROM_COMPARATOR = new HeaderMailboxComparator(FROM);
+    private final static Comparator<MailboxMessage<?>> REVERSE_FROM_COMPARATOR = new ReverseComparator(FROM_COMPARATOR);
 
 
-    private final static Comparator<Message<?>> TO_COMPARATOR = new HeaderMailboxComparator(TO);
-    private final static Comparator<Message<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
+    private final static Comparator<MailboxMessage<?>> TO_COMPARATOR = new HeaderMailboxComparator(TO);
+    private final static Comparator<MailboxMessage<?>> REVERSE_TO_COMPARATOR = new ReverseComparator(TO_COMPARATOR);
 
 
-    private final static Comparator<Message<?>> CC_COMPARATOR = new HeaderMailboxComparator(CC);
-    private final static Comparator<Message<?>> REVERSE_CC_COMPARATOR = new ReverseComparator(CC_COMPARATOR);
+    private final static Comparator<MailboxMessage<?>> CC_COMPARATOR = new HeaderMailboxComparator(CC);
+    private final static Comparator<MailboxMessage<?>> REVERSE_CC_COMPARATOR = new ReverseComparator(CC_COMPARATOR);
 
     
     public HeaderMailboxComparator(String headerName) {
@@ -44,7 +44,7 @@ public class HeaderMailboxComparator ext
     }
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         String mailbox1 = SearchUtil.getMailboxAddress(getHeaderValue(headerName, o1));
         String mailbox2 = SearchUtil.getMailboxAddress(getHeaderValue(headerName, o2));
 
@@ -53,7 +53,7 @@ public class HeaderMailboxComparator ext
     
 
     
-    public static Comparator<Message<?>> from(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> from(boolean reverse) {
         if (reverse) {
             return REVERSE_FROM_COMPARATOR;
         } else {
@@ -61,7 +61,7 @@ public class HeaderMailboxComparator ext
         }
     }
     
-    public static Comparator<Message<?>> cc(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> cc(boolean reverse) {
         if (reverse) {
             return REVERSE_CC_COMPARATOR;
         } else {
@@ -69,7 +69,7 @@ public class HeaderMailboxComparator ext
         }
     }
     
-    public static Comparator<Message<?>> to(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> to(boolean reverse) {
         if (reverse) {
             return REVERSE_TO_COMPARATOR;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/InternalDateComparator.java Tue Jan 12 13:17:03 2016
@@ -20,25 +20,25 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
- * {@link Comparator} which compares {@link Message}'s with their {@link Message#getInternalDate()} value
+ * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getInternalDate()} value
  *
  */
-public class InternalDateComparator  implements Comparator<Message<?>>{
+public class InternalDateComparator  implements Comparator<MailboxMessage<?>>{
 
 
-    private final static Comparator<Message<?>> INTERNALDATE = new InternalDateComparator();;
-    private final static Comparator<Message<?>> REVERSE_INTERNALDATE = new ReverseComparator(INTERNALDATE);
+    private final static Comparator<MailboxMessage<?>> INTERNALDATE = new InternalDateComparator();;
+    private final static Comparator<MailboxMessage<?>> REVERSE_INTERNALDATE = new ReverseComparator(INTERNALDATE);
 
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         return (o1.getInternalDate().compareTo(o2.getInternalDate()));
     }
 
-    public static Comparator<Message<?>> internalDate(boolean reverse){
+    public static Comparator<MailboxMessage<?>> internalDate(boolean reverse){
         if (reverse) {
             return REVERSE_INTERNALDATE;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/ReverseComparator.java Tue Jan 12 13:17:03 2016
@@ -20,20 +20,20 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
  * {@link Comparator} which wraps an other {@link Comparator} and reverse it
  *
  */
-public class ReverseComparator implements Comparator<Message<?>>{
+public class ReverseComparator implements Comparator<MailboxMessage<?>>{
 
-    private final Comparator<Message<?>> comparator;
-    public ReverseComparator(Comparator<Message<?>> comparator) {
+    private final Comparator<MailboxMessage<?>> comparator;
+    public ReverseComparator(Comparator<MailboxMessage<?>> comparator) {
         this.comparator = comparator;
     }
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         return comparator.compare(o2, o1);
     }
 

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SentDateComparator.java Tue Jan 12 13:17:03 2016
@@ -22,7 +22,7 @@ import java.io.StringReader;
 import java.util.Comparator;
 import java.util.Date;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mime4j.dom.datetime.DateTime;
 import org.apache.james.mime4j.field.datetime.parser.DateTimeParser;
 import org.apache.james.mime4j.field.datetime.parser.ParseException;
@@ -35,8 +35,8 @@ public class SentDateComparator extends
 
 
 
-    private final static Comparator<Message<?>> SENTDATE = new SentDateComparator(false);
-    private final static Comparator<Message<?>> REVERSE_SENTDATE = new ReverseComparator(new SentDateComparator(true));
+    private final static Comparator<MailboxMessage<?>> SENTDATE = new SentDateComparator(false);
+    private final static Comparator<MailboxMessage<?>> REVERSE_SENTDATE = new ReverseComparator(new SentDateComparator(true));
     
     private final boolean reverse;
 
@@ -45,7 +45,7 @@ public class SentDateComparator extends
     }
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         Date date1 = getSentDate(o1);
         Date date2 = getSentDate(o2);
         int i = date1.compareTo(date2);
@@ -57,7 +57,7 @@ public class SentDateComparator extends
         return 0;
     }
     
-    private Date getSentDate(Message<?> message) {
+    private Date getSentDate(MailboxMessage<?> message) {
         final String value = getHeaderValue("Date", message);
         final StringReader reader = new StringReader(value);
         try {
@@ -69,7 +69,7 @@ public class SentDateComparator extends
         }
     }
     
-    public static Comparator<Message<?>> sentDate(boolean reverse){
+    public static Comparator<MailboxMessage<?>> sentDate(boolean reverse){
         if (reverse) {
             return REVERSE_SENTDATE;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/SizeComparator.java Tue Jan 12 13:17:03 2016
@@ -20,25 +20,25 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
- * {@link Comparator} which compares {@link Message}'s with their {@link Message#getFullContentOctets()} value
+ * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getFullContentOctets()} value
  *
  */
-public class SizeComparator implements Comparator<Message<?>>{
+public class SizeComparator implements Comparator<MailboxMessage<?>>{
 
 
-    private final static Comparator<Message<?>> SIZE = new SizeComparator();
-    private final static Comparator<Message<?>> REVERSE_SIZE = new ReverseComparator(SIZE);
+    private final static Comparator<MailboxMessage<?>> SIZE = new SizeComparator();
+    private final static Comparator<MailboxMessage<?>> REVERSE_SIZE = new ReverseComparator(SIZE);
 
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         return (int) (o1.getFullContentOctets() - o2.getFullContentOctets());
     }
 
-    public static Comparator<Message<?>> size(boolean reverse) {
+    public static Comparator<MailboxMessage<?>> size(boolean reverse) {
         if (reverse) {
             return REVERSE_SIZE;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/search/comparator/UidComparator.java Tue Jan 12 13:17:03 2016
@@ -20,25 +20,25 @@ package org.apache.james.mailbox.store.s
 
 import java.util.Comparator;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
- * {@link Comparator} which compares {@link Message}'s with their {@link Message#getUid()} value
+ * {@link Comparator} which compares {@link MailboxMessage}'s with their {@link MailboxMessage#getUid()} value
  *
  */
-public class UidComparator implements Comparator<Message<?>>{
+public class UidComparator implements Comparator<MailboxMessage<?>>{
 
 
-    private final static Comparator<Message<?>> UID = new UidComparator();;
-    private final static Comparator<Message<?>> REVERSE_UID = new ReverseComparator(UID);
+    private final static Comparator<MailboxMessage<?>> UID = new UidComparator();;
+    private final static Comparator<MailboxMessage<?>> REVERSE_UID = new ReverseComparator(UID);
 
     
     @Override
-    public int compare(Message<?> o1, Message<?> o2) {
+    public int compare(MailboxMessage<?> o1, MailboxMessage<?> o2) {
         return (int) (o1.getUid() - o2.getUid());
     }
 
-    public static Comparator<Message<?>> uid(boolean reverse){
+    public static Comparator<MailboxMessage<?>> uid(boolean reverse){
         if (reverse) {
             return REVERSE_UID;
         } else {

Modified: james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/InputStreamContent.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/InputStreamContent.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/InputStreamContent.java (original)
+++ james/project/trunk/mailbox/store/src/main/java/org/apache/james/mailbox/store/streaming/InputStreamContent.java Tue Jan 12 13:17:03 2016
@@ -22,14 +22,14 @@ import java.io.IOException;
 import java.io.InputStream;
 
 import org.apache.james.mailbox.model.Content;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 /**
  * {@link Content} which is stored in a {@link InputStream}
  *
  */
 public final class InputStreamContent implements Content{
-    private Message<?> m;
+    private MailboxMessage<?> m;
     private Type type;
 
     public static enum Type {
@@ -37,7 +37,7 @@ public final class InputStreamContent im
         Body
     }
     
-    public InputStreamContent(Message<?> m, Type type) throws IOException{
+    public InputStreamContent(MailboxMessage<?> m, Type type) throws IOException{
         this.m = m;
         this.type = type;
     }

Copied: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java (from r1724224, james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java)
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java?p2=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java&p1=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java&r1=1724224&r2=1724225&rev=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageResultImplTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MailboxMessageResultImplTest.java Tue Jan 12 13:17:03 2016
@@ -25,11 +25,11 @@ import static org.junit.Assert.assertTru
 
 import java.util.Date;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.junit.Before;
 import org.junit.Test;
 
-public class MessageResultImplTest {
+public class MailboxMessageResultImplTest {
     private MessageResultImpl msgResultA;
     private MessageResultImpl msgResultACopy;
     private MessageResultImpl msgResultB;
@@ -42,9 +42,9 @@ public class MessageResultImplTest {
     public void initNames() throws Exception
     {
         Date dateAB = new Date();
-        Message<TestId> msgA = buildMessage(100, dateAB);
-        Message<TestId> msgB = buildMessage(100, dateAB);
-        Message<TestId> msgC = buildMessage(200, new Date());
+        MailboxMessage<TestId> msgA = buildMessage(100, dateAB);
+        MailboxMessage<TestId> msgB = buildMessage(100, dateAB);
+        MailboxMessage<TestId> msgC = buildMessage(200, new Date());
         
         msgResultA = new MessageResultImpl(msgA);
         msgResultACopy = new MessageResultImpl(msgA);
@@ -53,7 +53,7 @@ public class MessageResultImplTest {
     }
 
 
-    private Message<TestId> buildMessage(int uid, Date aDate) throws Exception {
+    private MailboxMessage<TestId> buildMessage(int uid, Date aDate) throws Exception {
         MessageBuilder builder = new MessageBuilder();
         builder.uid = uid;
         builder.internalDate = aDate;

Modified: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/MessageBuilder.java Tue Jan 12 13:17:03 2016
@@ -24,7 +24,7 @@ import java.util.Map;
 
 import javax.mail.Flags;
 
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 public class MessageBuilder {
     
@@ -37,8 +37,8 @@ public class MessageBuilder {
     public final Map<String, String> headers = new HashMap<String, String>();
     public int lineNumber = 0;
     
-    public Message<TestId> build() throws Exception {
-        Message<TestId> result = new SimpleMailboxMembership(mailboxId, uid, -1,  internalDate, size, flags, body, headers);
+    public MailboxMessage<TestId> build() throws Exception {
+        MailboxMessage<TestId> result = new SimpleMailboxMembership(mailboxId, uid, -1,  internalDate, size, flags, body, headers);
         return result;
     }
     

Modified: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsMultipartMixedTest.java Tue Jan 12 13:17:03 2016
@@ -26,7 +26,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.MessageSearches;
 import org.junit.Before;
 import org.junit.Test;
@@ -107,7 +107,7 @@ public class SearchUtilsMultipartMixedTe
             + "  Than both your poets can in praise devise.\r\n"
             + "\r\n--2.50290787509--\r\n" + "\r\n--1729--\r\n";
 
-    Message<TestId> row;
+    MailboxMessage<TestId> row;
 
 
     Collection<Long> recent;

Modified: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsRFC822Test.java Tue Jan 12 13:17:03 2016
@@ -26,7 +26,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 
 import org.apache.james.mailbox.model.SearchQuery;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.MessageSearches;
 import org.junit.Before;
 import org.junit.Test;
@@ -47,7 +47,7 @@ public class SearchUtilsRFC822Test {
             + "It has " + RHUBARD + ".\r\n" + "It has " + CUSTARD + ".\r\n"
             + "It needs naught else.\r\n";
 
-    Message<TestId> row;
+    MailboxMessage<TestId> row;
 
     private Logger log = LoggerFactory.getLogger(getClass());
     Collection<Long> recent;

Modified: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SearchUtilsTest.java Tue Jan 12 13:17:03 2016
@@ -33,7 +33,7 @@ import javax.mail.Flags;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.model.SearchQuery.AddressType;
 import org.apache.james.mailbox.model.SearchQuery.DateResolution;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.MessageSearches;
 import org.junit.Before;
 import org.junit.Test;
@@ -82,7 +82,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeLessThan() throws Exception {
         builder.size = SIZE;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeLessThan(SIZE), row,
@@ -96,7 +96,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeMoreThan() throws Exception {
         builder.size = SIZE;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE - 1), row,
                 recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeGreaterThan(SIZE), row,
@@ -110,7 +110,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchSizeEquals() throws Exception {
         builder.size = SIZE;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE - 1), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.sizeEquals(SIZE), row, recent, log));
@@ -123,7 +123,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateEquals() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.internalDateOn(getDate(8, 9, 2001), DateResolution.Day),
@@ -140,7 +140,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateBefore() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(
                 SearchQuery.internalDateBefore(getDate(9, 9, 2000), DateResolution.Day), row, recent, log));
         assertFalse(new MessageSearches().isMatch(
@@ -156,7 +156,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchInternalDateAfter() throws Exception {
         builder.internalDate = SUN_SEP_9TH_2001;
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(9, 9, 2000), DateResolution.Day),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.internalDateAfter(getDate(8, 9, 2001), DateResolution.Day),
@@ -172,7 +172,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -190,7 +190,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -208,7 +208,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateAfter() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(9,
                 9, 2000), DateResolution.Day), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(8,
@@ -226,7 +226,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD, RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -244,7 +244,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toUpperCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -262,7 +262,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateOn() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(9, 9,
                 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(8, 9,
@@ -280,7 +280,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -298,7 +298,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -316,7 +316,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderDateBefore() throws Exception {
         builder.header(DATE_FIELD.toLowerCase(), RFC822_SUN_SEP_9TH_2001);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
                 getDate(9, 9, 2000), DateResolution.Day),row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD,
@@ -334,7 +334,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsCaps() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -350,7 +350,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContainsLowers() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -366,7 +366,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT.toUpperCase());
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -382,7 +382,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowerHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -398,7 +398,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchCapsHeaderContains() throws Exception {
         builder.header(SUBJECT_FIELD.toUpperCase(), TEXT);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
                 CUSTARD), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerContains(DATE_FIELD,
@@ -414,7 +414,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD, TEXT);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -424,7 +424,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchLowersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -434,7 +434,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUppersHeaderExists() throws Exception {
         builder.header(SUBJECT_FIELD.toLowerCase(), TEXT);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerExists(DATE_FIELD), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerExists(SUBJECT_FIELD),
@@ -444,7 +444,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchUidRange() throws Exception {
         builder.setKey(1, 1729);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1, 1)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.uid(range(1728, 1728)), row,
                 recent, log));
@@ -475,7 +475,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagSet() throws Exception {
         builder.setFlags(true, false, false, false, false, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -493,7 +493,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagSet() throws Exception {
         builder.setFlags(false, false, true, false, false, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -511,7 +511,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagSet() throws Exception {
         builder.setFlags(false, true, false, false, false, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -529,7 +529,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagSet() throws Exception {
         builder.setFlags(false, false, false, true, false, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -548,7 +548,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagSet() throws Exception {
         builder.setFlags(false, false, false, false, true, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.FLAGGED),
@@ -566,7 +566,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentSet() throws Exception {
         builder.setFlags(false, false, false, false, false, false);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -585,7 +585,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenFlagUnSet() throws Exception {
         builder.setFlags(false, true, true, true, true, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertTrue(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -604,7 +604,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAnsweredFlagUnSet() throws Exception {
         builder.setFlags(true, true, false, true, true, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -623,7 +623,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchFlaggedFlagUnSet() throws Exception {
         builder.setFlags(true, false, true, true, true, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -642,7 +642,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDraftFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, false, true, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -661,7 +661,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchDeletedFlagUnSet() throws Exception {
         builder.setFlags(true, true, true, true, false, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid()));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -680,7 +680,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchSeenRecentUnSet() throws Exception {
         builder.setFlags(true, true, true, true, true, true);
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         recent.add(new Long(row.getUid() + 1));
         assertFalse(new MessageSearches().isMatch(SearchQuery.flagIsUnSet(Flags.Flag.SEEN),
                 row, recent, log));
@@ -698,13 +698,13 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAll() throws Exception {
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.all(), row, recent, log));
     }
 
     @Test
     public void testShouldMatchNot() throws Exception {
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.not(SearchQuery.all()), row,
                 recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.not(SearchQuery
@@ -713,7 +713,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchOr() throws Exception {
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertTrue(new MessageSearches().isMatch(SearchQuery.or(SearchQuery
@@ -727,7 +727,7 @@ public class SearchUtilsTest {
 
     @Test
     public void testShouldMatchAnd() throws Exception {
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery.all(),
                 SearchQuery.headerExists(DATE_FIELD)), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.and(SearchQuery
@@ -757,7 +757,7 @@ public class SearchUtilsTest {
     @Test
     public void testMatchHeaderDateOnWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.headerDateOn(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -771,7 +771,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateBeforeWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateBefore(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -784,7 +784,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchHeaderDateAfterWithOffset() throws Exception {
         builder.header(DATE_FIELD, "Mon, 26 Mar 2007 00:00:00 +0300");
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertFalse(new MessageSearches().isMatch(SearchQuery.headerDateAfter(DATE_FIELD, getDate(26, 3,
                 2007), DateResolution.Day),row, recent, log));
         
@@ -797,7 +797,7 @@ public class SearchUtilsTest {
     @Test
     public void testShouldMatchAddressHeaderWithComments() throws Exception {
         builder.header("To", "<user-from (comment)@ (comment) domain.org>");
-        Message<TestId> row = builder.build();
+        MailboxMessage<TestId> row = builder.build();
         assertTrue(new MessageSearches().isMatch(SearchQuery.address(AddressType.To, "user-from@domain.org"), row, recent, log));
         assertFalse(new MessageSearches().isMatch(SearchQuery.address(AddressType.From, "user-from@domain.org"), row, recent, log));
     }

Modified: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java?rev=1724225&r1=1724224&r2=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/SimpleMailboxMembership.java Tue Jan 12 13:17:03 2016
@@ -36,10 +36,10 @@ import java.util.Map.Entry;
 import javax.mail.Flags;
 
 import org.apache.james.mailbox.store.mail.model.DefaultMessageId;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.Property;
 
-public class SimpleMailboxMembership implements Message<TestId> {
+public class SimpleMailboxMembership implements MailboxMessage<TestId> {
     
     private static final String TOSTRING_SEPARATOR = " ";
     
@@ -163,7 +163,7 @@ public class SimpleMailboxMembership imp
             return false;
         if (getClass() != obj.getClass())
             return false;
-        final Message<TestId> other = (Message<TestId>) obj;
+        final MailboxMessage<TestId> other = (MailboxMessage<TestId>) obj;
         if (mailboxId.id != other.getMailboxId().id)
             return false;
         if (uid != other.getUid())
@@ -251,7 +251,7 @@ public class SimpleMailboxMembership imp
         return size;
     }
 
-    public int compareTo(Message<TestId> other) {
+    public int compareTo(MailboxMessage<TestId> other) {
         return (int) (getUid() - other.getUid());
     }
 

Copied: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java (from r1724224, james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java)
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java?p2=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java&p1=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java&r1=1724224&r2=1724225&rev=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMessageResultIteratorTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/StoreMailboxMessageResultIteratorTest.java Tue Jan 12 13:17:03 2016
@@ -39,13 +39,13 @@ import org.apache.james.mailbox.model.Me
 import org.apache.james.mailbox.model.UpdatedFlags;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.mail.model.impl.PropertyBuilder;
-import org.apache.james.mailbox.store.mail.model.impl.SimpleMessage;
+import org.apache.james.mailbox.store.mail.model.impl.SimpleMailboxMessage;
 import org.assertj.core.api.iterable.Extractor;
 import org.junit.Test;
 
-public class StoreMessageResultIteratorTest {
+public class StoreMailboxMessageResultIteratorTest {
 
     private final class TestFetchGroup implements FetchGroup {
         @Override
@@ -79,14 +79,14 @@ public class StoreMessageResultIteratorT
         }
 
         @Override
-        public Iterator<Message<TestId>> findInMailbox(Mailbox<TestId> mailbox, MessageRange set,
-                org.apache.james.mailbox.store.mail.MessageMapper.FetchType type, int limit)
+        public Iterator<MailboxMessage<TestId>> findInMailbox(Mailbox<TestId> mailbox, MessageRange set,
+                                                              org.apache.james.mailbox.store.mail.MessageMapper.FetchType type, int limit)
                 throws MailboxException {
             
             long start = set.getUidFrom();
             long end = Math.min(start + limit, set.getUidTo());
 
-            List<Message<TestId>> messages = new ArrayList<Message<TestId>>();
+            List<MailboxMessage<TestId>> messages = new ArrayList<MailboxMessage<TestId>>();
             
             for (long uid: MessageRange.range(start, end)) {
                 if (messageRange.includes(uid)) {
@@ -96,8 +96,8 @@ public class StoreMessageResultIteratorT
             return messages.iterator();
         }
 
-        private SimpleMessage<TestId> createMessage(long uid) {
-            SimpleMessage<TestId> message = new SimpleMessage<TestId>(null, 0, 0, new SharedByteArrayInputStream(
+        private SimpleMailboxMessage<TestId> createMessage(long uid) {
+            SimpleMailboxMessage<TestId> message = new SimpleMailboxMessage<TestId>(null, 0, 0, new SharedByteArrayInputStream(
                     "".getBytes()), new Flags(), new PropertyBuilder(), TestId.of(1L));
             message.setUid(uid);
             return message;
@@ -122,7 +122,7 @@ public class StoreMessageResultIteratorT
         }
 
         @Override
-        public void delete(Mailbox<TestId> mailbox, Message<TestId> message) throws MailboxException {
+        public void delete(Mailbox<TestId> mailbox, MailboxMessage<TestId> message) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
@@ -138,7 +138,7 @@ public class StoreMessageResultIteratorT
         }
 
         @Override
-        public MessageMetaData add(Mailbox<TestId> mailbox, Message<TestId> message) throws MailboxException {
+        public MessageMetaData add(Mailbox<TestId> mailbox, MailboxMessage<TestId> message) throws MailboxException {
             throw new UnsupportedOperationException();
         }
 
@@ -148,7 +148,7 @@ public class StoreMessageResultIteratorT
         }
 
         @Override
-        public MessageMetaData copy(Mailbox<TestId> mailbox, Message<TestId> original) throws MailboxException {
+        public MessageMetaData copy(Mailbox<TestId> mailbox, MailboxMessage<TestId> original) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }
@@ -164,7 +164,7 @@ public class StoreMessageResultIteratorT
         }
 
         @Override
-        public MessageMetaData move(Mailbox<TestId> mailbox, Message<TestId> original) throws MailboxException {
+        public MessageMetaData move(Mailbox<TestId> mailbox, MailboxMessage<TestId> original) throws MailboxException {
             throw new UnsupportedOperationException();
 
         }

Copied: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java (from r1724224, james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java)
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java?p2=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java&p1=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java&r1=1724224&r2=1724225&rev=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MessagePackEventSerializerTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/json/MailboxMessagePackEventSerializerTest.java Tue Jan 12 13:17:03 2016
@@ -25,7 +25,7 @@ import org.apache.james.mailbox.store.ev
 import org.apache.james.mailbox.store.json.event.EventConverter;
 import org.apache.james.mailbox.store.json.event.MailboxConverter;
 
-public class MessagePackEventSerializerTest extends EventSerializerTest {
+public class MailboxMessagePackEventSerializerTest extends EventSerializerTest {
 
     @Override
     EventSerializer createSerializer() {

Copied: james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMessageTest.java (from r1724224, james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java)
URL: http://svn.apache.org/viewvc/james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMessageTest.java?p2=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMessageTest.java&p1=james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java&r1=1724224&r2=1724225&rev=1724225&view=diff
==============================================================================
--- james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java (original)
+++ james/project/trunk/mailbox/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMailboxMessageTest.java Tue Jan 12 13:17:03 2016
@@ -23,20 +23,19 @@ import static org.junit.Assert.*;
 
 import org.apache.james.mailbox.store.MessageBuilder;
 import org.apache.james.mailbox.store.TestId;
-import org.apache.james.mailbox.store.mail.model.Message;
 import org.junit.Test;
 
-public class AbstractMessageTest {    
+public class AbstractMailboxMessageTest {
     
     @Test
     public void testShouldReturnPositiveWhenFirstGreaterThanSecond()
             throws Exception {
-        Message<TestId> one = buildMessage(100);
-        Message<TestId> two = buildMessage(99);
+        MailboxMessage<TestId> one = buildMessage(100);
+        MailboxMessage<TestId> two = buildMessage(99);
         assertTrue( one.compareTo(two) > 0);
     }
 
-    private Message<TestId> buildMessage(int uid) throws Exception {
+    private MailboxMessage<TestId> buildMessage(int uid) throws Exception {
         MessageBuilder builder = new MessageBuilder();
         builder.uid = uid;
         return builder.build();
@@ -45,15 +44,15 @@ public class AbstractMessageTest {
     @Test
     public void testShouldReturnNegativeWhenFirstLessThanSecond()
             throws Exception {
-        Message<TestId> one = buildMessage(98);
-        Message<TestId> two = buildMessage(99);
+        MailboxMessage<TestId> one = buildMessage(98);
+        MailboxMessage<TestId> two = buildMessage(99);
         assertTrue( one.compareTo(two) < 0);
     }
 
     @Test
     public void testShouldReturnZeroWhenFirstEqualsSecond() throws Exception {
-        Message<TestId> one = buildMessage(90);
-        Message<TestId> two = buildMessage(90);
+        MailboxMessage<TestId> one = buildMessage(90);
+        MailboxMessage<TestId> two = buildMessage(90);
         assertEquals(0, one.compareTo(two));
     }
 }



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