[jboss-cvs] JBossAS SVN: r73611 - trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 23 02:38:52 EDT 2008


Author: jeff.zhang
Date: 2008-05-23 02:38:52 -0400 (Fri, 23 May 2008)
New Revision: 73611

Added:
   trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/IMAPsMailFolder.java
   trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/POP3sMailFolder.java
Modified:
   trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailActivationSpec.java
   trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailFolder.java
Log:
[JBAS-4237] mail-ra should support encrypted connections

Added: trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/IMAPsMailFolder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/IMAPsMailFolder.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/IMAPsMailFolder.java	2008-05-23 06:38:52 UTC (rev 73611)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.resource.adapter.mail.inflow;
+
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Store;
+
+public class IMAPsMailFolder extends IMAPMailFolder {
+
+   public IMAPsMailFolder(MailActivationSpec spec) {
+      super(spec);
+   }
+
+   protected Store openStore(Session session) throws NoSuchProviderException {
+      return session.getStore("imaps");
+   }
+}

Modified: trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailActivationSpec.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailActivationSpec.java	2008-05-23 06:02:17 UTC (rev 73610)
+++ trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailActivationSpec.java	2008-05-23 06:38:52 UTC (rev 73611)
@@ -212,6 +212,8 @@
       tmp.append(debug);
       tmp.append(", starttls=");
       tmp.append(starttls);
+      tmp.append(", port=");
+      tmp.append(port);
       tmp.append(")");
       return tmp.toString();
    }

Modified: trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailFolder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailFolder.java	2008-05-23 06:02:17 UTC (rev 73610)
+++ trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/MailFolder.java	2008-05-23 06:38:52 UTC (rev 73611)
@@ -146,7 +146,11 @@
 			return new POP3MailFolder(mailActivationSpec);
 		} else if ("imap".equals(mailActivationSpec.getStoreProtocol())) {
 			return new IMAPMailFolder(mailActivationSpec);
-		} else {
+        } else if ("pop3s".equals(mailActivationSpec.getStoreProtocol())) {
+           return new POP3sMailFolder(mailActivationSpec);
+        } else if ("imaps".equals(mailActivationSpec.getStoreProtocol())) {
+           return new IMAPsMailFolder(mailActivationSpec);
+        } else {
 			return null;
 		}
 	}

Added: trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/POP3sMailFolder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/POP3sMailFolder.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/adapter/mail/inflow/POP3sMailFolder.java	2008-05-23 06:38:52 UTC (rev 73611)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.resource.adapter.mail.inflow;
+
+import javax.mail.NoSuchProviderException;
+import javax.mail.Session;
+import javax.mail.Store;
+
+public class POP3sMailFolder extends POP3MailFolder {
+
+   public POP3sMailFolder(MailActivationSpec spec) {
+      super(spec);
+   }
+   
+   protected Store openStore(Session session) throws NoSuchProviderException {
+      return session.getStore("pop3s");
+  }
+}




More information about the jboss-cvs-commits mailing list