james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r965832 - /james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java
Date Tue, 20 Jul 2010 12:52:27 GMT
Author: norman
Date: Tue Jul 20 12:52:27 2010
New Revision: 965832

URL: http://svn.apache.org/viewvc?rev=965832&view=rev
Log:
Prepare for namespace support (IMAP-177 )

Modified:
    james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java

Modified: james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java
URL: http://svn.apache.org/viewvc/james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java?rev=965832&r1=965831&r2=965832&view=diff
==============================================================================
--- james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java
(original)
+++ james/imap/trunk/store/src/main/java/org/apache/james/imap/store/SimpleMailboxSession.java
Tue Jul 20 12:52:27 2010
@@ -27,6 +27,7 @@ import java.util.Locale;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
+import org.apache.james.imap.mailbox.MailboxConstants;
 import org.apache.james.imap.mailbox.MailboxSession;
 
 /**
@@ -56,17 +57,28 @@ public class SimpleMailboxSession implem
 
     public SimpleMailboxSession(final long sessionId, final String userName, final String
password,
             final Log log, final List<Locale> localePreferences) {
+        this(sessionId, userName, password, log, localePreferences, new ArrayList<String>(),
null);
+    }
+
+    public SimpleMailboxSession(final long sessionId, final String userName, final String
password,
+            final Log log, final List<Locale> localePreferences, List<String>
sharedSpaces, String otherUsersSpace) {
         this.sessionId = sessionId;
         this.log = log;
         this.userName = userName;
         this.password = password;
-        this.personalSpace = "";
-        this.otherUsersSpace = null;
-        this.sharedSpaces = new ArrayList<String>();
+        this.otherUsersSpace = otherUsersSpace;
+        this.sharedSpaces = sharedSpaces;
+
+        if (otherUsersSpace == null && (sharedSpaces == null || sharedSpaces.isEmpty()))
{
+            this.personalSpace = "";
+        } else {
+            this.personalSpace = MailboxConstants.USER_NAMESPACE;
+        }
+
         this.localePreferences = localePreferences;
         this.attributes = new HashMap<Object, Object>();
     }
-
+    
     /*
      * (non-Javadoc)
      * @see org.apache.james.imap.mailbox.MailboxSession#getLog()
@@ -107,7 +119,7 @@ public class SimpleMailboxSession implem
     public String toString() {
         final String TAB = " ";
 
-        String retValue = "TorqueMailboxSession ( " + "sessionId = "
+        String retValue = "MailboxSession ( " + "sessionId = "
                 + this.sessionId + TAB + "open = " + this.open + TAB + " )";
 
         return retValue;
@@ -123,11 +135,12 @@ public class SimpleMailboxSession implem
     
     /**
      * Gets the name of the user executing this session.
+     * 
      * @return not null
      */
-	public String getUserName() {
-		return userName;
-	}
+    public String getUserName() {
+        return userName;
+    }
 
     /**
      * @see org.apache.james.imap.mailbox.MailboxSession#getOtherUsersSpace()



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