org.apache.geronimo.mail
Class POP3StoreGBean

java.lang.Object
  extended by org.apache.geronimo.mail.ProtocolGBean
      extended by org.apache.geronimo.mail.POP3StoreGBean
All Implemented Interfaces:
GBeanLifecycle

public class POP3StoreGBean
extends ProtocolGBean

A GBean that provides for the configuration of a JavaMail POP3 message store protocol.

POP3 store properties that are common to all POP3 stores 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.

See Also:
MailGBean

Field Summary
static String GBEAN_APOP
           
static GBeanInfo GBEAN_INFO
           
static String GBEAN_MESSAGE_CLASS
           
static String GBEAN_RESET
           
static String POP3_APOP
           
static String POP3_CONNECTION_TIMEOUT
           
static String POP3_FACTORY_CLASS
           
static String POP3_FACTORY_FALLBACK
           
static String POP3_FACTORY_PORT
           
static String POP3_LOCALADDRESS
           
static String POP3_LOCALHOST
           
static String POP3_LOCALPORT
           
static String POP3_MESSAGE_CLASS
           
static String POP3_PORT
           
static String POP3_RESET
           
static String POP3_TIMEOUT
           
 
Fields inherited from class org.apache.geronimo.mail.ProtocolGBean
GBEAN_ADD_OVERRIDES, GBEAN_AUTH, GBEAN_CONNECTION_TIMEOUT, GBEAN_FACTORY_CLASS, GBEAN_FACTORY_FALLBACK, GBEAN_FACTORY_PORT, GBEAN_FROM, GBEAN_HOST, GBEAN_LOCALADDRESS, GBEAN_LOCALHOST, GBEAN_LOCALPORT, GBEAN_OBJECTNAME, GBEAN_PORT, GBEAN_PROPERTIES, GBEAN_PROTOCOL, GBEAN_QUITWAIT, GBEAN_REALM, GBEAN_TIMEOUT, GBEAN_USER
 
Constructor Summary
POP3StoreGBean(String objectName, Properties properties, String host, String user, Integer port, Integer connectionTimeout, Integer timeout, Boolean rsetBeforeQuit, String messageClass, String localaddress, Integer localport, Boolean apopEnable, String socketFactoryClass, Boolean socketFactoryFallback, Integer socketFactoryPort)
          Construct an instance of POP3StoreGBean

Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

 
Method Summary
 void addOverrides(Properties props)
          Add the overrides from the member variables to the properties file.
 void doFail()
          Fails the GBean.
 void doStart()
          Starts the GBean.
 void doStop()
          Stops the target.
 Integer getConnectionTimeout()
          Returns the socket connection timeout value in milliseconds.
static GBeanInfo getGBeanInfo()
           
 String getLocaladdress()
          Returns the local address (host name) to bind to when creating the POP3 socket.
 Integer getLocalport()
          Returns the local port number to bind to when creating the POP3 socket.
 String getMessageClass()
          Returns the class name of a subclass of com.sun.mail.pop3.POP3Message.
 Integer getPort()
          Returns the POP3 server port to connect to, if the connect() method doesn't explicitly specify one.
 Boolean getRsetBeforeQuit()
          Returns whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command.
 String getSocketFactoryClass()
          Returns the class that will be used to create POP3 sockets.
 Integer getSocketFactoryPort()
          Returns the port to connect to when using the specified socket factory.
 Integer getTimeout()
          Returns the socket I/O timeout value in milliseconds.
 Boolean isApopEnable()
          Returns whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP.
 Boolean isSocketFactoryFallback()
          Returns whether java.net.Socket class will be created if the specified socket factory class cannot be created.
 void setApopEnable(Boolean apopEnable)
          Sets whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP.
 void setConnectionTimeout(Integer connectionTimeout)
          Sets the socket connection timeout value in milliseconds.
 void setLocaladdress(String localaddress)
          Sets the local address (host name) to bind to when creating the POP3 socket.
 void setLocalport(Integer localport)
          Sets the local port number to bind to when creating the POP3 socket.
 void setMessageClass(String messageClass)
          Sets the class name of a subclass of com.sun.mail.pop3.POP3Message.
 void setPort(Integer port)
          Sets the POP3 server port to connect to, if the connect() method doesn't explicitly specify one.
 void setRsetBeforeQuit(Boolean rsetBeforeQuit)
          Sets whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command.
 void setSocketFactoryClass(String socketFactoryClass)
          Sets the class that will be used to create POP3 sockets.
 void setSocketFactoryFallback(Boolean socketFactoryFallback)
          Sets whether java.net.Socket class will be created if the specified socket factory class cannot be created.
 void setSocketFactoryPort(Integer socketFactoryPort)
          Sets the port to connect to when using the specified socket factory.
 void setTimeout(Integer timeout)
          Sets the socket I/O timeout value in milliseconds.
 
