james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r993100 [1/3] - in /james/imap/trunk: api/ api/src/main/java/org/apache/james/imap/api/ api/src/main/java/org/apache/james/imap/api/process/ deployment/src/test/java/org/apache/james/imap/functional/ jcr/ jcr/src/main/java/org/apache/james/...
Date Mon, 06 Sep 2010 17:19:20 GMT
Author: norman
Date: Mon Sep  6 17:19:17 2010
New Revision: 993100

URL: http://svn.apache.org/viewvc?rev=993100&view=rev
Log:
Start to remove dependencies on imap specific stuff from mailbox and store (IMAP-208)

Added:
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxPath.java
      - copied, changed from r991286, james/imap/trunk/api/src/main/java/org/apache/james/imap/api/MailboxPath.java
Removed:
    james/imap/trunk/api/src/main/java/org/apache/james/imap/api/MailboxPath.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/StorageException.java
Modified:
    james/imap/trunk/api/pom.xml
    james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
    james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/AbstractStressTest.java
    james/imap/trunk/jcr/pom.xml
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
    james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
    james/imap/trunk/jpa/pom.xml
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailboxManager.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPATransactionalMapper.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMailboxMapper.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMessageMapper.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/JPAMailbox.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAMailboxMembership.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAStreamingMailboxMembership.java
    james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/user/JPASubscriptionMapper.java
    james/imap/trunk/mailbox/pom.xml
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/BadCredentialsException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxExistsException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxListener.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxManager.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxMetaData.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxNotFoundException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxQuery.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedCriteriaException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedOperationException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedSearchException.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
    james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/SimpleMailboxMetaData.java
    james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/MailboxExpressionTest.java
    james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcherFlagsTest.java
    james/imap/trunk/maildir/pom.xml
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirMailboxManager.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirStore.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/mail/MaildirMailboxMapper.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/mail/MaildirMessageMapper.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/mail/model/MaildirMailbox.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/mail/model/MaildirMessage.java
    james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/user/MaildirSubscriptionMapper.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/InMemoryMailboxManager.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/mail/InMemoryMailboxMapper.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/mail/InMemoryMessageMapper.java
    james/imap/trunk/memory/src/main/java/org/apache/james/imap/inmemory/mail/model/InMemoryMailbox.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractMailboxProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AbstractSelectionProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/AppendProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CloseProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CopyProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/CreateProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/DeleteProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ExpungeProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LSubProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/ListProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LoginProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/LogoutProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/RenameProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SearchProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StatusProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/StoreProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/SubscribeProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/UnsubscribeProcessor.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/MailboxEventAnalyser.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/base/SelectedMailboxImpl.java
    james/imap/trunk/processor/src/main/java/org/apache/james/imap/processor/fetch/FetchProcessor.java
    james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/ListProcessorTest.java
    james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/SearchProcessorTest.java
    james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/FakeMailboxListenerAdded.java
    james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/FakeMailboxListenerFlagsUpdate.java
    james/imap/trunk/processor/src/test/java/org/apache/james/imap/processor/base/MailboxEventAnalyserTest.java
    james/imap/trunk/store/pom.xml
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/DelegatingMailboxListener.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MailboxPathLock.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MapperStoreMessageManager.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/MessageSearches.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/ResultUtils.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxManager.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMailboxPath.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreMessageManager.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/StoreSubscriptionManager.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/mail/MailboxMapper.java
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/mail/MessageMapper.java
    james/imap/trunk/store/src/test/java/org/apache/james/imap/store/SearchUtilsMultipartMixedTest.java
    james/imap/trunk/store/src/test/java/org/apache/james/imap/store/SearchUtilsRFC822Test.java
    james/imap/trunk/store/src/test/java/org/apache/james/imap/store/SearchUtilsTest.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/LockException.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/TorqueResultIterator.java
    james/imap/trunk/torque/src/main/java/org/apache/james/mailboxmanager/torque/UidChangeTracker.java

Modified: james/imap/trunk/api/pom.xml
URL: http://svn.apache.org/viewvc/james/imap/trunk/api/pom.xml?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/api/pom.xml (original)
+++ james/imap/trunk/api/pom.xml Mon Sep  6 17:19:17 2010
@@ -35,6 +35,11 @@
     </dependency>
     
     <dependency>
+      <groupId>org.apache.james</groupId>
+      <artifactId>apache-james-imap-mailbox</artifactId>
+    </dependency>
+    
+    <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
     </dependency>

Modified: james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java (original)
+++ james/imap/trunk/api/src/main/java/org/apache/james/imap/api/process/SelectedMailbox.java Mon Sep  6 17:19:17 2010
@@ -21,7 +21,7 @@ package org.apache.james.imap.api.proces
 
 import java.util.Collection;
 
-import org.apache.james.imap.api.MailboxPath;
+import org.apache.james.imap.mailbox.MailboxPath;
 
 
 /**

Modified: james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/AbstractStressTest.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/AbstractStressTest.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/AbstractStressTest.java (original)
+++ james/imap/trunk/deployment/src/test/java/org/apache/james/imap/functional/AbstractStressTest.java Mon Sep  6 17:19:17 2010
@@ -28,7 +28,7 @@ import java.util.concurrent.atomic.Atomi
 import javax.mail.Flags;
 
 import org.apache.commons.logging.impl.SimpleLog;
-import org.apache.james.imap.api.MailboxPath;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MessageManager;
 import org.apache.james.imap.mailbox.MailboxConstants;
 import org.apache.james.imap.mailbox.MailboxException;

Modified: james/imap/trunk/jcr/pom.xml
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/pom.xml?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/pom.xml (original)
+++ james/imap/trunk/jcr/pom.xml Mon Sep  6 17:19:17 2010
@@ -29,11 +29,6 @@
   <artifactId>apache-james-imap-jcr</artifactId>
   <name>Apache James IMAP JCR Mailbox Manager</name>
   <dependencies>
-  
-    <dependency>
-      <groupId>org.apache.james</groupId>
-      <artifactId>apache-james-imap-api</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-mailbox</artifactId>
@@ -43,14 +38,6 @@
       <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-store</artifactId>
     </dependency>
-
-<!--
-    <dependency>
-      <groupId>org.apache.torque</groupId>
-      <artifactId>torque-runtime</artifactId>
-      <scope>test</scope>
-    </dependency>
--->
     <dependency>
       <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-deployment</artifactId>

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/AbstractJCRMapper.java Mon Sep  6 17:19:17 2010
@@ -22,7 +22,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.commons.logging.Log;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.store.transaction.TransactionalMapper;
@@ -92,7 +91,7 @@ public abstract class AbstractJCRMapper 
                 getSession().save();
             }
         } catch (RepositoryException e) {
-            throw new MailboxException(HumanReadableText.COMMIT_TRANSACTION_FAILED, e);
+            throw new MailboxException("Unable to commit", e);
         }
     }
 

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/JCRMailboxManager.java Mon Sep  6 17:19:17 2010
@@ -20,10 +20,10 @@ package org.apache.james.imap.jcr;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.jcr.mail.JCRMailboxMapper;
 import org.apache.james.imap.jcr.mail.model.JCRMailbox;
 import org.apache.james.imap.mailbox.MailboxException;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.store.Authenticator;

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMailboxMapper.java Mon Sep  6 17:19:17 2010
@@ -34,17 +34,16 @@ import org.apache.jackrabbit.JcrConstant
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.util.ISO9075;
 import org.apache.jackrabbit.util.Text;
-import org.apache.james.imap.api.MailboxPath;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.AbstractJCRScalingMapper;
 import org.apache.james.imap.jcr.MailboxSessionJCRRepository;
 import org.apache.james.imap.jcr.NodeLocker;
 import org.apache.james.imap.jcr.NodeLocker.NodeLockedExecution;
 import org.apache.james.imap.jcr.mail.model.JCRMailbox;
 import org.apache.james.imap.mailbox.MailboxConstants;
+import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxNotFoundException;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxSession;
-import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.store.mail.MailboxMapper;
 import org.apache.james.imap.store.mail.model.Mailbox;
 
@@ -66,7 +65,7 @@ public class JCRMailboxMapper extends Ab
      * org.apache.james.imap.store.mail.MailboxMapper#delete(org.apache.james
      * .imap.store.mail.model.Mailbox)
      */
