Author: norman
Date: Wed Sep 30 11:00:13 2009
New Revision: 820243

URL: http://svn.apache.org/viewvc?rev=820243&view=rev
Log:
move shared code to extra interface

Added:
    
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/TLSSupportedSession.java
Modified:
    
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
    
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPSession.java

Added: 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/TLSSupportedSession.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/TLSSupportedSession.java?rev=820243&view=auto
==============================================================================
--- 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/TLSSupportedSession.java
 (added)
+++ 
james/server/trunk/avalon-socket-library/src/main/java/org/apache/james/socket/TLSSupportedSession.java
 Wed Sep 30 11:00:13 2009
@@ -0,0 +1,47 @@
+/****************************************************************
+ * 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.socket;
+
+import java.io.IOException;
+
+public interface TLSSupportedSession {
+    
+       /**
+        * Return true if StartTLS is supported by the configuration
+        * 
+        * @return supported
+        */
+    boolean isStartTLSSupported();
+    
+    /**
+     * Return true if the starttls was started
+     * 
+     * @return true
+     */
+    boolean isTLSStarted();
+
+    /**
+     * Starttls
+     * 
+     * @throws IOException
+     */
+    void startTLS() throws IOException;
+}

Modified: 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java?rev=820243&r1=820242&r2=820243&view=diff
==============================================================================
--- 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
 (original)
+++ 
james/server/trunk/pop3server-function/src/main/java/org/apache/james/pop3server/POP3Session.java
 Wed Sep 30 11:00:13 2009
@@ -28,6 +28,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.james.services.MailRepository;
+import org.apache.james.socket.TLSSupportedSession;
 import org.apache.james.socket.Watchdog;
 import org.apache.mailet.Mail;
 
@@ -36,7 +37,7 @@
  * POP3Handler object
  */
 
-public interface POP3Session {
+public interface POP3Session extends TLSSupportedSession{
 
     /**
      * Writes response string to the client
@@ -198,12 +199,5 @@
      * @return context sensitive log, not null
      */
     Log getLogger();
-
-    
-    boolean isStartTLSSupported();
-    
-    boolean isTLSStarted();
-
-    void secure() throws IOException;
 }
 

Modified: 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPSession.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPSession.java?rev=820243&r1=820242&r2=820243&view=diff
==============================================================================
--- 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPSession.java
 (original)
+++ 
james/server/trunk/smtpserver-function/src/main/java/org/apache/james/smtpserver/SMTPSession.java
 Wed Sep 30 11:00:13 2009
@@ -19,17 +19,17 @@
 
 package org.apache.james.smtpserver;
 
-import java.io.IOException;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
+import org.apache.james.socket.TLSSupportedSession;
 
 /**
  * All the handlers access this interface to communicate with
  * SMTPHandler object
  */
 
-public interface SMTPSession {
+public interface SMTPSession extends TLSSupportedSession{
 
     // Keys used to store/lookup data in the internal state hash map
     /** Sender's email address */
@@ -189,12 +189,5 @@
      * @return log, not null
      */
     Log getLogger();
-    
-    boolean isStartTLSSupported();
-    
-    boolean isTLSStarted();
-
-    void secure() throws IOException;
-
 }
 



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

Reply via email to