geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r441859 [1/2] - in /geronimo/server/trunk/modules/geronimo-mail/src: main/java/org/apache/geronimo/mail/ test/java/org/apache/geronimo/mail/
Date Sat, 09 Sep 2006 21:16:21 GMT
Author: rickmcguire
Date: Sat Sep  9 14:16:20 2006
New Revision: 441859

URL: http://svn.apache.org/viewvc?view=rev&rev=441859
Log:
Merge GERONIMO-1754 from DEAD-1.2 branch. 


Added:
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java   (with props)
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java   (with props)
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/SMTPSTransportGBean.java   (with props)
Modified:
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/IMAPStoreGBean.java
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/POP3StoreGBean.java
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
    geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/SMTPTransportGBean.java
    geronimo/server/trunk/modules/geronimo-mail/src/test/java/org/apache/geronimo/mail/MailGBeanTest.java

Modified: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/IMAPStoreGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/IMAPStoreGBean.java?view=diff&rev=441859&r1=441858&r2=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/IMAPStoreGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/IMAPStoreGBean.java Sat Sep  9 14:16:20 2006
@@ -38,6 +38,48 @@
  */
 public class IMAPStoreGBean extends ProtocolGBean {
 
+    // the IMAP configuration property names
+    static public final String IMAP_PORT = "mail.imap.port";
+    static public final String IMAP_CONNECTION_TIMEOUT = "mail.imap.connectiontimeout";
+    static public final String IMAP_TIMEOUT = "mail.imap.timeout";
+    static public final String IMAP_FACTORY_CLASS = "mail.imap.socketFactory.class";
+    static public final String IMAP_FACTORY_FALLBACK = "mail.imap.socketFactory.fallback";
+    static public final String IMAP_FACTORY_PORT = "mail.imap.socketFactory.port";
+    static public final String IMAP_LOCALHOST = "mail.imap.localhost";
+    static public final String IMAP_LOCALADDRESS = "mail.imap.localaddress";
+    static public final String IMAP_LOCALPORT = "mail.imap.localport";
+    static public final String IMAP_PARTIAL_FETCH = "mail.imap.partialfetch";
+    static public final String IMAP_FETCH_SIZE = "mail.imap.fetchsize";
+    static public final String IMAP_STATUS_TIMEOUT = "mail.imap.statuscachetimeout";
+    static public final String IMAP_APPEND_SIZE = "mail.imap.appendbuffersize";
+    static public final String IMAP_POOL_SIZE = "mail.imap.connectionpoolsize";
+    static public final String IMAP_POOL_TIMEOUT = "mail.imap.connectionpooltimeout";
+    static public final String IMAP_SEPARATE_STORE_CONNECTION = "mail.imap.separatestoreconnection";
+    static public final String IMAP_READONLY_SELECT = "mail.imap.alloreadonlyselect";
+    static public final String IMAP_LOGIN_DISABLE = "mail.imap.auth.login.disable";
+    static public final String IMAP_PLAIN_DISABLE = "mail.imap.auth.plain.disable";
+    static public final String IMAP_STARTTLS_ENABLE = "mail.imap.auth.starttls.enable";
+    static public final String IMAP_SASL_ENABLE = "mail.imap.sasl.enable";
+    static public final String IMAP_SASL_MECHANISMS = "mail.imap.sasl.mechanisms";
+    static public final String IMAP_SASL_AUTHORIZATIONID = "mail.imap.sasl.authorizationid";
+
+
+    // the GBEAN property names
+    static public final String GBEAN_PARTIAL_FETCH = "partialFetch";
+    static public final String GBEAN_FETCH_SIZE = "fetchSize";
+    static public final String GBEAN_STATUS_TIMEOUT = "statusCacheTimeout";
+    static public final String GBEAN_APPEND_SIZE = "appendBufferSize";
+    static public final String GBEAN_POOL_SIZE = "connectionPoolSize";
+    static public final String GBEAN_POOL_TIMEOUT = "connectionPoolTimeout";
+    static public final String GBEAN_SEPARATE_STORE_CONNECTION = "separateStoreConnection";
+    static public final String GBEAN_READONLY_SELECT = "allowReadOnlySelect";
+    static public final String GBEAN_LOGIN_DISABLE = "authLoginDisable";
+    static public final String GBEAN_PLAIN_DISABLE = "authPlainDisable";
+    static public final String GBEAN_STARTTLS_ENABLE = "startTLSEnable";
+    static public final String GBEAN_SASL_ENABLE = "saslEnable";
+    static public final String GBEAN_SASL_MECHANISMS = "saslMechanisms";
+    static public final String GBEAN_SASL_AUTHORIZATIONID = "saslAuthorizationId";
+
     private final Log log = LogFactory.getLog(IMAPStoreGBean.class);
 
     private Integer port;
@@ -724,28 +766,28 @@
     public void addOverrides(Properties props) {
         super.addOverrides(props);
 
-        if (port != null) props.put("mail.imap.port", port);
-        if (partialFetch != null) props.put("mail.imap.partialfetch", partialFetch);
-        if (fetchSize != null) props.put("mail.imap.fetchsize", fetchSize);
-        if (connectionTimeout != null) props.put("mail.imap.connectiontimeout", connectionTimeout);
-        if (timeout != null) props.put("mail.imap.timeout", timeout);
-        if (statusCacheTimeout != null) props.put("mail.imap.statuscachetimeout", statusCacheTimeout);
-        if (appendBufferSize != null) props.put("mail.imap.appendbuffersize", appendBufferSize);
-        if (connectionPoolSize != null) props.put("mail.imap.connectionpoolsize", connectionPoolSize);
-        if (connectionPoolTimeout != null) props.put("mail.imap.connectionpooltimeout", connectionPoolTimeout);
-        if (separateStoreConnection != null) props.put("mail.imap.separatestoreconnection", separateStoreConnection);
-        if (allowReadOnlySelect != null) props.put("mail.imap.allowreadonlyselect", allowReadOnlySelect);
-        if (authLoginDisable != null) props.put("mail.imap.auth.login.disable", authLoginDisable);
-        if (authPlainDisable != null) props.put("mail.imap.auth.plain.disable", authPlainDisable);
-        if (startTLSEnable != null) props.put("mail.imap.auth.starttls.enable", startTLSEnable);
-        if (localaddress != null) props.put("mail.imap.localaddress", localaddress);
-        if (localport != null) props.put("mail.imap.localport", localport);
-        if (saslEnable != null) props.put("mail.imap.sasl.enable", saslEnable);
-        if (saslMechanisms != null) props.put("mail.imap.sasl.mechanisms", saslMechanisms);
-        if (saslAuthorizationId != null) props.put("mail.imap.sasl.authorizationid", saslAuthorizationId);
-        if (socketFactoryClass != null) props.put("mail.imap.socketFactory.class", socketFactoryClass);
-        if (socketFactoryFallback != null) props.put("mail.imap.socketFactory.fallback", socketFactoryFallback);
-        if (socketFactoryPort != null) props.put("mail.imap.socketFactory.port", socketFactoryPort);
+        if (port != null) props.put(IMAP_PORT, port);
+        if (partialFetch != null) props.put(IMAP_PARTIAL_FETCH, partialFetch);
+        if (fetchSize != null) props.put(IMAP_FETCH_SIZE, fetchSize);
+        if (connectionTimeout != null) props.put(IMAP_CONNECTION_TIMEOUT, connectionTimeout);
+        if (timeout != null) props.put(IMAP_TIMEOUT, timeout);
+        if (statusCacheTimeout != null) props.put(IMAP_STATUS_TIMEOUT, statusCacheTimeout);
+        if (appendBufferSize != null) props.put(IMAP_APPEND_SIZE, appendBufferSize);
+        if (connectionPoolSize != null) props.put(IMAP_POOL_SIZE, connectionPoolSize);
+        if (connectionPoolTimeout != null) props.put(IMAP_POOL_TIMEOUT, connectionPoolTimeout);
+        if (separateStoreConnection != null) props.put(IMAP_SEPARATE_STORE_CONNECTION, separateStoreConnection);
+        if (allowReadOnlySelect != null) props.put(IMAP_READONLY_SELECT, allowReadOnlySelect);
+        if (authLoginDisable != null) props.put(IMAP_LOGIN_DISABLE, authLoginDisable);
+        if (authPlainDisable != null) props.put(IMAP_PLAIN_DISABLE, authPlainDisable);
+        if (startTLSEnable != null) props.put(IMAP_STARTTLS_ENABLE, startTLSEnable);
+        if (localaddress != null) props.put(IMAP_LOCALADDRESS, localaddress);
+        if (localport != null) props.put(IMAP_LOCALPORT, localport);
+        if (saslEnable != null) props.put(IMAP_SASL_ENABLE, saslEnable);
+        if (saslMechanisms != null) props.put(IMAP_SASL_MECHANISMS, saslMechanisms);
+        if (saslAuthorizationId != null) props.put(IMAP_SASL_AUTHORIZATIONID, saslAuthorizationId);
+        if (socketFactoryClass != null) props.put(IMAP_FACTORY_CLASS, socketFactoryClass);
+        if (socketFactoryFallback != null) props.put(IMAP_FACTORY_FALLBACK, socketFactoryFallback);
+        if (socketFactoryPort != null) props.put(IMAP_FACTORY_PORT, socketFactoryPort);
     }
 
     public void doStart() throws Exception {
@@ -765,52 +807,59 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(IMAPStoreGBean.class, ProtocolGBean.GBEAN_INFO);
 
-        infoFactory.addAttribute("port", Integer.class, true);
-        infoFactory.addAttribute("partialFetch", Boolean.class, true);
-        infoFactory.addAttribute("fetchSize", Integer.class, true);
-        infoFactory.addAttribute("connectionTimeout", Integer.class, true);
-        infoFactory.addAttribute("timeout", Integer.class, true);
-        infoFactory.addAttribute("statusCacheTimeout", Integer.class, true);
-        infoFactory.addAttribute("appendBufferSize", Integer.class, true);
-        infoFactory.addAttribute("connectionPoolSize", Integer.class, true);
-        infoFactory.addAttribute("connectionPoolTimeout", Integer.class, true);
-        infoFactory.addAttribute("separateStoreConnection", Boolean.class, true);
-        infoFactory.addAttribute("allowReadOnlySelect", Boolean.class, true);
-        infoFactory.addAttribute("authLoginDisable", Boolean.class, true);
-        infoFactory.addAttribute("authPlainDisable", Boolean.class, true);
-        infoFactory.addAttribute("startTLSEnable", Boolean.class, true);
-        infoFactory.addAttribute("localaddress", String.class, true);
-        infoFactory.addAttribute("localport", Integer.class, true);
-        infoFactory.addAttribute("saslEnable", Boolean.class, true);
-        infoFactory.addAttribute("saslMechanisms", String.class, true);
-        infoFactory.addAttribute("saslAuthorizationId", String.class, true);
-        infoFactory.addAttribute("socketFactoryClass", String.class, true);
-        infoFactory.addAttribute("socketFactoryFallback", Boolean.class, true);
-        infoFactory.addAttribute("socketFactoryPort", Integer.class, true);
-
-        infoFactory.setConstructor(new String[]{"objectName", "properties", "host", "user",
-                                                "port",
-                                                "partialFetch",
-                                                "fetchSize",
-                                                "connectionTimeout",
-                                                "timeout",
-                                                "statusCacheTimeout",
-                                                "appendBufferSize",
-                                                "connectionPoolSize",
-                                                "connectionPoolTimeout",
-                                                "separateStoreConnection",
-                                                "allowReadOnlySelect",
-                                                "authLoginDisable",
-                                                "authPlainDisable",
-                                                "startTLSEnable",
-                                                "localaddress",
-                                                "localport",
-                                                "saslEnable",
-                                                "saslMechanisms",
-                                                "saslAuthorizationId",
-                                                "socketFactoryClass",
-                                                "socketFactoryFallback",
-                                                "socketFactoryPort"});
+        infoFactory.addAttribute(GBEAN_PORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_CONNECTION_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_LOCALADDRESS, String.class, true);
+        infoFactory.addAttribute(GBEAN_LOCALPORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_CLASS, String.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_FALLBACK, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_PORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_PARTIAL_FETCH, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FETCH_SIZE, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_STATUS_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_APPEND_SIZE, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_POOL_SIZE, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_POOL_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_SEPARATE_STORE_CONNECTION, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_READONLY_SELECT, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_LOGIN_DISABLE, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_PLAIN_DISABLE, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_STARTTLS_ENABLE, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_SASL_ENABLE, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_SASL_MECHANISMS, String.class, true);
+        infoFactory.addAttribute(GBEAN_SASL_AUTHORIZATIONID, String.class, true);
+
+        infoFactory.addAttribute(GBEAN_OBJECTNAME, String.class, false);
+        infoFactory.addAttribute(GBEAN_PROTOCOL, String.class, true);
+        infoFactory.addAttribute(GBEAN_PROPERTIES, Properties.class, true);
+        infoFactory.addAttribute(GBEAN_HOST, String.class, true);
+        infoFactory.addAttribute(GBEAN_USER, String.class, true);
+        infoFactory.addOperation(GBEAN_ADD_OVERRIDES, new Class[]{Properties.class});
+
+        infoFactory.setConstructor(new String[]{GBEAN_OBJECTNAME, GBEAN_PROPERTIES, GBEAN_HOST, GBEAN_USER,
+                                                GBEAN_PORT,
+                                                GBEAN_PARTIAL_FETCH,
+                                                GBEAN_FETCH_SIZE,
+                                                GBEAN_CONNECTION_TIMEOUT,
+                                                GBEAN_TIMEOUT,
+                                                GBEAN_STATUS_TIMEOUT,
+                                                GBEAN_APPEND_SIZE,
+                                                GBEAN_POOL_SIZE,
+                                                GBEAN_POOL_TIMEOUT,
+                                                GBEAN_SEPARATE_STORE_CONNECTION,
+                                                GBEAN_READONLY_SELECT,
+                                                GBEAN_LOGIN_DISABLE,
+                                                GBEAN_PLAIN_DISABLE,
+                                                GBEAN_STARTTLS_ENABLE,
+                                                GBEAN_LOCALADDRESS,
+                                                GBEAN_LOCALPORT,
+                                                GBEAN_SASL_ENABLE,
+                                                GBEAN_SASL_MECHANISMS,
+                                                GBEAN_SASL_AUTHORIZATIONID,
+                                                GBEAN_FACTORY_CLASS,
+                                                GBEAN_FACTORY_FALLBACK,
+                                                GBEAN_FACTORY_PORT});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Added: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java?view=auto&rev=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java (added)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java Sat Sep  9 14:16:20 2006
@@ -0,0 +1,50 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.mail;
+
+/**
+ * Common constants used by the two NNTP GBean classes.
+ * <p/>
+ *
+ * @version $Rev$ $Date$
+ */
+public interface NNTPGBeanConstants {
+
+    // the NNTP configuration property names
+    static public final String NNTP_PORT = "mail.nntp.port";
+    static public final String NNTP_CONNECTION_TIMEOUT = "mail.nntp.connectiontimeout";
+    static public final String NNTP_TIMEOUT = "mail.nntp.timeout";
+    static public final String NNTP_FROM = "mail.nntp.from";
+    static public final String NNTP_AUTH = "mail.nntp.auth";
+    static public final String NNTP_REALM = "mail.nntp.sasl.realm";
+    static public final String NNTP_QUITWAIT = "mail.nntp.quitwait";
+    static public final String NNTP_FACTORY_CLASS = "mail.nntp.socketFactory.class";
+    static public final String NNTP_FACTORY_FALLBACK = "mail.nntp.socketFactory.fallback";
+    static public final String NNTP_FACTORY_PORT = "mail.nntp.socketFactory.port";
+
+    static public final String NNTPS_PORT = "mail.nntp.port";
+    static public final String NNTPS_CONNECTION_TIMEOUT = "mail.nntp.connectiontimeout";
+    static public final String NNTPS_TIMEOUT = "mail.nntp.timeout";
+    static public final String NNTPS_FROM = "mail.nntp.from";
+    static public final String NNTPS_AUTH = "mail.nntp.auth";
+    static public final String NNTPS_REALM = "mail.nntp.sasl.realm";
+    static public final String NNTPS_QUITWAIT = "mail.nntp.quitwait";
+    static public final String NNTPS_FACTORY_CLASS = "mail.nntp.socketFactory.class";
+    static public final String NNTPS_FACTORY_FALLBACK = "mail.nntp.socketFactory.fallback";
+    static public final String NNTPS_FACTORY_PORT = "mail.nntp.socketFactory.port";
+}
+

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPGBeanConstants.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java?view=auto&rev=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java Sat Sep  9 14:16:20 2006
@@ -0,0 +1,386 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.mail;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+/**
+ * A GBean that provides for the configuration of a JavaMail NNTP transport
+ * protocol.
+ * <p/>
+ * NNTP transport properties that are common to all NNTP transports are
+ * provided via member variables of this class.  Values that are set in the
+ * individual member variables will override any of the corresponding values
+ * that have been set in the properties set.
+ *
+ * @version $Rev$ $Date$
+ * @see MailGBean
+ */
+public class NNTPStoreGBean extends ProtocolGBean implements NNTPGBeanConstants {
+
+    private final Log log = LogFactory.getLog(NNTPTransportGBean.class);
+
+    private Integer port;
+    private Integer connectionTimeout;
+    private Integer timeout;
+    private Boolean auth;
+    private String saslRealm;
+    private Boolean quitWait;
+    private String socketFactoryClass;
+    private Boolean socketFactoryFallback;
+    private Integer socketFactoryPort;
+
+
+    /**
+     * Construct an instance of NNTPStoreGBean
+     * <p/>
+     * Values that are set in the individual member variables will override any of
+     * the corresponding values that have been set in the properties set.
+     *
+     * @param objectName            the object name of the protocol
+     * @param properties            the set of default properties for the protocol
+     * @param host                  the host the protocol connects to
+     * @param user                  the default name for the protocol
+     * @param port                  the NNTP server port
+     * @param connectionTimeout     the socket connection timeout value in milliseconds
+     * @param timeout               the socket I/O timeout value in milliseconds
+     * @param auth                  whether an attempt will be made to authenticate the user
+     * @param saslRealm             the realm to use with DIGEST-MD5 authentication
+     * @param quitWait              whether the transport will wait for the response to the QUIT command
+     * @param socketFactoryClass    the class that will be used to create NNTP sockets
+     * @param socketFactoryFallback whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     * @param socketFactoryPort     whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     */
+    public NNTPStoreGBean(String objectName, Properties properties, String host, String user,
+                              Integer port,
+                              Integer connectionTimeout,
+                              Integer timeout,
+                              Boolean auth,
+                              String saslRealm,
+                              Boolean quitWait,
+                              String socketFactoryClass,
+                              Boolean socketFactoryFallback,
+                              Integer socketFactoryPort) {
+        super(objectName, "nntp", properties, host, user);
+
+        setPort(port);
+        setConnectionTimeout(connectionTimeout);
+        setTimeout(timeout);
+        setAuth(auth);
+        setSaslRealm(saslRealm);
+        setQuitWait(quitWait);
+        setSocketFactoryClass(socketFactoryClass);
+        setSocketFactoryFallback(socketFactoryFallback);
+        setSocketFactoryPort(socketFactoryPort);
+    }
+
+    /**
+     * Returns the NNTP server port to connect to, if the connect() method
+     * doesn't explicitly specify one.
+     */
+    public Integer getPort() {
+        return port;
+    }
+
+    /**
+     * Sets the NNTP server port to connect to, if the connect() method
+     * doesn't explicitly specify one.
+     * <p/>
+     * Defaults to 25.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param port the NNTP server port to connect to
+     */
+    public void setPort(Integer port) {
+        this.port = port;
+    }
+
+    /**
+     * Returns the socket connection timeout value in milliseconds.
+     */
+    public Integer getConnectionTimeout() {
+        return connectionTimeout;
+    }
+
+    /**
+     * Sets the socket connection timeout value in milliseconds.
+     * <p/>
+     * Default is infinite timeout.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param connectionTimeout the socket connection timeout value in milliseconds.
+     */
+    public void setConnectionTimeout(Integer connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
+
+    /**
+     * Returns the socket I/O timeout value in milliseconds.
+     */
+    public Integer getTimeout() {
+        return timeout;
+    }
+
+    /**
+     * Sets the socket I/O timeout value in milliseconds.
+     * <p/>
+     * Default is infinite timeout.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param timeout the socket I/O timeout value in milliseconds
+     */
+    public void setTimeout(Integer timeout) {
+        this.timeout = timeout;
+    }
+
+
+    /**
+     * Returns whether an attempt will be made to authenticate the user.
+     * <p/>
+     * Defaults to false.
+     */
+    public Boolean getAuth() {
+        return auth;
+    }
+
+    /**
+     * Sets whether an attempt will be made to authenticate the user.
+     * <p/>
+     * Defaults to false.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param auth whether an attempt will be made to authenticate the user.
+     */
+    public void setAuth(Boolean auth) {
+        this.auth = auth;
+    }
+
+    /**
+     * Returns the realm to use with DIGEST-MD5 authentication.
+     */
+    public String getSaslRealm() {
+        return saslRealm;
+    }
+
+    /**
+     * Sets the realm to use with DIGEST-MD5 authentication.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param saslRealm the realm to use with DIGEST-MD5 authentication
+     */
+    public void setSaslRealm(String saslRealm) {
+        this.saslRealm = saslRealm;
+    }
+
+    /**
+     * Returns whether the transport will wait for the response to the QUIT command.
+     * <p/>
+     * If set to true, causes the transport to wait for the response to the QUIT
+     * command. If set to false (the default), the QUIT command is sent and the
+     * connection is immediately closed.
+     */
+    public Boolean getQuitWait() {
+        return quitWait;
+    }
+
+    /**
+     * Sets whether the transport will wait for the response to the QUIT command
+     * <p/>
+     * If set to true, causes the transport to wait for the response to the QUIT
+     * command. If set to false (the default), the QUIT command is sent and the
+     * connection is immediately closed.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param quitWait whether the transport will wait for the response to the QUIT command
+     */
+    public void setQuitWait(Boolean quitWait) {
+        this.quitWait = quitWait;
+    }
+
+    /**
+     * Returns the class that will be used to create NNTP sockets.
+     * <p/>
+     * If set, specifies the name of a class that implements the
+     * javax.net.SocketFactory interface. This class will be used to create NNTP
+     * sockets.
+     */
+    public String getSocketFactoryClass() {
+        return socketFactoryClass;
+    }
+
+    /**
+     * Sets the class that will be used to create NNTP sockets.
+     * <p/>
+     * If set, specifies the name of a class that implements the
+     * javax.net.SocketFactory interface. This class will be used to create NNTP
+     * sockets.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryClass the class that will be used to create NNTP sockets
+     */
+    public void setSocketFactoryClass(String socketFactoryClass) {
+        this.socketFactoryClass = socketFactoryClass;
+    }
+
+    /**
+     * Returns whether java.net.Socket class will be created if the specified
+     * socket factory class cannot be created.
+     * <p/>
+     * If set to true, failure to create a socket using the specified socket
+     * factory class will cause the socket to be created using the
+     * java.net.Socket class. Defaults to true.
+     */
+    public Boolean getSocketFactoryFallback() {
+        return socketFactoryFallback;
+    }
+
+    /**
+     * Sets whether java.net.Socket class will be created if the specified
+     * socket factory class cannot be created.
+     * <p/>
+     * If set to true, failure to create a socket using the specified socket
+     * factory class will cause the socket to be created using the
+     * java.net.Socket class. Defaults to true.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryFallback whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     */
+    public void setSocketFactoryFallback(Boolean socketFactoryFallback) {
+        this.socketFactoryFallback = socketFactoryFallback;
+    }
+
+    /**
+     * Returns the port to connect to when using the specified socket factory.
+     * <p/>
+     * Specifies the port to connect to when using the specified socket
+     * factory. If not set, the default port will be used.
+     */
+    public Integer getSocketFactoryPort() {
+        return socketFactoryPort;
+    }
+
+    /**
+     * Sets the port to connect to when using the specified socket factory.
+     * <p/>
+     * Specifies the port to connect to when using the specified socket
+     * factory. If not set, the default port will be used.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryPort the port to connect to when using the specified socket factory
+     */
+    public void setSocketFactoryPort(Integer socketFactoryPort) {
+        this.socketFactoryPort = socketFactoryPort;
+    }
+
+    /**
+     * Add the overrides from the member variables to the properties file.
+     */
+    public void addOverrides(Properties props) {
+        super.addOverrides(props);
+
+        if (port != null) props.put(NNTPS_PORT, port);
+        if (connectionTimeout != null) props.put(NNTPS_CONNECTION_TIMEOUT, connectionTimeout);
+        if (timeout != null) props.put(NNTPS_TIMEOUT, timeout);
+        if (auth != null) props.put(NNTPS_AUTH, auth);
+        if (saslRealm != null) props.put(NNTPS_REALM, saslRealm);
+        if (quitWait != null) props.put(NNTPS_QUITWAIT, quitWait);
+        if (socketFactoryClass != null) props.put(NNTPS_FACTORY_CLASS, socketFactoryClass);
+        if (socketFactoryFallback != null) props.put(NNTPS_FACTORY_FALLBACK, socketFactoryFallback);
+        if (socketFactoryPort != null) props.put(NNTPS_FACTORY_PORT, socketFactoryPort);
+    }
+
+    public void doStart() throws Exception {
+        log.debug("Started " + getObjectName());
+    }
+
+    public void doStop() throws Exception {
+        log.debug("Stopped " + getObjectName());
+    }
+
+    public void doFail() {
+        log.warn("Failed " + getObjectName());
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(NNTPStoreGBean.class);
+
+        infoFactory.addAttribute(GBEAN_PORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_CONNECTION_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_AUTH, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_REALM, String.class, true);
+        infoFactory.addAttribute(GBEAN_QUITWAIT, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_CLASS, String.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_FALLBACK, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_PORT, Integer.class, true);
+
+        infoFactory.addAttribute(GBEAN_OBJECTNAME, String.class, false);
+        infoFactory.addAttribute(GBEAN_PROTOCOL, String.class, true);
+        infoFactory.addAttribute(GBEAN_PROPERTIES, Properties.class, true);
+        infoFactory.addAttribute(GBEAN_HOST, String.class, true);
+        infoFactory.addAttribute(GBEAN_USER, String.class, true);
+        infoFactory.addOperation(GBEAN_ADD_OVERRIDES, new Class[]{Properties.class});
+
+        infoFactory.setConstructor(new String[]{GBEAN_OBJECTNAME, GBEAN_PROPERTIES, GBEAN_HOST, GBEAN_USER,
+                                                GBEAN_PORT,
+                                                GBEAN_CONNECTION_TIMEOUT,
+                                                GBEAN_TIMEOUT,
+                                                GBEAN_AUTH,
+                                                GBEAN_REALM,
+                                                GBEAN_QUITWAIT,
+                                                GBEAN_FACTORY_CLASS,
+                                                GBEAN_FACTORY_FALLBACK,
+                                                GBEAN_FACTORY_PORT});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+
+

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPStoreGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java?view=auto&rev=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java (added)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java Sat Sep  9 14:16:20 2006
@@ -0,0 +1,413 @@
+/**
+ *
+ * Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.mail;
+
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+
+/**
+ * A GBean that provides for the configuration of a JavaMail NNTP transport
+ * protocol.
+ * <p/>
+ * NNTP transport properties that are common to all NNTP transports are
+ * provided via member variables of this class.  Values that are set in the
+ * individual member variables will override any of the corresponding values
+ * that have been set in the properties set.
+ *
+ * @version $Rev$ $Date$
+ * @see MailGBean
+ */
+public class NNTPTransportGBean extends ProtocolGBean implements NNTPGBeanConstants {
+
+    private final Log log = LogFactory.getLog(NNTPTransportGBean.class);
+
+    private Integer port;
+    private Integer connectionTimeout;
+    private Integer timeout;
+    private String from;
+    private Boolean auth;
+    private String saslRealm;
+    private Boolean quitWait;
+    private String socketFactoryClass;
+    private Boolean socketFactoryFallback;
+    private Integer socketFactoryPort;
+
+
+    /**
+     * Construct an instance of NNTPTransportGBean
+     * <p/>
+     * Values that are set in the individual member variables will override any of
+     * the corresponding values that have been set in the properties set.
+     *
+     * @param objectName            the object name of the protocol
+     * @param properties            the set of default properties for the protocol
+     * @param host                  the host the protocol connects to
+     * @param user                  the default name for the protocol
+     * @param port                  the NNTP server port
+     * @param connectionTimeout     the socket connection timeout value in milliseconds
+     * @param timeout               the socket I/O timeout value in milliseconds
+     * @param from                  the email address to use for NNTP POST command
+     * @param auth                  whether an attempt will be made to authenticate the user
+     * @param saslRealm             the realm to use with DIGEST-MD5 authentication
+     * @param quitWait              whether the transport will wait for the response to the QUIT command
+     * @param socketFactoryClass    the class that will be used to create NNTP sockets
+     * @param socketFactoryFallback whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     * @param socketFactoryPort     whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     */
+    public NNTPTransportGBean(String objectName, Properties properties, String host, String user,
+                              Integer port,
+                              Integer connectionTimeout,
+                              Integer timeout,
+                              String from,
+                              Boolean auth,
+                              String saslRealm,
+                              Boolean quitWait,
+                              String socketFactoryClass,
+                              Boolean socketFactoryFallback,
+                              Integer socketFactoryPort) {
+        super(objectName, "nntp-post", properties, host, user);
+
+        setPort(port);
+        setConnectionTimeout(connectionTimeout);
+        setTimeout(timeout);
+        setFrom(from);
+        setAuth(auth);
+        setSaslRealm(saslRealm);
+        setQuitWait(quitWait);
+        setSocketFactoryClass(socketFactoryClass);
+        setSocketFactoryFallback(socketFactoryFallback);
+        setSocketFactoryPort(socketFactoryPort);
+    }
+
+    /**
+     * Returns the NNTP server port to connect to, if the connect() method
+     * doesn't explicitly specify one.
+     */
+    public Integer getPort() {
+        return port;
+    }
+
+    /**
+     * Sets the NNTP server port to connect to, if the connect() method
+     * doesn't explicitly specify one.
+     * <p/>
+     * Defaults to 25.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param port the NNTP server port to connect to
+     */
+    public void setPort(Integer port) {
+        this.port = port;
+    }
+
+    /**
+     * Returns the socket connection timeout value in milliseconds.
+     */
+    public Integer getConnectionTimeout() {
+        return connectionTimeout;
+    }
+
+    /**
+     * Sets the socket connection timeout value in milliseconds.
+     * <p/>
+     * Default is infinite timeout.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param connectionTimeout the socket connection timeout value in milliseconds.
+     */
+    public void setConnectionTimeout(Integer connectionTimeout) {
+        this.connectionTimeout = connectionTimeout;
+    }
+
+    /**
+     * Returns the socket I/O timeout value in milliseconds.
+     */
+    public Integer getTimeout() {
+        return timeout;
+    }
+
+    /**
+     * Sets the socket I/O timeout value in milliseconds.
+     * <p/>
+     * Default is infinite timeout.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param timeout the socket I/O timeout value in milliseconds
+     */
+    public void setTimeout(Integer timeout) {
+        this.timeout = timeout;
+    }
+
+    /**
+     * Returns the email address to use for NNTP POST command.
+     */
+    public String getFrom() {
+        return from;
+    }
+
+    /**
+     * Sets the email address to use for NNTP POST command
+     * <p/>
+     * Email address to use for NNTP POST command. This sets the envelope
+     * return address. Defaults to msg.getFrom() or InternetAddress.getLocalAddress().
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param from the email address to use for NNTP POST command
+     */
+    public void setFrom(String from) {
+        this.from = from;
+    }
+
+    /**
+     * Returns whether an attempt will be made to authenticate the user
+     * <p/>
+     * Defaults to false.
+     */
+    public Boolean getAuth() {
+        return auth;
+    }
+
+    /**
+     * Sets whether an attempt will be made to authenticate the user.
+     * <p/>
+     * Defaults to false.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param auth whether an attempt will be made to authenticate the user.
+     */
+    public void setAuth(Boolean auth) {
+        this.auth = auth;
+    }
+
+    /**
+     * Returns the realm to use with DIGEST-MD5 authentication.
+     */
+    public String getSaslRealm() {
+        return saslRealm;
+    }
+
+    /**
+     * Sets the realm to use with DIGEST-MD5 authentication.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param saslRealm the realm to use with DIGEST-MD5 authentication
+     */
+    public void setSaslRealm(String saslRealm) {
+        this.saslRealm = saslRealm;
+    }
+
+    /**
+     * Returns whether the transport will wait for the response to the QUIT command.
+     * <p/>
+     * If set to true, causes the transport to wait for the response to the QUIT
+     * command. If set to false (the default), the QUIT command is sent and the
+     * connection is immediately closed.
+     */
+    public Boolean getQuitWait() {
+        return quitWait;
+    }
+
+    /**
+     * Sets whether the transport will wait for the response to the QUIT command
+     * <p/>
+     * If set to true, causes the transport to wait for the response to the QUIT
+     * command. If set to false (the default), the QUIT command is sent and the
+     * connection is immediately closed.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param quitWait whether the transport will wait for the response to the QUIT command
+     */
+    public void setQuitWait(Boolean quitWait) {
+        this.quitWait = quitWait;
+    }
+
+    /**
+     * Returns the class that will be used to create NNTP sockets.
+     * <p/>
+     * If set, specifies the name of a class that implements the
+     * javax.net.SocketFactory interface. This class will be used to create NNTP
+     * sockets.
+     */
+    public String getSocketFactoryClass() {
+        return socketFactoryClass;
+    }
+
+    /**
+     * Sets the class that will be used to create NNTP sockets.
+     * <p/>
+     * If set, specifies the name of a class that implements the
+     * javax.net.SocketFactory interface. This class will be used to create NNTP
+     * sockets.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryClass the class that will be used to create NNTP sockets
+     */
+    public void setSocketFactoryClass(String socketFactoryClass) {
+        this.socketFactoryClass = socketFactoryClass;
+    }
+
+    /**
+     * Returns whether java.net.Socket class will be created if the specified
+     * socket factory class cannot be created.
+     * <p/>
+     * If set to true, failure to create a socket using the specified socket
+     * factory class will cause the socket to be created using the
+     * java.net.Socket class. Defaults to true.
+     */
+    public Boolean getSocketFactoryFallback() {
+        return socketFactoryFallback;
+    }
+
+    /**
+     * Sets whether java.net.Socket class will be created if the specified
+     * socket factory class cannot be created.
+     * <p/>
+     * If set to true, failure to create a socket using the specified socket
+     * factory class will cause the socket to be created using the
+     * java.net.Socket class. Defaults to true.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryFallback whether java.net.Socket class will be created if the specified
+     *                              socket factory class cannot be created
+     */
+    public void setSocketFactoryFallback(Boolean socketFactoryFallback) {
+        this.socketFactoryFallback = socketFactoryFallback;
+    }
+
+    /**
+     * Returns the port to connect to when using the specified socket factory.
+     * <p/>
+     * Specifies the port to connect to when using the specified socket
+     * factory. If not set, the default port will be used.
+     */
+    public Integer getSocketFactoryPort() {
+        return socketFactoryPort;
+    }
+
+    /**
+     * Sets the port to connect to when using the specified socket factory.
+     * <p/>
+     * Specifies the port to connect to when using the specified socket
+     * factory. If not set, the default port will be used.
+     * <p/>
+     * Values that are set here will override any of the corresponding value
+     * that has been set in the properties.
+     *
+     * @param socketFactoryPort the port to connect to when using the specified socket factory
+     */
+    public void setSocketFactoryPort(Integer socketFactoryPort) {
+        this.socketFactoryPort = socketFactoryPort;
+    }
+
+    /**
+     * Add the overrides from the member variables to the properties file.
+     */
+    public void addOverrides(Properties props) {
+        super.addOverrides(props);
+
+        if (port != null) props.put(NNTP_PORT, port);
+        if (connectionTimeout != null) props.put(NNTP_CONNECTION_TIMEOUT, connectionTimeout);
+        if (timeout != null) props.put(NNTP_TIMEOUT, timeout);
+        if (from != null) props.put(NNTP_FROM, from);
+        if (auth != null) props.put(NNTP_AUTH, auth);
+        if (saslRealm != null) props.put(NNTP_REALM, saslRealm);
+        if (quitWait != null) props.put(NNTP_QUITWAIT, quitWait);
+        if (socketFactoryClass != null) props.put(NNTP_FACTORY_CLASS, socketFactoryClass);
+        if (socketFactoryFallback != null) props.put(NNTP_FACTORY_FALLBACK, socketFactoryFallback);
+        if (socketFactoryPort != null) props.put(NNTP_FACTORY_PORT, socketFactoryPort);
+    }
+
+    public void doStart() throws Exception {
+        log.debug("Started " + getObjectName());
+    }
+
+    public void doStop() throws Exception {
+        log.debug("Stopped " + getObjectName());
+    }
+
+    public void doFail() {
+        log.warn("Failed " + getObjectName());
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(NNTPTransportGBean.class);
+
+        infoFactory.addAttribute(GBEAN_PORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_CONNECTION_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_AUTH, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FROM, String.class, true);
+        infoFactory.addAttribute(GBEAN_REALM, String.class, true);
+        infoFactory.addAttribute(GBEAN_QUITWAIT, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_CLASS, String.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_FALLBACK, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_PORT, Integer.class, true);
+
+        infoFactory.addAttribute(GBEAN_OBJECTNAME, String.class, false);
+        infoFactory.addAttribute(GBEAN_PROTOCOL, String.class, true);
+        infoFactory.addAttribute(GBEAN_PROPERTIES, Properties.class, true);
+        infoFactory.addAttribute(GBEAN_HOST, String.class, true);
+        infoFactory.addAttribute(GBEAN_USER, String.class, true);
+        infoFactory.addOperation(GBEAN_ADD_OVERRIDES, new Class[]{Properties.class});
+
+        infoFactory.setConstructor(new String[]{GBEAN_OBJECTNAME, GBEAN_PROPERTIES, GBEAN_HOST, GBEAN_USER,
+                                                GBEAN_PORT,
+                                                GBEAN_CONNECTION_TIMEOUT,
+                                                GBEAN_TIMEOUT,
+                                                GBEAN_FROM,
+                                                GBEAN_AUTH,
+                                                GBEAN_REALM,
+                                                GBEAN_QUITWAIT,
+                                                GBEAN_FACTORY_CLASS,
+                                                GBEAN_FACTORY_FALLBACK,
+                                                GBEAN_FACTORY_PORT});
+
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}
+

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/NNTPTransportGBean.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/POP3StoreGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/POP3StoreGBean.java?view=diff&rev=441859&r1=441858&r2=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/POP3StoreGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/POP3StoreGBean.java Sat Sep  9 14:16:20 2006
@@ -39,6 +39,24 @@
  */
 public class POP3StoreGBean extends ProtocolGBean {
 
+    // the POP3 configuration property names
+    static public final String POP3_PORT = "mail.pop3.port";
+    static public final String POP3_CONNECTION_TIMEOUT = "mail.pop3.connectiontimeout";
+    static public final String POP3_TIMEOUT = "mail.pop3.timeout";
+    static public final String POP3_FACTORY_CLASS = "mail.pop3.socketFactory.class";
+    static public final String POP3_FACTORY_FALLBACK = "mail.pop3.socketFactory.fallback";
+    static public final String POP3_FACTORY_PORT = "mail.pop3.socketFactory.port";
+    static public final String POP3_LOCALHOST = "mail.pop3.localhost";
+    static public final String POP3_LOCALADDRESS = "mail.pop3.localaddress";
+    static public final String POP3_LOCALPORT = "mail.pop3.localport";
+    static public final String POP3_RESET = "mail.pop3.resetbeforequit";
+    static public final String POP3_MESSAGE_CLASS = "mail.pop3.message.class";
+    static public final String POP3_APOP = "mail.pop3.apop.enable";
+
+    static public final String GBEAN_RESET = "rsetBeforeQuit";
+    static public final String GBEAN_APOP = "apopEnable";
+    static public final String GBEAN_MESSAGE_CLASS = "messageClass";
+
     private final Log log = LogFactory.getLog(POP3StoreGBean.class);
 
     private Integer port;
@@ -398,17 +416,17 @@
     public void addOverrides(Properties props) {
         super.addOverrides(props);
 
-        if (port != null) props.put("mail.pop3.port", port);
-        if (connectionTimeout != null) props.put("mail.pop3.connectiontimeout", connectionTimeout);
-        if (timeout != null) props.put("mail.pop3.timeout", timeout);
-        if (rsetBeforeQuit != null) props.put("mail.pop3.rsetbeforequit", rsetBeforeQuit);
-        if (messageClass != null) props.put("mail.pop3.message.class", messageClass);
-        if (localaddress != null) props.put("mail.pop3.localaddress", localaddress);
-        if (localport != null) props.put("mail.pop3.localport", localport);
-        if (apopEnable != null) props.put("mail.pop3.apop.enable", apopEnable);
-        if (socketFactoryClass != null) props.put("mail.pop3.socketFactory.class", socketFactoryClass);
-        if (socketFactoryFallback != null) props.put("mail.pop3.socketFactory.fallback", socketFactoryFallback);
-        if (socketFactoryPort != null) props.put("mail.pop3.socketFactory.port", socketFactoryPort);
+        if (port != null) props.put(POP3_PORT, port);
+        if (connectionTimeout != null) props.put(POP3_CONNECTION_TIMEOUT, connectionTimeout);
+        if (timeout != null) props.put(POP3_TIMEOUT, timeout);
+        if (rsetBeforeQuit != null) props.put(POP3_RESET, rsetBeforeQuit);
+        if (messageClass != null) props.put(POP3_MESSAGE_CLASS, messageClass);
+        if (localaddress != null) props.put(POP3_LOCALADDRESS, localaddress);
+        if (localport != null) props.put(POP3_LOCALPORT, localport);
+        if (apopEnable != null) props.put(POP3_APOP, apopEnable);
+        if (socketFactoryClass != null) props.put(POP3_FACTORY_CLASS, socketFactoryClass);
+        if (socketFactoryFallback != null) props.put(POP3_FACTORY_FALLBACK, socketFactoryFallback);
+        if (socketFactoryPort != null) props.put(POP3_FACTORY_PORT, socketFactoryPort);
     }
 
     public void doStart() throws Exception {
@@ -428,30 +446,37 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(POP3StoreGBean.class, ProtocolGBean.GBEAN_INFO);
 
-        infoFactory.addAttribute("port", Integer.class, true);
-        infoFactory.addAttribute("connectionTimeout", Integer.class, true);
-        infoFactory.addAttribute("timeout", Integer.class, true);
-        infoFactory.addAttribute("rsetBeforeQuit", Boolean.class, true);
-        infoFactory.addAttribute("messageClass", String.class, true);
-        infoFactory.addAttribute("localaddress", String.class, true);
-        infoFactory.addAttribute("localport", Integer.class, true);
-        infoFactory.addAttribute("apopEnable", Boolean.class, true);
-        infoFactory.addAttribute("socketFactoryClass", String.class, true);
-        infoFactory.addAttribute("socketFactoryFallback", Boolean.class, true);
-        infoFactory.addAttribute("socketFactoryPort", Integer.class, true);
-
-        infoFactory.setConstructor(new String[]{"objectName", "properties", "host", "user",
-                                                "port",
-                                                "connectionTimeout",
-                                                "timeout",
-                                                "rsetBeforeQuit",
-                                                "messageClass",
-                                                "localaddress",
-                                                "localport",
-                                                "apopEnable",
-                                                "socketFactoryClass",
-                                                "socketFactoryFallback",
-                                                "socketFactoryPort"});
+        infoFactory.addAttribute(GBEAN_PORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_CONNECTION_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_TIMEOUT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_RESET, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_MESSAGE_CLASS, String.class, true);
+        infoFactory.addAttribute(GBEAN_LOCALADDRESS, String.class, true);
+        infoFactory.addAttribute(GBEAN_LOCALPORT, Integer.class, true);
+        infoFactory.addAttribute(GBEAN_APOP, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_CLASS, String.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_FALLBACK, Boolean.class, true);
+        infoFactory.addAttribute(GBEAN_FACTORY_PORT, Integer.class, true);
+
+        infoFactory.addAttribute(GBEAN_OBJECTNAME, String.class, false);
+        infoFactory.addAttribute(GBEAN_PROTOCOL, String.class, true);
+        infoFactory.addAttribute(GBEAN_PROPERTIES, Properties.class, true);
+        infoFactory.addAttribute(GBEAN_HOST, String.class, true);
+        infoFactory.addAttribute(GBEAN_USER, String.class, true);
+        infoFactory.addOperation(GBEAN_ADD_OVERRIDES, new Class[]{Properties.class});
+
+        infoFactory.setConstructor(new String[]{GBEAN_OBJECTNAME, GBEAN_PROPERTIES, GBEAN_HOST, GBEAN_USER,
+                                                GBEAN_PORT,
+                                                GBEAN_CONNECTION_TIMEOUT,
+                                                GBEAN_TIMEOUT,
+                                                GBEAN_RESET,
+                                                GBEAN_MESSAGE_CLASS,
+                                                GBEAN_LOCALADDRESS,
+                                                GBEAN_LOCALPORT,
+                                                GBEAN_APOP,
+                                                GBEAN_FACTORY_CLASS,
+                                                GBEAN_FACTORY_FALLBACK,
+                                                GBEAN_FACTORY_PORT});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java?view=diff&rev=441859&r1=441858&r2=441859
==============================================================================
--- geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java (original)
+++ geronimo/server/trunk/modules/geronimo-mail/src/main/java/org/apache/geronimo/mail/ProtocolGBean.java Sat Sep  9 14:16:20 2006
@@ -35,6 +35,29 @@
  */
 public class ProtocolGBean implements GBeanLifecycle {
 
+    // common attributes exported by all ProtocolBeans
+    static public final String GBEAN_OBJECTNAME = "objectName";
+    static public final String GBEAN_PROTOCOL = "protocol";
+    static public final String GBEAN_PROPERTIES = "properties";
+    static public final String GBEAN_HOST = "host";
+    static public final String GBEAN_USER = "user";
+    static public final String GBEAN_ADD_OVERRIDES = "addOverrides";
+
+    // common constants for GBEAN properties that are used by a number of transports.
+    static public final String GBEAN_PORT = "port";
+    static public final String GBEAN_CONNECTION_TIMEOUT = "connectionTimeout";
+    static public final String GBEAN_TIMEOUT = "timeout";
+    static public final String GBEAN_FROM = "from";
+    static public final String GBEAN_AUTH = "auth";
+    static public final String GBEAN_REALM = "saslRealm";
+    static public final String GBEAN_QUITWAIT = "quitWait";
+    static public final String GBEAN_FACTORY_CLASS = "socketFactoryClass";
+    static public final String GBEAN_FACTORY_FALLBACK = "socketFactoryFallback";
+    static public final String GBEAN_FACTORY_PORT = "socketFactoryPort";
+    static public final String GBEAN_LOCALHOST = "localhost";
+    static public final String GBEAN_LOCALADDRESS = "localaddress";
+    static public final String GBEAN_LOCALPORT = "localport";
+
     private final Log log = LogFactory.getLog(ProtocolGBean.class);
 
     private final String objectName;
@@ -167,14 +190,14 @@
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ProtocolGBean.class); //TODO just a gbean?
 
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("protocol", String.class, true);
-        infoFactory.addAttribute("properties", Properties.class, true);
-        infoFactory.addAttribute("host", String.class, true);
-        infoFactory.addAttribute("user", String.class, true);
-        infoFactory.addOperation("addOverrides", new Class[]{Properties.class});
+        infoFactory.addAttribute(GBEAN_OBJECTNAME, String.class, false);
+        infoFactory.addAttribute(GBEAN_PROTOCOL, String.class, true);
+        infoFactory.addAttribute(GBEAN_PROPERTIES, Properties.class, true);
+        infoFactory.addAttribute(GBEAN_HOST, String.class, true);
+        infoFactory.addAttribute(GBEAN_USER, String.class, true);
+        infoFactory.addOperation(GBEAN_ADD_OVERRIDES, new Class[]{Properties.class});
 
-        infoFactory.setConstructor(new String[]{"objectName", "protocol", "properties", "host", "user"});
+        infoFactory.setConstructor(new String[]{GBEAN_OBJECTNAME, GBEAN_PROTOCOL, GBEAN_PROPERTIES, GBEAN_HOST, GBEAN_USER});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }



Mime
View raw message