All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.network.mail.pop3.protocol.CoreProtocolBean

java.lang.Object
   |
   +----com.ibm.network.mail.pop3.protocol.CoreProtocolBean

public class CoreProtocolBean
extends Object
implements Serializable
This bean implements the Post Office Protocol and interacts with the POP3 server to receive mails for the user. The user must have an account on the POP3 server. The received mails may either be deleted or left on the server. For POP3 servers outside a firewall, the bean provides support for connection via a socks server.

The received mails are passed on to a UserInterfaceBean which displays the mails. If the received message contains MIME data it would have to be decoded by a MimeDecoderBean before the mails can be viewed. The received mails can also be stored to a local file.

The CoreProtocolBean also allows configuration of user and server options. These options include POP3 and socks server host name and port number, user login name and other user options.

The bean also provides continuous status information to the UserInterfaceBean as it receives mails from the server. The status information conveys error conditions also, if any.

This bean throws the following events:

  1. MessageEvent to
  2. StatusEvent to

It supports the following event listener interfaces:

  1. RequestMessageListener which is called by:
  2. ConfigListener which is called by:

Author:
Mohit M Sant, Abdul Majeed Ghadialy
See Also:
MessageEvent, StatusEvent, RequestMessageListener, ConfigListener

Constructor Index

 o CoreProtocolBean()
Constructor for CoreProtocolBean.

Method Index

 o abort()
Aborts the operation of receiving messages.
 o addMessageListener(MessageListener)
Adds a listener for MessageEvent.
 o addPropertyChangeListener(PropertyChangeListener)
Adds the specified PropertyChangeListener for receiving PropertyChangeEvent from this bean.
 o addStatusListener(StatusListener)
Adds a listeners for StatusEvent.
 o getLoginId()
Returns login ID of user.
 o getMessage()
Returns the newly received message.
 o getPOP3ServerHost()
Returns the host name of the POP3 server.
 o getPOP3ServerPort()
Returns the port number of the POP3 server.
 o getSaveMessagesToFile()
Returns the name of file to which messages are being saved.
 o getSocksServerHost()
Returns the socks server host name.
 o getSocksServerPort()
Returns the port number of the socks server.
 o getStatus()
Returns the current status.
 o isLeaveMessagesOnServer()
Returns 'true' if messages are being left on server after receiving.
 o isReady()
Returns true if no operation is currently in progress.
 o isRememberPassword()
Returns 'true' if user login password is to be remembered.
 o isSaveIncomingMessages()
Returns true if messages are being saved to a local file.
 o isSocksified()
Returns 'true' if socks server is being used.
 o receiveMessage()
Receives new messages.
 o removeMessageListener(MessageListener)
Removes listener of MessageEvent.
 o removePropertyChangeListener(PropertyChangeListener)
Removes the specified PropertyChangeListener.
 o removeStatusListener(StatusListener)
Removes listeners of StatusEvent.
 o setConfigOptions(ConfigEvent)
Sets POP3, socks server and user settings.
 o setLeaveMessagesOnServer(boolean)
Indicates whether messages are to be left on POP3 server after receiving.
 o setLoginId(String)
Sets the POP3 login id of the user.
 o setPOP3Server(String, int)
Sets the POP server options.
 o setPOP3ServerHost(String)
Sets the host name/IP address of the POP3 server.
 o setPOP3ServerPort(int)
Sets port number of the POP3 server.
 o setRememberPassword(boolean)
Indicates whether user login password is to be remembered.
 o setSaveIncomingMessages(boolean)
Indicates whether incoming messages are to be saved to a local file.
 o setSaveMessagesToFile(String)
Sets file to which messages are to be saved.
 o setSocksified(boolean)
Indicates whether socks server is being used while receiving messages from POP3 server.
 o setSocksServer(String, int)
Sets socks server options.
 o setSocksServerHost(String)
Sets the host name/IP address of the socks server.
 o setSocksServerPort(int)
