You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by jo...@apache.org on 2006/11/06 14:39:55 UTC

svn commit: r471730 - in /james/server/trunk/src: java/org/apache/james/imapserver/ java/org/apache/james/imapserver/commands/ java/org/apache/james/mailboxmanager/ java/org/apache/james/mailboxmanager/mailbox/ java/org/apache/james/mailboxmanager/mana...

Author: joachim
Date: Mon Nov  6 05:39:53 2006
New Revision: 471730

URL: http://svn.apache.org/viewvc?view=rev&rev=471730
Log:
- moved BasicMailbox methods to Mailbox
- moved BasicManager methods to MailboxManagerProvider
- moved GeneralManager methods to MailboxManager
- moved getName() and getMessageCount() from GeneralMailbox to Mailbox
- MailboxManagerException extends MessagingException

Added:
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/AbstractGeneralMailbox.java
Removed:
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/BasicMailbox.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/BasicMailboxSession.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/BasicManager.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/GeneralManager.java
Modified:
    james/server/trunk/src/java/org/apache/james/imapserver/ImapSession.java
    james/server/trunk/src/java/org/apache/james/imapserver/ImapSessionImpl.java
    james/server/trunk/src/java/org/apache/james/imapserver/commands/AppendCommand.java
    james/server/trunk/src/java/org/apache/james/imapserver/commands/SelectCommand.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/MailboxManagerException.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/Mailbox.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/MailboxSession.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManager.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManagerProvider.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/repository/MailboxManagerMailRepository.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerProvider.java
    james/server/trunk/src/java/org/apache/james/mailboxmanager/wrapper/NumberStableSessionWrapper.java
    james/server/trunk/src/test/org/apache/james/imapserver/handler/session/AbstractSessionTest.java
    james/server/trunk/src/test/org/apache/james/imapserver/util/ImapServerLauncher.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractImapMailboxSelfTestCase.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/AbstractMailboxRowTestCase.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueImapMailboxSelfTestCase.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerSelfTestCase.java
    james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/repository/TorqueMailboxManagerMailRepositoryNativeTestCase.java

Modified: james/server/trunk/src/java/org/apache/james/imapserver/ImapSession.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/imapserver/ImapSession.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/imapserver/ImapSession.java (original)
+++ james/server/trunk/src/java/org/apache/james/imapserver/ImapSession.java Mon Nov  6 05:39:53 2006
@@ -22,7 +22,7 @@
 import org.apache.james.imapserver.store.MailboxException;
 import org.apache.james.mailboxmanager.MailboxManagerException;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.services.User;
 import org.apache.james.services.UsersRepository;
 
@@ -118,7 +118,7 @@
      */
     void closeMailbox();
 
-    GeneralManager getMailboxManager() throws MailboxManagerException;
+    MailboxManager getMailboxManager() throws MailboxManagerException;
 
     String buildFullName(String mailboxName) throws MailboxManagerException;
 

Modified: james/server/trunk/src/java/org/apache/james/imapserver/ImapSessionImpl.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/imapserver/ImapSessionImpl.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/imapserver/ImapSessionImpl.java (original)
+++ james/server/trunk/src/java/org/apache/james/imapserver/ImapSessionImpl.java Mon Nov  6 05:39:53 2006
@@ -27,7 +27,7 @@
 import org.apache.james.mailboxmanager.MailboxManagerException;
 import org.apache.james.mailboxmanager.MessageResult;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.mailboxmanager.manager.MailboxManagerProvider;
 import org.apache.james.services.User;
 import org.apache.james.services.UsersRepository;
@@ -49,7 +49,7 @@
     private MailboxManagerProvider mailboxManagerProvider;
     private UsersRepository users;
     