-    public void delete(Mailbox<String> mailbox) throws StorageException {
+    public void delete(Mailbox<String> mailbox) throws MailboxException {
         try {
             Node node = getSession().getNodeByIdentifier(((JCRMailbox) mailbox).getMailboxId());
                    
@@ -75,7 +74,7 @@ public class JCRMailboxMapper extends Ab
         } catch (PathNotFoundException e) {
             // mailbox does not exists..
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+            throw new MailboxException("Unable to delete mailbox " + mailbox, e);
         }
     }
 
@@ -84,14 +83,14 @@ public class JCRMailboxMapper extends Ab
      * 
      * @see org.apache.james.imap.store.mail.MailboxMapper#deleteAll()
      */
-    public void deleteAll() throws StorageException {
+    public void deleteAll() throws MailboxException {
         try {
             getSession().getRootNode().getNode(MAILBOXES_PATH).remove();
 
         } catch (PathNotFoundException e) {
             // nothing todo
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+            throw new MailboxException("Unable to delete all mailboxes", e);
         }
     }
 
@@ -99,13 +98,13 @@ public class JCRMailboxMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxById(java.lang.Object)
      */
-    public Mailbox<String> findMailboxById(String mailboxId) throws StorageException, MailboxNotFoundException {
+    public Mailbox<String> findMailboxById(String mailboxId) throws MailboxException, MailboxNotFoundException {
         try {
             return new JCRMailbox(getSession().getNodeByIdentifier(mailboxId), getLogger());
         } catch (PathNotFoundException e) {
             throw new MailboxNotFoundException(mailboxId);
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to find mailbox  with id " + mailboxId, e);
         }
     }
     
@@ -114,7 +113,7 @@ public class JCRMailboxMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxByPath(org.apache.james.imap.api.MailboxPath)
      */
-    public Mailbox<String> findMailboxByPath(MailboxPath path) throws StorageException, MailboxNotFoundException {
+    public Mailbox<String> findMailboxByPath(MailboxPath path) throws MailboxException, MailboxNotFoundException {
         try {
             String name = Text.escapeIllegalXpathSearchChars(path.getName());
             String user = path.getUser();
@@ -136,7 +135,7 @@ public class JCRMailboxMapper extends Ab
         } catch (PathNotFoundException e) {
             throw new MailboxNotFoundException(path);
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to find mailbox " + path, e);
         }
     }
 
@@ -145,7 +144,7 @@ public class JCRMailboxMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxWithPathLike(org.apache.james.imap.api.MailboxPath)
      */
-    public List<Mailbox<String>> findMailboxWithPathLike(MailboxPath path) throws StorageException {
+    public List<Mailbox<String>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
         List<Mailbox<String>> mailboxList = new ArrayList<Mailbox<String>>();
         try {
             String name = Text.escapeIllegalXpathSearchChars(path.getName());
@@ -166,7 +165,7 @@ public class JCRMailboxMapper extends Ab
         } catch (PathNotFoundException e) {
             // nothing todo
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to find mailbox " + path, e);
         }
         return mailboxList;
     }
@@ -178,7 +177,7 @@ public class JCRMailboxMapper extends Ab
      * org.apache.james.imap.store.mail.MailboxMapper#save(org.apache.james.
      * imap.store.mail.model.Mailbox)
      */
-    public void save(Mailbox<String> mailbox) throws StorageException {
+    public void save(Mailbox<String> mailbox) throws MailboxException {
         
         try {
             final JCRMailbox jcrMailbox = (JCRMailbox)mailbox;
@@ -227,9 +226,9 @@ public class JCRMailboxMapper extends Ab
            }
             
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to save mailbox " + mailbox, e);
         } catch (InterruptedException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to save mailbox " + mailbox, e);
         }
     }
 
@@ -240,7 +239,7 @@ public class JCRMailboxMapper extends Ab
      * imap.store.mail.model.Mailbox)
      */
     public boolean hasChildren(Mailbox<String> mailbox)
-            throws StorageException, MailboxNotFoundException {
+            throws MailboxException, MailboxNotFoundException {
         try {
             String name = Text.escapeIllegalXpathSearchChars(mailbox.getName());
             String user = mailbox.getUser();
@@ -260,7 +259,7 @@ public class JCRMailboxMapper extends Ab
             NodeIterator it = result.getNodes();
             return it.hasNext();
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to retrieve children for mailbox " + mailbox, e);
         }
     }
  

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/JCRMessageMapper.java Mon Sep  6 17:19:17 2010
@@ -38,17 +38,16 @@ import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.util.ISO9075;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.AbstractJCRMapper;
 import org.apache.james.imap.jcr.MailboxSessionJCRRepository;
 import org.apache.james.imap.jcr.NodeLocker;
 import org.apache.james.imap.jcr.NodeLocker.NodeLockedExecution;
 import org.apache.james.imap.jcr.mail.model.JCRMailbox;
 import org.apache.james.imap.jcr.mail.model.JCRMessage;
+import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.MessageRange;
 import org.apache.james.imap.mailbox.SearchQuery;
-import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.mailbox.MessageRange.Type;
 import org.apache.james.imap.mailbox.SearchQuery.Criterion;
 import org.apache.james.imap.mailbox.SearchQuery.NumericRange;
@@ -147,7 +146,7 @@ public class JCRMessageMapper extends Ab
      * @see
      * org.apache.james.imap.store.mail.MessageMapper#countMessagesInMailbox()
      */
-    public long countMessagesInMailbox(Mailbox<String> mailbox) throws StorageException {
+    public long countMessagesInMailbox(Mailbox<String> mailbox) throws MailboxException {
         try {
             // we use order by because without it count will always be 0 in jackrabbit
             String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message) order by @" + JCRMessage.UID_PROPERTY;
@@ -164,7 +163,7 @@ public class JCRMessageMapper extends Ab
             } 
             return count;
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.COUNT_FAILED, e);
+            throw new MailboxException("Unable to count messages in mailbox " + mailbox, e);
         }
        
     }
@@ -176,7 +175,7 @@ public class JCRMessageMapper extends Ab
      * org.apache.james.imap.store.mail.MessageMapper#countUnseenMessagesInMailbox
      * ()
      */
-    public long countUnseenMessagesInMailbox(Mailbox<String> mailbox) throws StorageException {
+    public long countUnseenMessagesInMailbox(Mailbox<String> mailbox) throws MailboxException {
         
         try {
             // we use order by because without it count will always be 0 in jackrabbit
@@ -196,7 +195,7 @@ public class JCRMessageMapper extends Ab
             } 
             return count;
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.COUNT_FAILED, e);
+            throw new MailboxException("Unable to count unseen messages in mailbox " + mailbox, e);
         }
     }
 