Sets the port number of the socks server.
 o setUserOptions(String, String, boolean, boolean)
Sets POP3 user options.
 o setUserPassword(String)
Sets the user login password.

Constructors

 o CoreProtocolBean
 public CoreProtocolBean()
Constructor for CoreProtocolBean.

Methods

 o abort
 public void abort()
Aborts the operation of receiving messages.

 o addMessageListener
 public void addMessageListener(MessageListener ml)
Adds a listener for MessageEvent. For adding the listeners which:

Parameters:
ml - com.ibm.network.mail.pop3.event.MessageListener.
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener listener)
Adds the specified PropertyChangeListener for receiving PropertyChangeEvent from this bean. Adds the specified property change listener to receive property change events about all the bound properties in this bean.

Note: This event is thrown for all the bound properties in this bean. Currently, it is thrown for the only bound property, Ready whenever the bean's ready status toggles.

Parameters:
listener - PropertyChangeListener.
 o addStatusListener
 public void addStatusListener(StatusListener sl)
Adds a listeners for StatusEvent. For adding the listeners which:

Parameters:
ml - com.ibm.network.mail.pop3.event.StatusListener.
 o getLoginId
 public String getLoginId()
Returns login ID of user.

Returns:
login ID of user.
See Also:
UserOptions
 o getMessage
 public MimeMessage getMessage()
Returns the newly received message.

Returns:
the newly received message.
See Also:
MimeMessage
 o getPOP3ServerHost
 public String getPOP3ServerHost()
Returns the host name of the POP3 server.

Returns:
POP3 server's host name/IP address.
See Also:
ServerOptions
 o getPOP3ServerPort
 public int getPOP3ServerPort()
Returns the port number of the POP3 server.

Returns:
POP3 server's port number.
See Also:
ServerOptions
 o getSaveMessagesToFile
 public String getSaveMessagesToFile()
Returns the name of file to which messages are being saved.

Returns:
the name of file used to store messages.
 o getSocksServerHost
 public String getSocksServerHost()
Returns the socks server host name.

Returns:
socks server's host name/IP address.
See Also:
ServerOptions
 o getSocksServerPort
 public int getSocksServerPort()
Returns the port number of the socks server.

Returns:
socks server's port number.
See Also:
ServerOptions
 o getStatus
 public String getStatus()
Returns the current status.

Returns:
status information.
 o isLeaveMessagesOnServer
 public boolean isLeaveMessagesOnServer()
Returns 'true' if messages are being left on server after receiving.

Returns:
true if messages are not deleted after receiving, false otherwise.
See Also:
UserOptions
 o isReady
 public boolean isReady()
Returns true if no operation is currently in progress. Only if "Ready", it can be requested to receive messages. This is a read-only bound property.

Returns:
true if bean is ready to receive new messages, false otherwise.
 o isRememberPassword
 public boolean isRememberPassword()
Returns 'true' if user login password is to be remembered. If so, user is not prompted for password at login.

Returns:
true if password of user is being remembered, false otherwise.
See Also:
UserOptions
 o isSaveIncomingMessages
 public boolean isSaveIncomingMessages()
Returns true if messages are being saved to a local file.

Returns:
true if messages are saved to a file, false otherwise.
 o isSocksified
 public boolean isSocksified()
Returns 'true' if socks server is being used. Socksification is required while receiving messages from POP3 server running outside a firewall.

Returns:
true if socksification has been applied, false otherwise.
See Also:
UserOptions
 o receiveMessage
 public void receiveMessage()
Receives new messages. This method is invoked by the UserInterfaceBean to receive new messages from the POP3 server.

See Also:
MimeMessage
 o removeMessageListener
 public void removeMessageListener(MessageListener ml)
Removes listener of MessageEvent. For removing the listeners which:

Parameters:
ml - com.ibm.network.mail.pop3.event.MessageListener.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified PropertyChangeListener. The listener may be any application interested in change of read-only bound property Ready.