Methods inherited from class org.apache.geronimo.mail.ProtocolGBean
getHost, getObjectName, getProperties, getProtocol, getUser, setHost, setProperties, setUser
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POP3_PORT

public static final String POP3_PORT
See Also:
Constant Field Values

POP3_CONNECTION_TIMEOUT

public static final String POP3_CONNECTION_TIMEOUT
See Also:
Constant Field Values

POP3_TIMEOUT

public static final String POP3_TIMEOUT
See Also:
Constant Field Values

POP3_FACTORY_CLASS

public static final String POP3_FACTORY_CLASS
See Also:
Constant Field Values

POP3_FACTORY_FALLBACK

public static final String POP3_FACTORY_FALLBACK
See Also:
Constant Field Values

POP3_FACTORY_PORT

public static final String POP3_FACTORY_PORT
See Also:
Constant Field Values

POP3_LOCALHOST

public static final String POP3_LOCALHOST
See Also:
Constant Field Values

POP3_LOCALADDRESS

public static final String POP3_LOCALADDRESS
See Also:
Constant Field Values

POP3_LOCALPORT

public static final String POP3_LOCALPORT
See Also:
Constant Field Values

POP3_RESET

public static final String POP3_RESET
See Also:
Constant Field Values

POP3_MESSAGE_CLASS

public static final String POP3_MESSAGE_CLASS
See Also:
Constant Field Values

POP3_APOP

public static final String POP3_APOP
See Also:
Constant Field Values

GBEAN_RESET

public static final String GBEAN_RESET
See Also:
Constant Field Values

GBEAN_APOP

public static final String GBEAN_APOP
See Also:
Constant Field Values

GBEAN_MESSAGE_CLASS

public static final String GBEAN_MESSAGE_CLASS
See Also:
Constant Field Values

GBEAN_INFO

public static final GBeanInfo GBEAN_INFO
Constructor Detail

POP3StoreGBean

public POP3StoreGBean(String objectName,
                      Properties properties,
                      String host,
                      String user,
                      Integer port,
                      Integer connectionTimeout,
                      Integer timeout,
                      Boolean rsetBeforeQuit,
                      String messageClass,
                      String localaddress,
                      Integer localport,
                      Boolean apopEnable,
                      String socketFactoryClass,
                      Boolean socketFactoryFallback,
                      Integer socketFactoryPort)
Construct an instance of POP3StoreGBean

Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

Parameters:
objectName - the object name of the protocol
properties - the set of default properties for the protocol
host - the host the protocol connects to
user - the default name for the protocol
port - the POP3 server port
connectionTimeout - the socket connection timeout value in milliseconds
timeout - the socket I/O timeout value in milliseconds
rsetBeforeQuit - whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command
messageClass - the class name of a subclass of com.sun.mail.pop3.POP3Message
localaddress - the local address (host name) to bind to when creating the POP3 socket
localport - the local port number to bind to when creating the POP3 socket
apopEnable - whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP
socketFactoryClass - the class that will be used to create POP3 sockets
socketFactoryFallback - whether java.net.Socket class will be created if the specified socket factory class cannot be created
socketFactoryPort - whether java.net.Socket class will be created if the specified socket factory class cannot be created
Method Detail

getPort

public Integer getPort()
Returns the POP3 server port to connect to, if the connect() method doesn't explicitly specify one.

Defaults to 110.


setPort

public void setPort(Integer port)
Sets the POP3 server port to connect to, if the connect() method doesn't explicitly specify one.

Defaults to 110.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
port - the POP3 server port to connect to, if the connect() method doesn't explicitly specify one

getConnectionTimeout

public Integer getConnectionTimeout()
Returns the socket connection timeout value in milliseconds.


setConnectionTimeout

public void setConnectionTimeout(Integer connectionTimeout)
Sets the socket connection timeout value in milliseconds.

Default is infinite timeout.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
connectionTimeout - the socket connection timeout value in milliseconds.

getTimeout

public Integer getTimeout()
Returns the socket I/O timeout value in milliseconds.


setTimeout

public void setTimeout(Integer timeout)
Sets the socket I/O timeout value in milliseconds.

Default is infinite timeout.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
timeout - the socket I/O timeout value in milliseconds

getRsetBeforeQuit

public Boolean getRsetBeforeQuit()
Returns whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command.

Send a POP3 RSET command when closing the folder, before sending the QUIT command. Useful with POP3 servers that implicitly mark all messages that are read as "deleted"; this will prevent such messages from being deleted and expunged unless the client requests so. Default is false.


setRsetBeforeQuit

public void setRsetBeforeQuit(Boolean rsetBeforeQuit)
Sets whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command.