@@ -204,14 +203,14 @@ public class JCRMessageMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#delete(java.lang.Object, org.apache.james.imap.store.mail.model.MailboxMembership)
      */
-    public void delete(Mailbox<String> mailbox, MailboxMembership<String> message) throws StorageException {
+    public void delete(Mailbox<String> mailbox, MailboxMembership<String> message) throws MailboxException {
         JCRMessage membership = (JCRMessage) message;
         if (membership.isPersistent()) {
             try {
 
                 getSession().getNodeByIdentifier(membership.getId()).remove();
             } catch (RepositoryException e) {
-                throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+                throw new MailboxException("Unable to delete message " + message + " in mailbox " + mailbox, e);
             }
         }
     }
@@ -223,7 +222,7 @@ public class JCRMessageMapper extends Ab
      * org.apache.james.imap.store.mail.MessageMapper#findInMailbox(org.apache
      * .james.imap.mailbox.MessageRange)
      */
-    public List<MailboxMembership<String>> findInMailbox(Mailbox<String> mailbox, MessageRange set) throws StorageException {
+    public List<MailboxMembership<String>> findInMailbox(Mailbox<String> mailbox, MessageRange set) throws MailboxException {
         try {
             final List<MailboxMembership<String>> results;
             final long from = set.getUidFrom();
@@ -246,7 +245,7 @@ public class JCRMessageMapper extends Ab
             }
             return results;
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to search MessageRange " + set + " in mailbox " + mailbox, e);
         }
     }
 
@@ -376,7 +375,7 @@ public class JCRMessageMapper extends Ab
      * org.apache.james.imap.store.mail.MessageMapper#findMarkedForDeletionInMailbox
      * (org.apache.james.imap.mailbox.MessageRange)
      */
-    public List<MailboxMembership<String>> findMarkedForDeletionInMailbox(Mailbox<String> mailbox, MessageRange set) throws StorageException {
+    public List<MailboxMembership<String>> findMarkedForDeletionInMailbox(Mailbox<String> mailbox, MessageRange set) throws MailboxException {
         try {
             final List<MailboxMembership<String>> results;
             final long from = set.getUidFrom();
@@ -399,7 +398,7 @@ public class JCRMessageMapper extends Ab
             }
             return results;
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to search MessageRange " + set + " in mailbox " + mailbox, e);
         }
     }
 
@@ -413,7 +412,7 @@ public class JCRMessageMapper extends Ab
      * org.apache.james.imap.store.mail.MessageMapper#findRecentMessagesInMailbox
      * ()
      */
-    public List<MailboxMembership<String>> findRecentMessagesInMailbox(Mailbox<String> mailbox, int limit) throws StorageException {
+    public List<MailboxMembership<String>> findRecentMessagesInMailbox(Mailbox<String> mailbox, int limit) throws MailboxException {
         
         try {
  
@@ -434,7 +433,7 @@ public class JCRMessageMapper extends Ab
             return list;
 
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to search recent messages in mailbox " + mailbox, e);
         }
     }
 
@@ -443,7 +442,7 @@ public class JCRMessageMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.imap.store.mail.model.Mailbox)
      */
-    public Long findFirstUnseenMessageUid(Mailbox<String> mailbox) throws StorageException {
+    public Long findFirstUnseenMessageUid(Mailbox<String> mailbox) throws MailboxException {
         try {
             String queryString = "/jcr:root" + getMailboxPath(mailbox) + "//element(*,jamesMailbox:message)[@" + JCRMessage.SEEN_PROPERTY +"='false'] order by @" + JCRMessage.UID_PROPERTY;
 
@@ -460,7 +459,7 @@ public class JCRMessageMapper extends Ab
                 return null;
             }
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to find first unseen message in mailbox " + mailbox, e);
         }
     }
 
@@ -468,7 +467,7 @@ public class JCRMessageMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#save(org.apache.james.imap.store.mail.model.Mailbox, org.apache.james.imap.store.mail.model.MailboxMembership)
      */
-    public long save(Mailbox<String> mailbox, MailboxMembership<String> message) throws StorageException {
+    public long save(Mailbox<String> mailbox, MailboxMembership<String> message) throws MailboxException {
         final JCRMessage membership = (JCRMessage) message;
         try {
 
@@ -579,11 +578,11 @@ public class JCRMessageMapper extends Ab
                 return membership.getUid();
             }
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to save message " + message + " in mailbox " + mailbox, e);
         } catch (IOException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to save message " + message + " in mailbox " + mailbox, e);
         } catch (InterruptedException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to save message " + message + " in mailbox " + mailbox, e);
         }
 
     }
@@ -606,7 +605,7 @@ public class JCRMessageMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#searchMailbox(org.apache.james.imap.store.mail.model.Mailbox, org.apache.james.imap.mailbox.SearchQuery)
      */
-    public Iterator<Long> searchMailbox(Mailbox<String> mailbox, SearchQuery query) throws StorageException {
+    public Iterator<Long> searchMailbox(Mailbox<String> mailbox, SearchQuery query) throws MailboxException {
         try {
             final Query xQuery = formulateXPath(mailbox, query);
             
@@ -633,7 +632,7 @@ public class JCRMessageMapper extends Ab
                 
             }, query, getLogger());
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Unable to search messages for query " + query + " in mailbox " + mailbox, e);
         }
     }
 
@@ -699,7 +698,7 @@ public class JCRMessageMapper extends Ab
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#copy(java.lang.Object, long, org.apache.james.imap.store.mail.model.MailboxMembership)
      */