Parameters:
cl - PropertyChangeListener to be removed.
 o removeStatusListener
 public void removeStatusListener(StatusListener sl)
Removes listeners of StatusEvent. For removing the listeners which:

Parameters:
ml - com.ibm.network.mail.pop3.event.StatusListener.
 o setConfigOptions
 public void setConfigOptions(ConfigEvent evt)
Sets POP3, socks server and user settings.

Parameters:
evt - ConfigEvent containing the options.
See Also:
ConfigEvent
 o setLeaveMessagesOnServer
 public void setLeaveMessagesOnServer(boolean b)
Indicates whether messages are to be left on POP3 server after receiving.

Parameters:
b - true if messages are to be left on server, false otherwise.
See Also:
UserOptions
 o setLoginId
 public void setLoginId(String id)
Sets the POP3 login id of the user.

Parameters:
id - login ID of user..
Throws: IllegalArgumentException
if POP3 Login name is null or blank.
See Also:
UserOptions
 o setPOP3Server
 public void setPOP3Server(String hostName,
                           int portNumber)
Sets the POP server options.

Parameters:
hostName - host name/IP address of POP3 server.
portNumber - of POP3 server.
 o setPOP3ServerHost
 public void setPOP3ServerHost(String server)
Sets the host name/IP address of the POP3 server.

Parameters:
server - POP3 server's host name/IP address.
Throws: IllegalArgumentException
if POP3 server name is null or blank.
See Also:
ServerOptions
 o setPOP3ServerPort
 public void setPOP3ServerPort(int port)
Sets port number of the POP3 server.

Parameters:
port - POP3 server's port number (default=110).
 o setRememberPassword
 public void setRememberPassword(boolean b)
Indicates whether user login password is to be remembered. If so, user is not prompted for password at login.

Parameters:
b - true if password of user is to be remembered, false otherwise.
See Also:
UserOptions
 o setSaveIncomingMessages
 public void setSaveIncomingMessages(boolean b)
Indicates whether incoming messages are to be saved to a local file.

Parameters:
b - true if messages are to be saved, false otherwise.
 o setSaveMessagesToFile
 public void setSaveMessagesToFile(String fileName)
Sets file to which messages are to be saved.

Parameters:
fileName - name of file to which messages will be saved.
Throws: IllegalArgumentException
if File name is null or blank.
 o setSocksified
 public void setSocksified(boolean b)
Indicates whether socks server is being used while receiving messages from POP3 server.

Parameters:
b - true if socksification is to be applied.
See Also:
ServerOptions
 o setSocksServer
 public void setSocksServer(String hostName,
                            int portNumber)
Sets socks server options.

Parameters:
hostName - socks server host name/IP address.
portNumber - port number of socks server.
See Also:
ServerOptions
 o setSocksServerHost
 public void setSocksServerHost(String server)
Sets the host name/IP address of the socks server.

Parameters:
server - socks server's host name/IP address.
Throws: IllegalArgumentException
if socks host name is null or blank.
See Also:
ServerOptions
 o setSocksServerPort
 public void setSocksServerPort(int port)
Sets the port number of the socks server.

Parameters:
port - socks server's port number.
Throws: IllegalArgumentException
if socks port is < 1.
See Also:
ServerOptions
 o setUserOptions
 public void setUserOptions(String popLoginName,
                            String password,
                            boolean leaveMessagesOnServer,
                            boolean rememberPassword)
Sets POP3 user options.

Parameters:
popLoginName - login name of user.
password - login password.
leaveMessagesOnServer - true if messages are to be left on server, false otherwise.
rememberPassword - whether user login password is to be remembered, false otherwise.
Throws: IllegalArgumentException
if POP3 login name/password is null or blank.
See Also:
UserOptions
 o setUserPassword
 public void setUserPassword(String password)
Sets the user login password.

Parameters:
password - password of user.
Throws: IllegalArgumentException
if user password is null.

All Packages  Class Hierarchy  This Package  Previous  Next  Index