Send a POP3 RSET command when closing the folder, before sending the QUIT command. Useful with POP3 servers that implicitly mark all messages that are read as "deleted"; this will prevent such messages from being deleted and expunged unless the client requests so. Default is false.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
rsetBeforeQuit - whether an attempt will be made send a POP3 RSET command when closing the folder, before sending the QUIT command

getMessageClass

public String getMessageClass()
Returns the class name of a subclass of com.sun.mail.pop3.POP3Message.

Class name of a subclass of com.sun.mail.pop3.POP3Message. The subclass can be used to handle (for example) non-standard Content-Type headers. The subclass must have a public constructor of the form MyPOP3Message(Folder f, int msgno) throws MessagingException.


setMessageClass

public void setMessageClass(String messageClass)
Sets the class name of a subclass of com.sun.mail.pop3.POP3Message.

Class name of a subclass of com.sun.mail.pop3.POP3Message. The subclass can be used to handle (for example) non-standard Content-Type headers. The subclass must have a public constructor of the form MyPOP3Message(Folder f, int msgno) throws MessagingException.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
messageClass - the class name of a subclass of com.sun.mail.pop3.POP3Message.

getLocaladdress

public String getLocaladdress()
Returns the local address (host name) to bind to when creating the POP3 socket.


setLocaladdress

public void setLocaladdress(String localaddress)
Sets the local address (host name) to bind to when creating the POP3 socket.

Local address (host name) to bind to when creating the POP3 socket. Defaults to the address picked by the Socket class. Should not normally need to be set, but useful with multi-homed hosts where it's important to pick a particular local address to bind to.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
localaddress - the local address (host name) to bind to when creating the POP3 socket

getLocalport

public Integer getLocalport()
Returns the local port number to bind to when creating the POP3 socket.


setLocalport

public void setLocalport(Integer localport)
Sets the local port number to bind to when creating the POP3 socket.

Local port number to bind to when creating the POP3 socket. Defaults to the port number picked by the Socket class.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
localport - the local port number to bind to when creating the POP3 socket

isApopEnable

public Boolean isApopEnable()
Returns whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP.

If set to true, use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP. APOP sends a digest of the password rather than the clear text password. Defaults to false.


setApopEnable

public void setApopEnable(Boolean apopEnable)
Sets whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP.

If set to true, use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP. APOP sends a digest of the password rather than the clear text password. Defaults to false.

Parameters:
apopEnable - whether to use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP

getSocketFactoryClass

public String getSocketFactoryClass()
Returns the class that will be used to create POP3 sockets.

If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create POP3 sockets.


setSocketFactoryClass

public void setSocketFactoryClass(String socketFactoryClass)
Sets the class that will be used to create POP3 sockets.

If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create POP3 sockets.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
socketFactoryClass - the class that will be used to create POP3 sockets

isSocketFactoryFallback

public Boolean isSocketFactoryFallback()
Returns whether java.net.Socket class will be created if the specified socket factory class cannot be created.

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.


setSocketFactoryFallback

public void setSocketFactoryFallback(Boolean socketFactoryFallback)
Sets whether java.net.Socket class will be created if the specified socket factory class cannot be created.

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.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
socketFactoryFallback - whether java.net.Socket class will be created if the specified socket factory class cannot be created

getSocketFactoryPort

public Integer getSocketFactoryPort()
Returns the port to connect to when using the specified socket factory.

Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used.


setSocketFactoryPort

public void setSocketFactoryPort(Integer socketFactoryPort)
Sets the port to connect to when using the specified socket factory.

Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used.

Values that are set here will override any of the corresponding value that has been set in the properties.

Parameters:
socketFactoryPort - the port to connect to when using the specified socket factory

addOverrides

public void addOverrides(Properties props)
Add the overrides from the member variables to the properties file.

Overrides:
addOverrides in class ProtocolGBean

doStart

public void doStart()
             throws Exception
Description copied from interface: GBeanLifecycle
Starts the GBean. This informs the GBean that it is about to transition to the running state.

Specified by:
doStart in interface GBeanLifecycle
Overrides:
doStart in class ProtocolGBean
Throws:
Exception - if the target failed to start; this will cause a transition to the failed state

doStop

public void doStop()
            throws Exception
Description copied from interface: GBeanLifecycle
Stops the target. This informs the GBean that it is about to transition to the stopped state.

Specified by:
doStop in interface GBeanLifecycle
Overrides:
doStop in class ProtocolGBean
Throws:
Exception - if the target failed to stop; this will cause a transition to the failed state

doFail

public void doFail()
Description copied from interface: GBeanLifecycle
Fails the GBean. This informs the GBean that it is about to transition to the failed state.

Specified by:
doFail in interface GBeanLifecycle
Overrides:
doFail in class ProtocolGBean

getGBeanInfo

public static GBeanInfo getGBeanInfo()


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.