-    public long copy(Mailbox<String> mailbox, MailboxMembership<String> oldmessage) throws StorageException{
+    public long copy(Mailbox<String> mailbox, MailboxMembership<String> oldmessage) throws MailboxException{
         try {
             long uid = reserveNextUid((JCRMailbox) mailbox);
             String newMessagePath = getSession().getNodeByIdentifier(mailbox.getMailboxId()).getPath() + NODE_DELIMITER + String.valueOf(uid);
@@ -709,9 +708,9 @@ public class JCRMessageMapper extends Ab
             node.setProperty(JCRMessage.UID_PROPERTY, uid);
             return uid;
         } catch (RepositoryException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to copy message " +oldmessage + " in mailbox " + mailbox, e);
         } catch (InterruptedException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Unable to copy message " +oldmessage + " in mailbox " + mailbox, e);
         }
     }
     

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMailbox.java Mon Sep  6 17:19:17 2010
@@ -24,9 +24,9 @@ import javax.jcr.RepositoryException;
 import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.util.Text;
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.jcr.JCRImapConstants;
 import org.apache.james.imap.jcr.Persistent;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.store.mail.model.Mailbox;
 
 

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/mail/model/JCRMessage.java Mon Sep  6 17:19:17 2010
@@ -35,7 +35,6 @@ import javax.mail.Flags;
 import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.JcrConstants;
 import org.apache.jackrabbit.commons.JcrUtils;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.JCRImapConstants;
 import org.apache.james.imap.jcr.Persistent;
 import org.apache.james.imap.mailbox.MailboxException;
@@ -147,7 +146,7 @@ public class JCRMessage extends Abstract
         try {
             this.content = new ByteArrayInputStream(StreamUtils.toByteArray(message.getFullContent()));
         } catch (IOException e) {
-            throw new MailboxException(HumanReadableText.FAILURE_MAIL_PARSE,e);
+            throw new MailboxException("Unable to parse message",e);
         }
        
         this.bodyStartOctet = (int) (message.getFullContentOctets() - message.getBodyOctets());

Modified: james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java (original)
+++ james/imap/trunk/jcr/src/main/java/org/apache/james/imap/jcr/user/JCRSubscriptionMapper.java Mon Sep  6 17:19:17 2010
@@ -34,7 +34,6 @@ import javax.jcr.query.QueryResult;
 import org.apache.commons.logging.Log;
 import org.apache.jackrabbit.commons.JcrUtils;
 import org.apache.jackrabbit.util.Text;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jcr.AbstractJCRScalingMapper;
 import org.apache.james.imap.jcr.MailboxSessionJCRRepository;
 import org.apache.james.imap.jcr.NodeLocker;
@@ -87,7 +86,7 @@ public class JCRSubscriptionMapper exten
         } catch (PathNotFoundException e) {
             // do nothing
         } catch (RepositoryException e) {
-            throw new SubscriptionException(HumanReadableText.DELETED_FAILED, e);
+            throw new SubscriptionException(e);
         }
 
     }
@@ -114,7 +113,7 @@ public class JCRSubscriptionMapper exten
         } catch (PathNotFoundException e) {
             // nothing todo here
         } catch (RepositoryException e) {
-            throw new SubscriptionException(HumanReadableText.SEARCH_FAILED, e);
+            throw new SubscriptionException(e);
         }
         return null;
 
@@ -148,7 +147,7 @@ public class JCRSubscriptionMapper exten
         } catch (PathNotFoundException e) {
             // Do nothing just return the empty list later
         } catch (RepositoryException e) {
-            throw new SubscriptionException(HumanReadableText.SEARCH_FAILED, e);
+            throw new SubscriptionException(e);
         }
         return subList;
 
@@ -187,7 +186,7 @@ public class JCRSubscriptionMapper exten
             ((JCRSubscription)subscription).merge(node);
 
         } catch (RepositoryException e) {
-            throw new SubscriptionException(HumanReadableText.SAVE_FAILED, e);
+            throw new SubscriptionException(e);
         }
     }
 

Modified: james/imap/trunk/jpa/pom.xml
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/pom.xml?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/pom.xml (original)
+++ james/imap/trunk/jpa/pom.xml Mon Sep  6 17:19:17 2010
@@ -39,10 +39,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.james</groupId>
-      <artifactId>apache-james-imap-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-mailbox</artifactId>
     </dependency>
     

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailboxManager.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailboxManager.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPAMailboxManager.java Mon Sep  6 17:19:17 2010
@@ -18,10 +18,10 @@
  ****************************************************************/
 package org.apache.james.imap.jpa;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.jpa.mail.model.JPAMailbox;
 import org.apache.james.imap.jpa.user.model.JPASubscription;
 import org.apache.james.imap.mailbox.MailboxException;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.store.Authenticator;
 import org.apache.james.imap.store.StoreMailboxManager;

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPATransactionalMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPATransactionalMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPATransactionalMapper.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/JPATransactionalMapper.java Mon Sep  6 17:19:17 2010
@@ -23,9 +23,7 @@ import javax.persistence.EntityManagerFa
 import javax.persistence.EntityTransaction;
 import javax.persistence.PersistenceException;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.mailbox.MailboxException;
-import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.store.transaction.TransactionalMapper;
 
 /**
@@ -61,7 +59,7 @@ public abstract class JPATransactionalMa
         try {
             getEntityManager().getTransaction().begin();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.START_TRANSACTION_FAILED, e);
+            throw new MailboxException("Begin of transaction failed", e);
         }
     }
 
@@ -72,7 +70,7 @@ public abstract class JPATransactionalMa
         try {
             getEntityManager().getTransaction().commit();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.COMMIT_TRANSACTION_FAILED, e);
+            throw new MailboxException("Commit of transaction failed",e);
         }
     }
 

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMailboxMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMailboxMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMailboxMapper.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMailboxMapper.java Mon Sep  6 17:19:17 2010
@@ -27,14 +27,12 @@ import javax.persistence.NoResultExcepti
 import javax.persistence.PersistenceException;
 import javax.persistence.RollbackException;
 
-import org.apache.james.imap.api.MailboxPath;
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jpa.JPATransactionalMapper;
 import org.apache.james.imap.jpa.mail.model.JPAMailbox;
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MailboxExistsException;
 import org.apache.james.imap.mailbox.MailboxNotFoundException;
-import org.apache.james.imap.mailbox.StorageException;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.store.mail.MailboxMapper;
 import org.apache.james.imap.store.mail.model.Mailbox;
 
@@ -68,26 +66,26 @@ public class JPAMailboxMapper extends JP
                 if (t != null && t instanceof EntityExistsException)
                     throw new MailboxExistsException(lastMailboxName);
             }
-            throw new StorageException(HumanReadableText.COMMIT_TRANSACTION_FAILED, e);
+            throw new MailboxException("Commit of transaction failed", e);
         }
     }
     
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#save(Mailbox)
      */