-    private GeneralManager mailboxManager = null;
+    private MailboxManager mailboxManager = null;
     private User mailboxManagerUser = null;
     
     public ImapSessionImpl( MailboxManagerProvider mailboxManagerProvider,
@@ -192,7 +192,7 @@
 
 
 
-    public GeneralManager getMailboxManager() throws MailboxManagerException {
+    public MailboxManager getMailboxManager() throws MailboxManagerException {
         final boolean usersEqual;
         if (mailboxManagerUser!=null) {
             usersEqual=mailboxManagerUser.equals(user);
@@ -203,7 +203,7 @@
             if (mailboxManager!=null) {
                 mailboxManager.close();
             }
-            mailboxManager=mailboxManagerProvider.getGeneralManagerInstance(user);
+            mailboxManager=mailboxManagerProvider.getMailboxManagerInstance(user);
         }
         return mailboxManager;
     }

Modified: james/server/trunk/src/java/org/apache/james/imapserver/commands/AppendCommand.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/imapserver/commands/AppendCommand.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/imapserver/commands/AppendCommand.java (original)
+++ james/server/trunk/src/java/org/apache/james/imapserver/commands/AppendCommand.java Mon Nov  6 05:39:53 2006
@@ -69,7 +69,7 @@
         ImapMailboxSession mailbox = null;
         try {
             mailboxName=session.buildFullName(mailboxName);
-            mailbox = (ImapMailboxSession) session.getMailboxManager().getGenericGeneralMailboxSession(mailboxName);
+            mailbox = session.getMailboxManager().getImapMailboxSession(mailboxName);
         }
         catch ( MailboxManagerException mme ) {
             MailboxException me = new MailboxException(mme);

Modified: james/server/trunk/src/java/org/apache/james/imapserver/commands/SelectCommand.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/imapserver/commands/SelectCommand.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/imapserver/commands/SelectCommand.java (original)
+++ james/server/trunk/src/java/org/apache/james/imapserver/commands/SelectCommand.java Mon Nov  6 05:39:53 2006
@@ -84,7 +84,7 @@
     }
 
     private boolean selectMailbox(String mailboxName, ImapSession session, boolean readOnly) throws MailboxException, MailboxManagerException {
-        ImapMailboxSession mailbox = session.getMailboxManager().getGenericImapMailboxSession(mailboxName);
+        ImapMailboxSession mailbox = session.getMailboxManager().getImapMailboxSession(mailboxName);
 
         if ( !mailbox.isSelectable() ) {
             throw new MailboxException( "Nonselectable mailbox." );

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/MailboxManagerException.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/MailboxManagerException.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/MailboxManagerException.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/MailboxManagerException.java Mon Nov  6 05:39:53 2006
@@ -19,7 +19,9 @@
 
 package org.apache.james.mailboxmanager;
 
-public class MailboxManagerException extends Exception {
+import javax.mail.MessagingException;
+
+public class MailboxManagerException extends MessagingException {
 
     private static final long serialVersionUID = -7034955921835169361L;
 

Added: james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/AbstractGeneralMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/AbstractGeneralMailbox.java?view=auto&rev=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/AbstractGeneralMailbox.java (added)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/AbstractGeneralMailbox.java Mon Nov  6 05:39:53 2006
@@ -0,0 +1,56 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.mailboxmanager.mailbox;
+
+import java.util.Collection;
+
+import javax.mail.internet.MimeMessage;
+
+import org.apache.james.mailboxmanager.MailboxManagerException;
+import org.apache.james.mailboxmanager.util.AbstractLogEnabled;
+
+public abstract class AbstractGeneralMailbox extends AbstractLogEnabled implements Mailbox {
+
+    public Collection list() throws MailboxManagerException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void remove(String key) throws MailboxManagerException {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public MimeMessage retrieve(String key) throws MailboxManagerException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String store(MimeMessage message) throws MailboxManagerException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String update(String key, MimeMessage message) throws MailboxManagerException {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/GeneralMailbox.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.mailbox;
 
 import java.util.Date;
@@ -8,7 +27,7 @@
 import org.apache.james.mailboxmanager.MailboxManagerException;
 import org.apache.james.mailboxmanager.MessageResult;
 
-public interface GeneralMailbox {
+public interface GeneralMailbox extends Mailbox {
     
     /**
      * 
@@ -24,17 +43,7 @@
      */
     int getMessageSetTypes();
     
-    /**
-     * Example #mail.paul.lists.apache.james-dev (3rd level folder of user paul)
-     * 
-     * @return Full folder name with namespace
-     * @throws MailboxManagerException 
-     */
-
-    String getName() throws MailboxManagerException;
-
-    int getMessageCount() throws MailboxManagerException;
-    
+ 
 
     /**
      * @param internalDate

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/Mailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/Mailbox.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/Mailbox.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/Mailbox.java Mon Nov  6 05:39:53 2006
@@ -1,5 +1,61 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.mailbox;
 
+import java.util.Collection;
+
+import javax.mail.internet.MimeMessage;
+
+import org.apache.james.mailboxmanager.MailboxManagerException;
+
 public interface Mailbox {
+
+    /**
+     * Example #mail.paul.lists.apache.james-dev (3rd level folder of user paul)
+     * 
+     * @return Full folder name with namespace
+     * @throws MailboxManagerException
+     */
+
+    String getName() throws MailboxManagerException;
+
+    int getMessageCount() throws MailboxManagerException;
+
+    /** @return the key */
+    String store(MimeMessage message) throws MailboxManagerException;
+
+    /** @return keys */
+    Collection list() throws MailboxManagerException;
+
+    MimeMessage retrieve(String key) throws MailboxManagerException;
+
+    /**
+     * key changes by updating
+     * 
+     * @param key
+     *            the current key
+     * @return the new key
+     */
+    String update(String key, MimeMessage message)
+            throws MailboxManagerException;
+
+    void remove(String key) throws MailboxManagerException;
 
 }

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/MailboxSession.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/MailboxSession.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/MailboxSession.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/mailbox/MailboxSession.java Mon Nov  6 05:39:53 2006
@@ -1,10 +1,28 @@
-package org.apache.james.mailboxmanager.mailbox;
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
 
+package org.apache.james.mailboxmanager.mailbox;
 
 public interface MailboxSession extends Mailbox {
 
-    public void close();
-    
-    public boolean isWriteable();
-    
+    void close();
+
+    boolean isWriteable();
+
 }

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManager.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManager.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManager.java Mon Nov  6 05:39:53 2006
@@ -1,5 +1,165 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.manager;
 
+import org.apache.james.mailboxmanager.GeneralMessageSet;
+import org.apache.james.mailboxmanager.ListResult;
+import org.apache.james.mailboxmanager.MailboxManagerException;
+import org.apache.james.mailboxmanager.Namespace;
+import org.apache.james.mailboxmanager.Namespaces;
+import org.apache.james.mailboxmanager.mailbox.GeneralMailbox;
+import org.apache.james.mailboxmanager.mailbox.GeneralMailboxSession;
+import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
+import org.apache.james.mailboxmanager.mailbox.MailboxSession;
+import org.apache.james.services.User;
+
+
+/**
+ * <p>
+ * Central MailboxManager which creates, lists, provides, renames and
+ * deletes Mailboxes
+ * </p>
+ * <p>
+ * An important goal is to be JavaMail feature compatible. That means JavaMail
+ * could be used in both directions: As a backend for e.g. accessing a Maildir
+ * JavaMail store or as a frontend to access a JDBC MailboxManager
+ * through JavaMail. This should be possible by not too complicated wrapper
+ * classes. Due to the complexity of JavaMail it might be impossible to avoid
+ * some limitations.
+ * </p>
+ * <p>
+ * Internally MailboxManager deals with named repositories that could have
+ * different implementations. E.g. JDBC connections to different hosts or
+ * Maildir / Mbox like stores. This repositories are identified by its names and
+ * maybe are configured in config.xml. The names of the mailboxes have to be
+ * mapped to the corresponding repository name. For user mailboxes this could be
+ * done by a "User.getRepositoryName()" property. It is imaginable that
+ * repositories lookup further properties from the user object like a path name
+ * for a file based storage method. Until Milestone 6 there is only one named
+ * repository: "default".
+ * </p>
+ * <p>
+ * The only operation that requires dealing with the named repositories directly
+ * is the quota management. It is probably really difficult to implement a quota
+ * system that spans multiple repository implementations. That is why quotas are
+ * created for a specific repository. To be able to administer, repositories and
+ * theier belonging mailboxes can be listet.
+ * </p>
+ */
+
 public interface MailboxManager {
 
+    /**
+     * get a session mailbox 
+     * 
+     * @param nameSpaceName
+     * @param user
+     * @return
+     * @throws MailboxManagerException 
+     */
+    MailboxSession getMailboxSession(String mailboxName) throws MailboxManagerException;
+    
+    /**
+     * Supports 
+     * 
+     * @param mailboxName
+     * @return
+     * @throws MailboxManagerException
+     */
+    
+    GeneralMailboxSession getGeneralMailboxSession(String mailboxName) throws MailboxManagerException;
+    
+    ImapMailboxSession getImapMailboxSession(String mailboxName) throws MailboxManagerException;
+
+    /**
+     * The Namespaces a user has access to.
+     * @param forUser TODO
+     * @param user
+     * 
+     * @return
+     */
+    Namespaces getNamespaces(User forUser);
+
+    /**
+     * To get the Inbox you can just to a mailbox
+     * defaultNameSpace=ImapMailboxRepository.getPersonalDefaultNameSpace(user)
+     * inbox=defaultNameSpace.getName()+defaultNameSpace.getHierarchyDelimter()+"INBOX";
+     * TODO add a convinience method to get directly a session mailbox for a users inbox
+     * @param forUser TODO
+     * 
+     * @return
+     */
+    Namespace getPersonalDefaultNamespace(User forUser);
+    
+    
+
+    void createMailbox(String mailboxName) throws MailboxManagerException;
+
+    void deleteMailbox(String mailboxName) throws MailboxManagerException;
+
+    void renameMailbox(String from, String to) throws MailboxManagerException;
+
+    /**
+     * this is done by the MailboxRepository because maybe this operation could
+     * be optimized in the corresponding store.
+     * 
+     * @param from
+     * @param set
+     *            messages to copy
+     * @param to
+     *            name of the destination mailbox
+     */
+    void copyMessages(GeneralMailbox from, GeneralMessageSet set, String to) throws MailboxManagerException;
+
+    /**
+     * 
+     * @param base
+     *            hierarchy starting point like #mail.user1 to list mailboxes of
+     *            user1
+     * @param expression
+     *            allows the use of wildcards
+     * @param subscribed
+     *            if true, only list subscribed mailboxes (needs interaction
+     *            with the user-object)
+     * @param user
+     * @return
+     * @throws MailboxManagerException 
+     */
+
+    ListResult[] list(String base, String expression, boolean subscribed) throws MailboxManagerException;
+
+    /**
+     * could be implemented later. There could be enviroments where
+     * subscribtions are stored in the mailbox database. Another possibility is
+     * to manage subscribtions in the user repository, e.g. a ldap attribute,
+     * 
+     * @param mailboxName
+     * @param value
+     * @param user
+     */
+
+    void setSubscription(String mailboxName, boolean value) throws MailboxManagerException;
+
+    boolean existsMailbox(String mailboxName) throws MailboxManagerException;
+
+    void close();
+
 }
+

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManagerProvider.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManagerProvider.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManagerProvider.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/manager/MailboxManagerProvider.java Mon Nov  6 05:39:53 2006
@@ -1,14 +1,56 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.manager;
 
 import org.apache.james.mailboxmanager.MailboxManagerException;
+import org.apache.james.mailboxmanager.mailbox.MailboxSession;
 import org.apache.james.services.User;
 
 public interface MailboxManagerProvider {
     
-    public MailboxManager getMailboxManagerInstance(User user, Class neededClass) throws MailboxManagerException;
+    public MailboxManager getMailboxManagerInstance(User user) throws MailboxManagerException;
+ 
+
+    /**
+     * <b>WARNING</b> this really deletes everything. Useful for testing
+     * 
+     * @throws MailboxManagerException
+     */
+    public void deleteEverything() throws MailboxManagerException;
     
-    public GeneralManager getGeneralManagerInstance(User user) throws MailboxManagerException;
+    MailboxSession getInboxSession(User user);
+
+    /** @param authUser the authorized User for checking credentials 
+        @param mailboxName a logical/hierarchical mailbox name **/ 
+
+    MailboxSession getMailboxSession(
+         User authUser, String mailboxName);
     
-    public void deleteEverything() throws MailboxManagerException;
+    /**
+     * removes all data (mailboxes, quota, acls...) that is associated 
+     * with this user.
+     * 
+     * @param authUser the authorized User for checking credentials 
+     * @param targetUser the user whos data will be deleted
+     */
+    
+    void deleteAllUserData(User authUser,User targetUser);
 
 }

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/repository/MailboxManagerMailRepository.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/repository/MailboxManagerMailRepository.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/repository/MailboxManagerMailRepository.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/repository/MailboxManagerMailRepository.java Mon Nov  6 05:39:53 2006
@@ -46,7 +46,7 @@
 import org.apache.james.mailboxmanager.mailbox.FlaggedMailbox;
 import org.apache.james.mailboxmanager.mailbox.MailboxSession;
 import org.apache.james.mailboxmanager.mailbox.UidMailbox;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.mailboxmanager.manager.MailboxManagerProvider;
 import org.apache.james.services.User;
 import org.apache.james.userrepository.DefaultJamesUser;
@@ -66,7 +66,7 @@
      */
     private UidToKeyBidiMap uidToKeyBidiMap = null;
 
-    private GeneralManager mailboxManager;
+    private MailboxManager mailboxManager;
 
     private MailboxGateKeeper mailboxGateKeeper;
 
@@ -391,7 +391,7 @@
 
                 String inbox=ns.getName() + ns.getHierarchyDelimter()+ "INBOX";
                 mailbox = getMailboxManager()
-                        .getGenericImapMailboxSession(inbox);
+                        .getImapMailboxSession(inbox);
             }
             return mailbox;
         }
@@ -402,14 +402,14 @@
      * 
      */
     
-    protected GeneralManager getMailboxManager() throws MessagingException,
+    protected MailboxManager getMailboxManager() throws MessagingException,
             MailboxManagerException {
         if (mailboxManager == null) {
             if (user == null) {
                 throw new MessagingException("user is null");
             }
             mailboxManager = getMailboxManagerProvider()
-                    .getGeneralManagerInstance(user);
+                    .getMailboxManagerInstance(user);
         }
         return mailboxManager;
     }

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailbox.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
 import java.io.ByteArrayOutputStream;
@@ -14,7 +33,6 @@
 import javax.mail.search.SearchTerm;
 
 import org.apache.commons.logging.Log;
-import org.apache.commons.logging.impl.SimpleLog;
 import org.apache.james.mailboxmanager.GeneralMessageSet;
 import org.apache.james.mailboxmanager.MailboxListener;
 import org.apache.james.mailboxmanager.MailboxManagerException;
@@ -22,6 +40,7 @@
 import org.apache.james.mailboxmanager.impl.GeneralMessageSetImpl;
 import org.apache.james.mailboxmanager.impl.MailboxEventDispatcher;
 import org.apache.james.mailboxmanager.impl.MessageResultImpl;
+import org.apache.james.mailboxmanager.mailbox.AbstractGeneralMailbox;
 import org.apache.james.mailboxmanager.mailbox.ImapMailbox;
 import org.apache.james.mailboxmanager.torque.om.MailboxRow;
 import org.apache.james.mailboxmanager.torque.om.MailboxRowPeer;
@@ -41,7 +60,7 @@
 import com.sun.mail.util.CRLFOutputStream;
 import com.workingdogs.village.DataSetException;
 
-public class TorqueMailbox implements ImapMailbox {
+public class TorqueMailbox extends AbstractGeneralMailbox implements ImapMailbox {
 
     private boolean open = true;
 
@@ -53,10 +72,8 @@
 
     private MailboxEventDispatcher eventDispatcher = new MailboxEventDispatcher();
     
-    protected Log log;
-
     TorqueMailbox(MailboxRow mailboxRow, UidChangeTracker tracker, Log log) {
-        this.log=log;
+        setLog(log);
         this.mailboxRow = mailboxRow;
         this.tracker = tracker;
         tracker.addMailboxListener(getEventDispatcher());
@@ -505,13 +522,6 @@
         return tracker;
     }
     
-    protected Log getLog() {
-        if (log==null) {
-            log=new SimpleLog("TorqueMailbox");
-        }
-        return log;
-    }
-
     protected MailboxRow getMailboxRow() {
         return mailboxRow;
     }

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManager.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
 import java.util.Iterator;
@@ -19,7 +38,7 @@
 import org.apache.james.mailboxmanager.mailbox.GeneralMailboxSession;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
 import org.apache.james.mailboxmanager.mailbox.MailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.mailboxmanager.torque.om.MailboxRow;
 import org.apache.james.mailboxmanager.torque.om.MailboxRowPeer;
 import org.apache.james.mailboxmanager.tracking.MailboxCache;
@@ -30,7 +49,7 @@
 import org.apache.torque.util.CountHelper;
 import org.apache.torque.util.Criteria;
 
-public class TorqueMailboxManager implements GeneralManager {
+public class TorqueMailboxManager implements MailboxManager {
     
     public static final char HIERARCHY_DELIMITER='.';
     
@@ -49,17 +68,19 @@
         this.log=log;
     }
     
-    public MailboxSession getMailboxSession(String mailboxName, Class neededInterface, int[] setTypes,int resultTypes)
+    public MailboxSession getMailboxSession(String mailboxName)
     throws MailboxManagerException {
-        return getGenericImapMailboxSession(mailboxName);
+        return getImapMailboxSession(mailboxName);
     }
+    
+
 
-    public GeneralMailboxSession getGenericGeneralMailboxSession(String mailboxName)
+    public GeneralMailboxSession getGeneralMailboxSession(String mailboxName)
     throws MailboxManagerException {
-        return getGenericImapMailboxSession(mailboxName);
+        return getImapMailboxSession(mailboxName);
     }
     
-    public ImapMailboxSession getGenericImapMailboxSession(String mailboxName)
+    public ImapMailboxSession getImapMailboxSession(String mailboxName)
             throws MailboxManagerException {
         
         // prepare to auto-create users Inbox
@@ -202,7 +223,7 @@
     }
 
     public void copyMessages(GeneralMailbox from, GeneralMessageSet set, String to) throws MailboxManagerException {
-        GeneralMailboxSession toMailbox=(GeneralMailboxSession)getMailboxSession(to,GeneralMailboxSession.class, new int[0],MessageResult.NOTHING);
+        GeneralMailboxSession toMailbox=(GeneralMailboxSession)getGeneralMailboxSession(to);
         
         MessageResult[] mr=from.getMessages(set, MessageResult.MIME_MESSAGE | MessageResult.INTERNAL_DATE);
         for (int i = 0; i < mr.length; i++) {

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerProvider.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerProvider.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerProvider.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerProvider.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
 import java.io.File;
@@ -22,7 +41,7 @@
 import org.apache.commons.logging.impl.AvalonLogger;
 import org.apache.commons.logging.impl.SimpleLog;
 import org.apache.james.mailboxmanager.MailboxManagerException;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.mailbox.MailboxSession;
 import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.mailboxmanager.manager.MailboxManagerProvider;
 import org.apache.james.mailboxmanager.torque.om.MailboxRowPeer;
@@ -53,11 +72,8 @@
 
     private static final String[] tableNames= new String[] {MailboxRowPeer.TABLE_NAME,MessageRowPeer.TABLE_NAME,MessageHeaderPeer.TABLE_NAME,MessageBodyPeer.TABLE_NAME,MessageFlagsPeer.TABLE_NAME};
 
-    public MailboxManager getMailboxManagerInstance(User user,Class neededClass)
-            throws MailboxManagerException {
-     return getGeneralManagerInstance(user);
-    }
-    public GeneralManager getGeneralManagerInstance(User user)             throws MailboxManagerException {
+
+    public MailboxManager getMailboxManagerInstance(User user)         throws MailboxManagerException {
         if (!initialized)  {
             throw new MailboxManagerException("must be initialized first!");
         }
@@ -173,7 +189,7 @@
     }
 
     public void deleteEverything() throws MailboxManagerException {
-        ((TorqueMailboxManager) getMailboxManagerInstance(null,TorqueMailboxManager.class))
+        ((TorqueMailboxManager) getMailboxManagerInstance(null))
                 .deleteEverything();
         mailboxCache=null;
     }
@@ -205,6 +221,19 @@
     
     protected void setFileSystem(FileSystem system) {
         this.fileSystem = system;
+    }
+    public void deleteAllUserData(User authUser, User targetUser) {
+        // TODO Auto-generated method stub
+        
+    }
+    public MailboxSession getInboxSession(User user) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public MailboxSession getMailboxSession(User authUser, String mailboxName) {
+        // TODO Auto-generated method stub
+        return null;
     }
     
 

Modified: james/server/trunk/src/java/org/apache/james/mailboxmanager/wrapper/NumberStableSessionWrapper.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/java/org/apache/james/mailboxmanager/wrapper/NumberStableSessionWrapper.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/java/org/apache/james/mailboxmanager/wrapper/NumberStableSessionWrapper.java (original)
+++ james/server/trunk/src/java/org/apache/james/mailboxmanager/wrapper/NumberStableSessionWrapper.java Mon Nov  6 05:39:53 2006
@@ -1,9 +1,27 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.wrapper;
 
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.TreeSet;
@@ -15,12 +33,12 @@
 import org.apache.james.mailboxmanager.impl.GeneralMessageSetImpl;
 import org.apache.james.mailboxmanager.impl.MailboxEventDispatcher;
 import org.apache.james.mailboxmanager.impl.MessageResultImpl;
+import org.apache.james.mailboxmanager.mailbox.AbstractGeneralMailbox;
 import org.apache.james.mailboxmanager.mailbox.EventQueueingSessionMailbox;
 import org.apache.james.mailboxmanager.mailbox.EventTriggerMailbox;
 import org.apache.james.mailboxmanager.mailbox.GeneralMailbox;
-import org.apache.james.mailboxmanager.util.AbstractLogEnabled;
 
-public class NumberStableSessionWrapper extends AbstractLogEnabled implements EventQueueingSessionMailbox,
+public abstract class NumberStableSessionWrapper extends AbstractGeneralMailbox implements EventQueueingSessionMailbox,
         MailboxListener {
 
     protected GeneralMailbox mailbox;

Modified: james/server/trunk/src/test/org/apache/james/imapserver/handler/session/AbstractSessionTest.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/imapserver/handler/session/AbstractSessionTest.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/imapserver/handler/session/AbstractSessionTest.java (original)
+++ james/server/trunk/src/test/org/apache/james/imapserver/handler/session/AbstractSessionTest.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.imapserver.handler.session;
 
 import java.io.BufferedReader;
@@ -36,12 +55,12 @@
 import org.apache.james.mailboxmanager.impl.GeneralMessageSetImpl;
 import org.apache.james.mailboxmanager.mailbox.GeneralMailboxSession;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.jmock.MockObjectTestCase;
 
 public abstract class AbstractSessionTest extends MockObjectTestCase implements TestConstants {
     
-    GeneralManager mailboxManager;
+    MailboxManager mailboxManager;
     
     private ImapRequestHandler handler;
     private ImapSession session;
@@ -60,7 +79,7 @@
                 theConfigData.getUsersRepository(), new MockImapHandler(),
                 HOST_NAME, HOST_ADDRESS);
         handler = new ImapRequestHandler();
-        mailboxManager=theConfigData.getMailboxManagerProvider().getGeneralManagerInstance(new MockUser());
+        mailboxManager=theConfigData.getMailboxManagerProvider().getMailboxManagerInstance(new MockUser());
 
     }
     
@@ -249,7 +268,7 @@
     private ImapMailboxSession getImapMailboxSession(String mailboxName) throws MailboxManagerException {
         int[] neededSets = new int[] {GeneralMessageSet.TYPE_UID};
         int neededResults= MessageResult.UID + MessageResult.MIME_MESSAGE + MessageResult.FLAGS;
-        ImapMailboxSession mailboxSession= (ImapMailboxSession) mailboxManager.getMailboxSession(mailboxName, ImapMailboxSession.class, neededSets, neededResults);
+        ImapMailboxSession mailboxSession= mailboxManager.getImapMailboxSession(mailboxName);
         return mailboxSession;
     }
 }

Modified: james/server/trunk/src/test/org/apache/james/imapserver/util/ImapServerLauncher.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/imapserver/util/ImapServerLauncher.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/imapserver/util/ImapServerLauncher.java (original)
+++ james/server/trunk/src/test/org/apache/james/imapserver/util/ImapServerLauncher.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.imapserver.util;
 
 import java.io.IOException;
@@ -11,7 +30,6 @@
 import org.apache.james.imapserver.mock.MockImapHandlerConfigurationData;
 import org.apache.james.imapserver.mock.MockWatchdog;
 import org.apache.james.mailboxmanager.MailboxManagerException;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
 import org.apache.james.test.mock.avalon.MockLogger;
 
 public class ImapServerLauncher  implements TestConstants 

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractImapMailboxSelfTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractImapMailboxSelfTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractImapMailboxSelfTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractImapMailboxSelfTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager;
 
 import java.util.Date;
@@ -11,11 +30,11 @@
 import org.apache.james.mailboxmanager.impl.GeneralMessageSetImpl;
 import org.apache.james.mailboxmanager.impl.MailboxListenerCollector;
 import org.apache.james.mailboxmanager.mailbox.ImapMailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 
 public abstract class AbstractImapMailboxSelfTestCase extends TestCase {
     
-    protected GeneralManager mailboxManager;
+    protected MailboxManager mailboxManager;
     
     protected ImapMailboxSession mailbox;
     
@@ -26,7 +45,7 @@
     public void setUp() throws Exception {
         super.setUp();
         mailboxManager.createMailbox(INBOX);
-        mailbox=mailboxManager.getGenericImapMailboxSession(INBOX);
+        mailbox=mailboxManager.getImapMailboxSession(INBOX);
         collector=new MailboxListenerCollector();
         mailbox.addListener(collector, 0);
         assertNotNull(mailbox);

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/AbstractMailboxManagerSelfTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager;
 
 import java.util.HashSet;
@@ -5,13 +24,13 @@
 import java.util.Set;
 
 import org.apache.james.mailboxmanager.mailbox.GeneralMailboxSession;
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 
 import junit.framework.TestCase;
 
 public abstract class AbstractMailboxManagerSelfTestCase extends TestCase {
     
-    protected GeneralManager mailboxManager;
+    protected MailboxManager mailboxManager;
     
     
     public void testCreateList() throws MailboxManagerException {
@@ -36,7 +55,7 @@
     
     public void testGetSessionMailbox() throws MailboxManagerException {
         mailboxManager.createMailbox("#users.joachim3.INBOX");
-        GeneralMailboxSession sessionMailbox=mailboxManager.getGenericGeneralMailboxSession("#users.joachim3.INBOX");
+        GeneralMailboxSession sessionMailbox=mailboxManager.getGeneralMailboxSession("#users.joachim3.INBOX");
         assertNotNull(sessionMailbox);
     }
     

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/AbstractMailboxRowTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/AbstractMailboxRowTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/AbstractMailboxRowTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/AbstractMailboxRowTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,6 +1,25 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
-import org.apache.james.mailboxmanager.manager.GeneralManager;
+import org.apache.james.mailboxmanager.manager.MailboxManager;
 import org.apache.james.mailboxmanager.mock.MockUser;
 import org.apache.james.mailboxmanager.mock.TorqueMailboxManagerProviderSingleton;
 import org.apache.james.mailboxmanager.torque.om.MailboxRowPeer;
@@ -9,7 +28,7 @@
 
 public abstract class AbstractMailboxRowTestCase extends AbstractTorqueTestCase {
 
-    GeneralManager mm;
+    MailboxManager mm;
     
     public AbstractMailboxRowTestCase() throws TorqueException {
         super();
@@ -17,7 +36,7 @@
     public void setUp() throws Exception {
         super.setUp();
         assertEquals(0,MailboxRowPeer.doSelect(new Criteria()).size());
-        mm=TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance().getGeneralManagerInstance(new MockUser());
+        mm=TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance().getMailboxManagerInstance(new MockUser());
     }
     public void tearDown() {
         

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueImapMailboxSelfTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueImapMailboxSelfTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueImapMailboxSelfTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueImapMailboxSelfTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
 import javax.mail.MessagingException;
@@ -19,7 +38,7 @@
     public void setUp() throws Exception {
         MailboxManagerProvider mailboxManagerProvider=TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance();
         mailboxManagerProvider.deleteEverything();
-        mailboxManager = mailboxManagerProvider .getGeneralManagerInstance(new MockUser());
+        mailboxManager = mailboxManagerProvider .getMailboxManagerInstance(new MockUser());
         
         super.setUp();
     }

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerSelfTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerSelfTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerSelfTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/TorqueMailboxManagerSelfTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,9 +1,27 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque;
 
 import org.apache.james.mailboxmanager.AbstractMailboxManagerSelfTestCase;
 import org.apache.james.mailboxmanager.mock.MockUser;
 import org.apache.james.mailboxmanager.mock.TorqueMailboxManagerProviderSingleton;
-import org.apache.torque.Torque;
 import org.apache.torque.TorqueException;
 
 public class TorqueMailboxManagerSelfTestCase extends
@@ -15,7 +33,7 @@
 
     public void setUp() throws Exception {
         TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance().deleteEverything();
-        mailboxManager = TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance().getGeneralManagerInstance(new MockUser());
+        mailboxManager = TorqueMailboxManagerProviderSingleton.getTorqueMailboxManagerProviderInstance().getMailboxManagerInstance(new MockUser());
     }
 
 }

Modified: james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/repository/TorqueMailboxManagerMailRepositoryNativeTestCase.java
URL: http://svn.apache.org/viewvc/james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/repository/TorqueMailboxManagerMailRepositoryNativeTestCase.java?view=diff&rev=471730&r1=471729&r2=471730
==============================================================================
--- james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/repository/TorqueMailboxManagerMailRepositoryNativeTestCase.java (original)
+++ james/server/trunk/src/test/org/apache/james/mailboxmanager/torque/repository/TorqueMailboxManagerMailRepositoryNativeTestCase.java Mon Nov  6 05:39:53 2006
@@ -1,3 +1,22 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
 package org.apache.james.mailboxmanager.torque.repository;
 
 import java.io.ByteArrayInputStream;
@@ -116,10 +135,10 @@
     protected GeneralMailboxSession getShadowMailbox() {
         if (shadowMailbox == null) {
             try {
-                shadowMailbox = (GeneralMailboxSession) TorqueMailboxManagerProviderSingleton
+                shadowMailbox = TorqueMailboxManagerProviderSingleton
                         .getTorqueMailboxManagerProviderInstance()
-                        .getGeneralManagerInstance(new MockUser())
-                        .getGenericGeneralMailboxSession("#mail.tuser.INBOX");
+                        .getMailboxManagerInstance(new MockUser())
+                        .getGeneralMailboxSession("#mail.tuser.INBOX");
             } catch (Exception e) {
                 throw new RuntimeException(e);
             }



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