Author: norman
Date: Tue Jan 18 19:09:08 2011
New Revision: 1060542

URL: http://svn.apache.org/viewvc?rev=1060542&view=rev
Log:
Fix compile error

Added:
    
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapSessionImpl.java
Modified:
    
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapHostSystem.java

Modified: 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapHostSystem.java?rev=1060542&r1=1060541&r2=1060542&view=diff
==============================================================================
--- 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapHostSystem.java
 (original)
+++ 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapHostSystem.java
 Tue Jan 18 19:09:08 2011
@@ -33,7 +33,6 @@ import org.apache.james.imap.api.process
 import org.apache.james.imap.decode.ImapDecoder;
 import org.apache.james.imap.encode.ImapEncoder;
 import org.apache.james.imap.main.ImapRequestStreamHandler;
-import org.apache.james.imap.main.ImapSessionImpl;
 import org.apache.james.imap.tester.base.HostSystem;
 import org.apache.james.mailbox.MailboxSession.User;
 
@@ -115,8 +114,7 @@ public abstract class ImapHostSystem imp
             out = new ByteBufferOutputStream(continuation);
             in = new ByteBufferInputStream();
             handler = new ImapRequestStreamHandler(decoder, processor, 
encoder);
-            session = new ImapSessionImpl();
-            session.setLog(new SilentLog());
+            session = new ImapSessionImpl(new SilentLog());
         }
 
         public String readLine() throws Exception {

Added: 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapSessionImpl.java
URL: 
http://svn.apache.org/viewvc/james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapSessionImpl.java?rev=1060542&view=auto
==============================================================================
--- 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapSessionImpl.java
 (added)
+++ 
james/mailbox-integration-tester/trunk/src/main/java/org/apache/james/imap/tester/ImapSessionImpl.java
 Tue Jan 18 19:09:08 2011
@@ -0,0 +1,127 @@
+/****************************************************************
+ * 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.imap.tester;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.james.imap.api.ImapSessionState;
+import org.apache.james.imap.api.process.ImapLineHandler;
+import org.apache.james.imap.api.process.ImapSession;
+import org.apache.james.imap.api.process.SelectedMailbox;
+import org.apache.james.imap.encode.FakeImapSession;
+
+public class ImapSessionImpl implements ImapSession{
+
+        
+    private ImapSessionState state = ImapSessionState.NON_AUTHENTICATED;
+
+    private SelectedMailbox selectedMailbox = null;
+
+    private final Map<String, Object> attributesByKey;
+
+       private Log log;
+
+    public ImapSessionImpl(Log log) {
+        this.attributesByKey = new ConcurrentHashMap<String, Object>();
+        this.log = log;
+    }
+
+    public void logout() {
+        closeMailbox();
+        state = ImapSessionState.LOGOUT;
+    }
+
+    public void authenticated() {
+        this.state = ImapSessionState.AUTHENTICATED;
+    }
+
+    public void deselect() {
+        this.state = ImapSessionState.AUTHENTICATED;
+        closeMailbox();
+    }
+
+    public void selected(SelectedMailbox mailbox) {
+        this.state = ImapSessionState.SELECTED;
+        closeMailbox();
+        this.selectedMailbox = mailbox;
+    }
+
+    public SelectedMailbox getSelected() {
+        return this.selectedMailbox;
+    }
+
+    public ImapSessionState getState() {
+        return this.state;
+    }
+
+    public void closeMailbox() {
+        if (selectedMailbox != null) {
+            selectedMailbox.deselect();
+            selectedMailbox = null;
+        }
+    }
+
+    public Object getAttribute(String key) {
+        final Object result = attributesByKey.get(key);
+        return result;
+    }
+
+    public void setAttribute(String key, Object value) {
+        if (value == null) {
+            attributesByKey.remove(key);
+        } else {
+            attributesByKey.put(key, value);
+        }
+    }
+
+    public Log getLog() {
+        return log;
+    }
+
+    
+    public boolean startTLS() {
+        return false;
+    }
+
+    public boolean supportStartTLS() {
+        return false;
+    }
+
+    public boolean isCompressionSupported() {
+        return false;
+    }
+
+    public boolean startCompression() {
+        return false;
+    }
+
+    public void pushLineHandler(ImapLineHandler lineHandler) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    public void popLineHandler() {
+        // TODO Auto-generated method stub
+        
+    }
+
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to