-    public void save(Mailbox<Long> mailbox) throws StorageException {
+    public void save(Mailbox<Long> mailbox) throws MailboxException {
         try {
             this.lastMailboxName = mailbox.getName();
             getEntityManager().persist(mailbox);
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Save of mailbox " + mailbox.getName() +" failed", e);
         } 
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxByPath(java.lang.String)
      */
-    public Mailbox<Long> findMailboxByPath(MailboxPath mailboxPath) throws StorageException, MailboxNotFoundException {
+    public Mailbox<Long> findMailboxByPath(MailboxPath mailboxPath) throws MailboxException, MailboxNotFoundException {
         try {
             if (mailboxPath.getUser() == null) {
                 return (JPAMailbox) getEntityManager().createNamedQuery("findMailboxByName").setParameter("nameParam", mailboxPath.getName()).setParameter("namespaceParam", mailboxPath.getNamespace()).getSingleResult();
@@ -98,19 +96,19 @@ public class JPAMailboxMapper extends JP
             throw new MailboxNotFoundException(mailboxPath);
             
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of mailbox " + mailboxPath + " failed", e);
         } 
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#delete(Mailbox)
      */
-    public void delete(Mailbox<Long> mailbox) throws StorageException {
+    public void delete(Mailbox<Long> mailbox) throws MailboxException {
         try {  
             getEntityManager().remove(mailbox);
             getEntityManager().createNamedQuery("deleteMessages").setParameter("idParam", mailbox.getMailboxId()).executeUpdate();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+            throw new MailboxException("Delete of mailbox " + mailbox + " failed", e);
         } 
     }
 
@@ -119,7 +117,7 @@ public class JPAMailboxMapper extends JP
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxWithPathLike(org.apache.james.imap.api.MailboxPath)
      */
     @SuppressWarnings("unchecked")
-    public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws StorageException {
+    public List<Mailbox<Long>> findMailboxWithPathLike(MailboxPath path) throws MailboxException {
         try {
             if (path.getUser() == null) {
                 return getEntityManager().createNamedQuery("findMailboxWithNameLike").setParameter("nameParam", SQL_WILDCARD_CHAR + path.getName() + SQL_WILDCARD_CHAR).setParameter("namespaceParam", path.getNamespace()).getResultList();
@@ -127,38 +125,38 @@ public class JPAMailboxMapper extends JP
                 return getEntityManager().createNamedQuery("findMailboxWithNameLikeWithUser").setParameter("nameParam", SQL_WILDCARD_CHAR + path.getName() + SQL_WILDCARD_CHAR).setParameter("namespaceParam", path.getNamespace()).setParameter("userParam", path.getUser()).getResultList();
             }
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of mailbox " + path + " failed", e);
         }
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#deleteAll()
      */
-    public void deleteAll() throws StorageException {
+    public void deleteAll() throws MailboxException {
         try {
             getEntityManager().createNamedQuery("deleteAll").executeUpdate();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+            throw new MailboxException("Delete of mailboxes failed", e);
         } 
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#findMailboxById(long)
      */
-    public Mailbox<Long> findMailboxById(Long mailboxId) throws StorageException, MailboxNotFoundException  {
+    public Mailbox<Long> findMailboxById(Long mailboxId) throws MailboxException, MailboxNotFoundException  {
         try {
             return (JPAMailbox) getEntityManager().createNamedQuery("findMailboxById").setParameter("idParam", mailboxId).getSingleResult();
         } catch (NoResultException e) {
-            throw new MailboxNotFoundException(mailboxId);   
+            throw new MailboxNotFoundException("");   
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of mailbox with id " + mailboxId + " failed", e);
         } 
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MailboxMapper#hasChildren(java.lang.String)
      */
-    public boolean hasChildren(Mailbox<Long> mailbox) throws StorageException,
+    public boolean hasChildren(Mailbox<Long> mailbox) throws MailboxException,
             MailboxNotFoundException {
         final String name = mailbox.getName() + delimiter + SQL_WILDCARD_CHAR; 
         final Long numberOfChildMailboxes;

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMessageMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMessageMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMessageMapper.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/JPAMessageMapper.java Mon Sep  6 17:19:17 2010
@@ -27,7 +27,6 @@ import javax.persistence.LockModeType;
 import javax.persistence.PersistenceException;
 import javax.persistence.Query;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jpa.JPATransactionalMapper;
 import org.apache.james.imap.jpa.mail.model.JPAMailbox;
 import org.apache.james.imap.jpa.mail.model.openjpa.AbstractJPAMailboxMembership;
@@ -36,7 +35,6 @@ import org.apache.james.imap.jpa.mail.mo
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.mailbox.MessageRange;
 import org.apache.james.imap.mailbox.SearchQuery;
-import org.apache.james.imap.mailbox.StorageException;
 import org.apache.james.imap.mailbox.MessageRange.Type;
 import org.apache.james.imap.mailbox.SearchQuery.Criterion;
 import org.apache.james.imap.mailbox.SearchQuery.NumericRange;
@@ -59,7 +57,7 @@ public class JPAMessageMapper extends JP
     /**
      * @see org.apache.james.imap.store.mail.MessageMapper#findInMailbox(org.apache.james.imap.mailbox.MessageRange)
      */
-    public List<MailboxMembership<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set) throws StorageException {
+    public List<MailboxMembership<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set) throws MailboxException {
         try {
             final List<MailboxMembership<Long>> results;
             final long from = set.getUidFrom();
@@ -82,7 +80,7 @@ public class JPAMessageMapper extends JP
             }
             return results;
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of MessageRange " + set + " failed in mailbox " + mailbox, e);
         }
     }
 
@@ -116,7 +114,7 @@ public class JPAMessageMapper extends JP
     /**
      * @see org.apache.james.imap.store.mail.MessageMapper#findMarkedForDeletionInMailbox(org.apache.james.imap.mailbox.MessageRange)
      */
-    public List<MailboxMembership<Long>> findMarkedForDeletionInMailbox(Mailbox<Long> mailbox, final MessageRange set) throws StorageException {
+    public List<MailboxMembership<Long>> findMarkedForDeletionInMailbox(Mailbox<Long> mailbox, final MessageRange set) throws MailboxException {
         try {
             final List<MailboxMembership<Long>> results;
             final long from = set.getUidFrom();
@@ -138,7 +136,7 @@ public class JPAMessageMapper extends JP
             }
             return results;
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of MessageRange " + set + " failed in mailbox " + mailbox, e);
         }
     }
 
@@ -172,22 +170,22 @@ public class JPAMessageMapper extends JP
     /**
      * @see org.apache.james.imap.store.mail.MessageMapper#countMessagesInMailbox()
      */
-    public long countMessagesInMailbox(Mailbox<Long> mailbox) throws StorageException {
+    public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
         try {
             return (Long) getEntityManager().createNamedQuery("countMessagesInMailbox").setParameter("idParam", mailbox.getMailboxId()).getSingleResult();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.COUNT_FAILED, e);
+            throw new MailboxException("Count of messages failed in mailbox " + mailbox, e);
         }
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MessageMapper#countUnseenMessagesInMailbox()
      */
-    public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws StorageException {
+    public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException {
         try {
             return (Long) getEntityManager().createNamedQuery("countUnseenMessagesInMailbox").setParameter("idParam", mailbox.getMailboxId()).getSingleResult();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.COUNT_FAILED, e);
+            throw new MailboxException("Count of useen messages failed in mailbox " + mailbox, e);
         }
     }
 
@@ -199,7 +197,7 @@ public class JPAMessageMapper extends JP
      * @see org.apache.james.imap.store.mail.MessageMapper#searchMailbox(org.apache.james.imap.store.mail.model.Mailbox, org.apache.james.imap.mailbox.SearchQuery)
      */
     @SuppressWarnings("unchecked")
-    public Iterator<Long> searchMailbox(Mailbox<Long> mailbox, SearchQuery query) throws StorageException {
+    public Iterator<Long> searchMailbox(Mailbox<Long> mailbox, SearchQuery query) throws MailboxException {
         try {
             final StringBuilder queryBuilder = new StringBuilder(50);
             queryBuilder.append("SELECT membership FROM Membership membership WHERE membership.mailboxId = ").append(mailbox.getMailboxId());
@@ -244,7 +242,7 @@ public class JPAMessageMapper extends JP
             return new SearchQueryIterator(jQuery.getResultList().iterator(), query);
             
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of messages via the query " + query + " failed in mailbox " + mailbox, e);
         }
     }
 
@@ -252,11 +250,11 @@ public class JPAMessageMapper extends JP
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#delete(java.lang.Object, org.apache.james.imap.store.mail.model.MailboxMembership)
      */
-    public void delete(Mailbox<Long> mailbox, MailboxMembership<Long> message) throws StorageException {
+    public void delete(Mailbox<Long> mailbox, MailboxMembership<Long> message) throws MailboxException {
         try {
             getEntityManager().remove(message);
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.DELETED_FAILED, e);
+            throw new MailboxException("Delete of message " + message + " failed in mailbox " + mailbox, e);
         }
     }
 
@@ -265,7 +263,7 @@ public class JPAMessageMapper extends JP
      * @see org.apache.james.imap.store.mail.MessageMapper#findFirstUnseenMessageUid(org.apache.james.imap.store.mail.model.Mailbox)
      */
     @SuppressWarnings("unchecked")
-    public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox)  throws StorageException {
+    public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox)  throws MailboxException {
         try {
             Query query = getEntityManager().createNamedQuery("findUnseenMessagesInMailboxOrderByUid").setParameter("idParam", mailbox.getMailboxId());
             query.setMaxResults(1);
@@ -276,8 +274,7 @@ public class JPAMessageMapper extends JP
                 return result.get(0).getUid();
             }
         } catch (PersistenceException e) {
-            e.printStackTrace();
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of first unseen message failed in mailbox " + mailbox, e);
         }
     }
 
@@ -285,7 +282,7 @@ public class JPAMessageMapper extends JP
      * @see org.apache.james.imap.store.mail.MessageMapper#findRecentMessagesInMailbox()
      */
     @SuppressWarnings("unchecked")
-    public List<MailboxMembership<Long>> findRecentMessagesInMailbox(Mailbox<Long> mailbox, int limit) throws StorageException {
+    public List<MailboxMembership<Long>> findRecentMessagesInMailbox(Mailbox<Long> mailbox, int limit) throws MailboxException {
         try {
             Query query = getEntityManager().createNamedQuery("findRecentMessagesInMailbox").setParameter("idParam", mailbox.getMailboxId());
             if (limit > 0) {
@@ -293,26 +290,23 @@ public class JPAMessageMapper extends JP
             }
             return query.getResultList();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SEARCH_FAILED, e);
+            throw new MailboxException("Search of recent messages failed in mailbox " + mailbox, e);
         }
     }
 
     /**
      * @see org.apache.james.imap.store.mail.MessageMapper#save(MailboxMembership)
      */
-    public long save(Mailbox<Long> mailbox, MailboxMembership<Long> message) throws StorageException {
+    public long save(Mailbox<Long> mailbox, MailboxMembership<Long> message) throws MailboxException {
         try {
             
             if (message.getUid() == 0) {
-                
                 ((AbstractJPAMailboxMembership) message).setUid(reserveUid((JPAMailbox)mailbox));
             }
-            
-            
             getEntityManager().persist(message);
             return message.getUid();
         } catch (PersistenceException e) {
-            throw new StorageException(HumanReadableText.SAVE_FAILED, e);
+            throw new MailboxException("Save of message " + message + " failed in mailbox " + mailbox, e);
         }
     }
 
@@ -320,18 +314,15 @@ public class JPAMessageMapper extends JP
      * (non-Javadoc)
      * @see org.apache.james.imap.store.mail.MessageMapper#copy(org.apache.james.imap.store.mail.model.Mailbox, org.apache.james.imap.store.mail.model.MailboxMembership)
      */
-    public long copy(Mailbox<Long> mailbox, MailboxMembership<Long> original) throws StorageException {
-        try {
-            MailboxMembership<Long> copy;
-            if (original instanceof JPAStreamingMailboxMembership) {
-                copy = new JPAStreamingMailboxMembership(mailbox.getMailboxId(), (AbstractJPAMailboxMembership) original);
-            } else {
-                copy = new JPAMailboxMembership(mailbox.getMailboxId(), (AbstractJPAMailboxMembership)original);
-            }
-            return save(mailbox, copy);
-        } catch (MailboxException e) {
-            throw new StorageException(e.getKey(),e);
+    public long copy(Mailbox<Long> mailbox, MailboxMembership<Long> original) throws MailboxException {
+
+        MailboxMembership<Long> copy;
+        if (original instanceof JPAStreamingMailboxMembership) {
+            copy = new JPAStreamingMailboxMembership(mailbox.getMailboxId(), (AbstractJPAMailboxMembership) original);
+        } else {
+            copy = new JPAMailboxMembership(mailbox.getMailboxId(), (AbstractJPAMailboxMembership) original);
         }
+        return save(mailbox, copy);
     }
     
     /**

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/JPAMailbox.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/JPAMailbox.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/JPAMailbox.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/JPAMailbox.java Mon Sep  6 17:19:17 2010
@@ -26,7 +26,7 @@ import javax.persistence.Id;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 
-import org.apache.james.imap.api.MailboxPath;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.store.mail.model.Mailbox;
 
 @Entity(name="Mailbox")

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAMailboxMembership.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAMailboxMembership.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAMailboxMembership.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAMailboxMembership.java Mon Sep  6 17:19:17 2010
@@ -29,7 +29,6 @@ import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ManyToOne;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jpa.mail.model.JPAHeader;
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.store.mail.model.Message;
@@ -55,7 +54,7 @@ public class JPAMailboxMembership extend
         try {
             this.message = new JPAMessage(content, size, bodyStartOctet, headers, propertyBuilder);
         } catch (IOException e) {
-            throw new MailboxException(HumanReadableText.FAILURE_MAIL_PARSE,e);
+            throw new MailboxException("Unable to parse message",e);
         }
     }
 
@@ -64,7 +63,7 @@ public class JPAMailboxMembership extend
         try {
             this.message = new JPAMessage((JPAMessage) original.getMessage());
         } catch (IOException e) {
-            throw new MailboxException(HumanReadableText.FAILURE_MAIL_PARSE,e);
+            throw new MailboxException("Unable to parse message",e);
         }
     }
     

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAStreamingMailboxMembership.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAStreamingMailboxMembership.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAStreamingMailboxMembership.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/mail/model/openjpa/JPAStreamingMailboxMembership.java Mon Sep  6 17:19:17 2010
@@ -29,7 +29,6 @@ import javax.persistence.Entity;
 import javax.persistence.FetchType;
 import javax.persistence.ManyToOne;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jpa.mail.model.JPAHeader;
 import org.apache.james.imap.mailbox.MailboxException;
 import org.apache.james.imap.store.mail.model.Message;
@@ -63,7 +62,7 @@ public class JPAStreamingMailboxMembersh
         try {
             this.message = new JPAStreamingMessage(original.getMessage());
         } catch (IOException e) {
-            throw new MailboxException(HumanReadableText.FAILURE_MAIL_PARSE,e);
+            throw new MailboxException("Unable to parse message",e);
         }
     }
     

Modified: james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/user/JPASubscriptionMapper.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/user/JPASubscriptionMapper.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/user/JPASubscriptionMapper.java (original)
+++ james/imap/trunk/jpa/src/main/java/org/apache/james/imap/jpa/user/JPASubscriptionMapper.java Mon Sep  6 17:19:17 2010
@@ -24,7 +24,6 @@ import javax.persistence.EntityManagerFa
 import javax.persistence.NoResultException;
 import javax.persistence.PersistenceException;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 import org.apache.james.imap.jpa.JPATransactionalMapper;
 import org.apache.james.imap.mailbox.SubscriptionException;
 import org.apache.james.imap.store.user.SubscriptionMapper;
@@ -51,7 +50,7 @@ public class JPASubscriptionMapper exten
         } catch (NoResultException e) {
             return null;
         } catch (PersistenceException e) {
-            throw new SubscriptionException(HumanReadableText.SEARCH_FAILED, e);
+            throw new SubscriptionException(e);
         }
     }
 
@@ -63,7 +62,7 @@ public class JPASubscriptionMapper exten
         try {
             getEntityManager().persist(subscription);
         } catch (PersistenceException e) {
-            throw new SubscriptionException(HumanReadableText.SAVE_FAILED, e);
+            throw new SubscriptionException(e);
         }
     }
 
@@ -76,7 +75,7 @@ public class JPASubscriptionMapper exten
         try {
             return (List<Subscription>) getEntityManager().createNamedQuery("findSubscriptionsForUser").setParameter("userParam", user).getResultList();
         } catch (PersistenceException e) {
-            throw new SubscriptionException(HumanReadableText.SEARCH_FAILED, e);
+            throw new SubscriptionException(e);
         }
     }
 
@@ -88,7 +87,7 @@ public class JPASubscriptionMapper exten
         try {
             getEntityManager().remove(subscription);
         } catch (PersistenceException e) {
-            throw new SubscriptionException(HumanReadableText.DELETED_FAILED, e);
+            throw new SubscriptionException(e);
         }
     }
 }

Modified: james/imap/trunk/mailbox/pom.xml
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/pom.xml?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/pom.xml (original)
+++ james/imap/trunk/mailbox/pom.xml Mon Sep  6 17:19:17 2010
@@ -33,11 +33,12 @@
       <groupId>${javax.mail.groupId}</groupId>
       <artifactId>${javax.mail.artifactId}</artifactId>
     </dependency>
-
+    
     <dependency>
-      <groupId>org.apache.james</groupId>
-      <artifactId>apache-james-imap-api</artifactId>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
     </dependency>
+    
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit-dep</artifactId>

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/BadCredentialsException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/BadCredentialsException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/BadCredentialsException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/BadCredentialsException.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
-
 /**
  * Indicates that the credentials for this operation were not acceptable.
  */
@@ -29,11 +27,8 @@ public class BadCredentialsException ext
     private static final long serialVersionUID = -8055692887730696513L;
 
     public BadCredentialsException() {
-        super(HumanReadableText.INVALID_LOGIN);
+        super();
     }
     
-    public BadCredentialsException(HumanReadableText key) {
-        super(key);
-    }
 
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxException.java Mon Sep  6 17:19:17 2010
@@ -21,43 +21,20 @@ package org.apache.james.imap.mailbox;
 
 import javax.mail.MessagingException;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 
 public class MailboxException extends MessagingException {
 
     private static final long serialVersionUID = 4612761817238115904L;
-
-    private final HumanReadableText key;
     
-    public MailboxException(final HumanReadableText key, final String message) {
+    public MailboxException(final String message) {
         super(message);
-        this.key = key;
     }
 
     
-    public MailboxException(final HumanReadableText key) {
-        super(key.toString());
-        this.key = key;
-    }
-
-    public MailboxException(final HumanReadableText key, Exception cause) {
-        super(key.getDefaultValue(), cause);
-        this.key = key;
+    public MailboxException() {
     }
 
-    /**
-     * Gets the message key.
-     * 
-     * @return the key, possibly null
-     */
-    public final HumanReadableText getKey() {
-        final HumanReadableText key;
-        if (this.key == null) {
-            // API specifies not null but best to default to generic message 
-            key = HumanReadableText.GENERIC_FAILURE_DURING_PROCESSING;
-        } else {
-            key = this.key;
-        }
-        return key;
+    public MailboxException(String msg, Exception cause) {
+        super(msg, cause);
     }
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxExistsException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxExistsException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxExistsException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxExistsException.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
-
 /**
  * Indicates that the operation failed since the mailbox already exists.
  */
@@ -31,7 +29,7 @@ public class MailboxExistsException exte
     private final String mailboxName;
 
     public MailboxExistsException(String mailboxName) {
-        super(HumanReadableText.MAILBOX_EXISTS);
+        super();
         this.mailboxName = mailboxName;
     }
 

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxListener.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxListener.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxListener.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxListener.java Mon Sep  6 17:19:17 2010
@@ -23,7 +23,6 @@ import java.util.Iterator;
 
 import javax.mail.Flags;
 
-import org.apache.james.imap.api.MailboxPath;
 
 /**
  * Listens to <code>Mailbox</code> events.

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxManager.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxManager.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxManager.java Mon Sep  6 17:19:17 2010
@@ -22,7 +22,6 @@ package org.apache.james.imap.mailbox;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
-import org.apache.james.imap.api.MailboxPath;
 
 
 /**

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxMetaData.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxMetaData.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxMetaData.java Mon Sep  6 17:19:17 2010
@@ -19,7 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.MailboxPath;
 
 
 /**

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxNotFoundException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxNotFoundException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxNotFoundException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxNotFoundException.java Mon Sep  6 17:19:17 2010
@@ -19,9 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.MailboxPath;
-import org.apache.james.imap.api.display.HumanReadableText;
-
 /**
  * Indicates that the failure is caused by a reference to a mailbox which does
  * not exist.
@@ -30,25 +27,9 @@ public class MailboxNotFoundException ex
 
     private static final long serialVersionUID = -8493370806722264915L;
 
-    private static String message(String mailboxName) {
-        final String result;
-        if (mailboxName == null) {
-            result = "Mailbox not found";
-        } else {
-            result = "Mailbox '" + mailboxName + "' not found.";
-        }
-        return result;
-    }
 
     private final String mailboxName;
 
-    private final long id;
-    
-    public MailboxNotFoundException(long id) {
-        super(HumanReadableText.MAILBOX_NOT_FOUND, message(Long.toString(id)));
-        this.id = id;
-        mailboxName = null;
-    }
     
     /**
      * 
@@ -56,9 +37,7 @@ public class MailboxNotFoundException ex
      *            name of the mailbox, not null
      */
     public MailboxNotFoundException(String mailboxName) {
-        super(HumanReadableText.MAILBOX_NOT_FOUND, message(mailboxName));
         this.mailboxName = mailboxName;
-        this.id = 0;
     }
     
     /**
@@ -66,9 +45,7 @@ public class MailboxNotFoundException ex
      *            name of the mailbox, not null
      */
     public MailboxNotFoundException(MailboxPath mailboxPath) {
-        super(HumanReadableText.MAILBOX_NOT_FOUND, message(mailboxPath.toString()));
         this.mailboxName = mailboxPath.toString();
-        this.id = 0;
     }
 
     /**
@@ -80,11 +57,4 @@ public class MailboxNotFoundException ex
         return mailboxName;
     }
 
-    /**
-     * Gets the storage id of the mailbox.
-     * @return storage id, or zero when this is not known
-     */
-    public long getId() {
-        return id;
-    }
 }

Copied: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxPath.java (from r991286, james/imap/trunk/api/src/main/java/org/apache/james/imap/api/MailboxPath.java)
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxPath.java?p2=james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxPath.java&p1=james/imap/trunk/api/src/main/java/org/apache/james/imap/api/MailboxPath.java&r1=991286&r2=993100&rev=993100&view=diff
==============================================================================
--- james/imap/trunk/api/src/main/java/org/apache/james/imap/api/MailboxPath.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxPath.java Mon Sep  6 17:19:17 2010
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.imap.api;
+package org.apache.james.imap.mailbox;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxQuery.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxQuery.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxQuery.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/MailboxQuery.java Mon Sep  6 17:19:17 2010
@@ -19,7 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.MailboxPath;
 
 /**
  * Expresses select criteria for mailboxes.

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/SubscriptionException.java Mon Sep  6 17:19:17 2010
@@ -19,7 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
 
 /**
  * Indicates exception during subscription processing.
@@ -28,11 +27,11 @@ public class SubscriptionException exten
 
     private static final long serialVersionUID = -4512372322774311468L;
 
-    public SubscriptionException(final HumanReadableText key) {
-        super(key);
+    public SubscriptionException() {
+        super();
     }
 
-    public SubscriptionException(final HumanReadableText key, Exception cause) {
-        super(key, cause);
+    public SubscriptionException(Exception cause) {
+        super(null, cause);
     }
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedCriteriaException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedCriteriaException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedCriteriaException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedCriteriaException.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
-
 /**
  * Indicates that a search criteria is not supported.
  */
@@ -28,8 +26,8 @@ public class UnsupportedCriteriaExceptio
 
     private static final long serialVersionUID = 3791907285083231285L;
 
-    public UnsupportedCriteriaException(final HumanReadableText key) {
-        super(key);
+    public UnsupportedCriteriaException() {
+        super();
     }
 
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedOperationException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedOperationException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedOperationException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedOperationException.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
-
 /**
  * Indicates that an operation required is not supported
  * by this mailbox.
@@ -30,7 +28,7 @@ public class UnsupportedOperationExcepti
     private static final long serialVersionUID = 1943118588115772317L;
 
     public UnsupportedOperationException(String message) {
-        super(HumanReadableText.UNSUPPORTED, message);
+        super(message);
     }
 
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedSearchException.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedSearchException.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedSearchException.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/UnsupportedSearchException.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,6 @@
 
 package org.apache.james.imap.mailbox;
 
-import org.apache.james.imap.api.display.HumanReadableText;
-
 
 /**
  * Indicates that the requested search is not supported by this implementation.
@@ -30,6 +28,6 @@ public class UnsupportedSearchException 
     private static final long serialVersionUID = -7442949630563672557L;
 
     public UnsupportedSearchException() {
-        super(HumanReadableText.UNSUPPORTED_SEARCH);
+        super();
     }
 }

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcher.java Mon Sep  6 17:19:17 2010
@@ -29,8 +29,8 @@ import java.util.concurrent.CopyOnWriteA
 import javax.mail.Flags;
 import javax.mail.Flags.Flag;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxListener;
+import org.apache.james.imap.mailbox.MailboxPath;
 
 /**
  * Helper class to dispatch {@link Event}'s to registerend MailboxListener 

Modified: james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/SimpleMailboxMetaData.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/SimpleMailboxMetaData.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/SimpleMailboxMetaData.java (original)
+++ james/imap/trunk/mailbox/src/main/java/org/apache/james/imap/mailbox/util/SimpleMailboxMetaData.java Mon Sep  6 17:19:17 2010
@@ -19,8 +19,8 @@
 
 package org.apache.james.imap.mailbox.util;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxMetaData;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.StandardMailboxMetaDataComparator;
 
 public class SimpleMailboxMetaData implements MailboxMetaData, Comparable<MailboxMetaData> {

Modified: james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/MailboxExpressionTest.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/MailboxExpressionTest.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/MailboxExpressionTest.java (original)
+++ james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/MailboxExpressionTest.java Mon Sep  6 17:19:17 2010
@@ -21,7 +21,6 @@ package org.apache.james.imap.mailbox;
 
 import static org.junit.Assert.*;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.junit.Test;
 
 public class MailboxExpressionTest {

Modified: james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcherFlagsTest.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcherFlagsTest.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcherFlagsTest.java (original)
+++ james/imap/trunk/mailbox/src/test/java/org/apache/james/imap/mailbox/util/MailboxEventDispatcherFlagsTest.java Mon Sep  6 17:19:17 2010
@@ -25,8 +25,8 @@ import java.util.Iterator;
 
 import javax.mail.Flags;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxListener;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MessageResult;
 import org.jmock.Expectations;
 import org.jmock.Mockery;

Modified: james/imap/trunk/maildir/pom.xml
URL: http://svn.apache.org/viewvc/james/imap/trunk/maildir/pom.xml?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/maildir/pom.xml (original)
+++ james/imap/trunk/maildir/pom.xml Mon Sep  6 17:19:17 2010
@@ -54,10 +54,6 @@
     </dependency>
     <dependency>
       <groupId>org.apache.james</groupId>
-      <artifactId>apache-james-imap-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.james</groupId>
       <artifactId>apache-james-imap-mailbox</artifactId>
     </dependency>
     <dependency>

Modified: james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirMailboxManager.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirMailboxManager.java?rev=993100&r1=993099&r2=993100&view=diff
==============================================================================
--- james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirMailboxManager.java (original)
+++ james/imap/trunk/maildir/src/main/java/org/apache/james/imap/maildir/MaildirMailboxManager.java Mon Sep  6 17:19:17 2010
@@ -18,8 +18,8 @@
  ****************************************************************/
 package org.apache.james.imap.maildir;
 
-import org.apache.james.imap.api.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxException;
+import org.apache.james.imap.mailbox.MailboxPath;
 import org.apache.james.imap.mailbox.MailboxSession;
 import org.apache.james.imap.mailbox.util.MailboxEventDispatcher;
 import org.apache.james.imap.maildir.mail.model.MaildirMailbox;



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