{short description of image}

Description

POP3 CoreProtocolBean

This bean provides POP3 CoreProtocolBean client services. These include user authentication, receiving messages and deleting messages from a POP3 server.

The bean listens for commands from a bean which implements the user interface. Commands can be passed to this bean either wrapped as a RequestMessageEvent object or by calling the receiveMessage method after configuring the POP3 server and socks server hosts.

The bean also listens for configuration event (ConfigEvent). It receives information about the bean configuration, including the POP3 server host and port number, socks server host and port number, and user information through this event. This information can also be set at the CoreProtocolBean using API methods setPOP3Server, setSocksServer, setUserOptions etc.

The bean fires the StatusEvent containing relevant data about the status of the request for receiving messages. This is captured by the UserInterfaceBean, and the status contained is displayed to the user.

The bean also fires a MessageEvent which contains the messages received from the POP3 server. The user interface captures this event, and displays the received message to the user.

Significant events

The bean fires the following events, which a user interface component would need to capture :

Significant methods

The POP3 CoreProtocolBean implements the following significant methods:

  1. Adding / removing listeners for events (described above) fired by this class:
  2. Methods that service external events
  3. Methods that provide requested service
  4. Methods that set / query the state of the CoreProtocolBean :
    {short description of image}Note : The parameters to the setter methods should not be 'null' or 'empty' in case of a string. Doing so will result in throwing of IllegalArgumentException
  5. Methods used to configure the system
  6. Methods that may be used by the application to issue commands to the CoreProtocolBean. The application menu or toolbar would provide the interface to call these methods.

Customization

The following attributes of the POP3 CoreProtocolBean can be customized.


{short description of image} POP3 UserInterfaceBean

The UserInterfaceBean implements a user interface to view the received messages. It provides a mechanism for interacting with the CoreProtocolBean for making a connection to a POP3 server and receiving mails.Once the messages are received, the message header which contains the message subject, sender's name, and date are shown as a list.

The UserInterfaceBean passes configuration information about the POP3 server, socks server and user details by throwing the ConfigEvent whenever the user modifies this data. This is caught by the CoreProtocolBean and used in making connections to a POP3 server.

The UserInterfaceBean requests the CoreProtocolBean to retrieve the messages from the configured server by throwing a RequestMessageEvent

While the CoreProtocolBean is making a connection to the POP3 server or while retrieving the messages, the status information received is bundled and fired as a StatusEvent by the CoreProtocolBean. This status event is captured by the UserInterfaceBean and displayed to the user.

Once the messages are received, the message header which contains the message subject, sender's name and date, are shown as a list. The user may choose to view any of the messages shown in the list. On user request to view a message, the UserInterfaceBean analyses the contents to determine which of the message parts can be rendered by it. These are the parts which contain plain text. For each such part, the UserInterfaceBean fires DecodeMessageEvent containing the part to be decoded. Other parts like attachments are not requested to be decoded at this point in order to optimize the performance, as decoding large attachments is a time consuming process and it is possible that a user may not want all the body parts to be decoded.

When the decoder bean completes decoding the requested data, it throws a DecodeEvent which is captured by the UserInterfaceBean, and the UserInterfaceBean displays the decoded data in the Message Text Area and attachments, if any, in the Attachments Panel. The user may choose to detach ( save in a file) any of the attachments. When the user chooses to detach any of the attachment(s), the UserInterfaceBean requests the decoder bean to decode the relevant body part by throwing DecodeMessageEvent. When the decoder bean completes decoding the body part, it throws a DecodeEvent which is caught by the UserInterfaceBean and the decoded part is saved to the given filename.

Significant Events

RequestMessageEvent - This event is fired to the CoreProtocolBean. This requests the CoreProtocolBean to retrieve messages from the POP3 server.

DecodeMessageEvent - It is fired to the decoder bean to request decoding of a part of a message.

ConfigEvent - This event is fired to the CoreProtocolBean to configure the POP3 and socks servers' hostname and port numbers to be used, and the user's ID and password for the given POP3 server.

Significant Methods

  1. Methods to add / remove listeners for the events fired by the bean
  2. Methods that listen to events from the MimeDecoder / CoreProtocol beans
  3. Methods that may be used by the application container to set/query message items.This list is a representative sample :
    {short description of image}Note : The parameters to the setter methods should not be 'null' or 'empty' in case of a string. Doing so will result in throwing of IllegalArgumentException
  4. Methods that may be used by the application to issue commands to the UserInterfaceBean, an application menu or toolbar would typically provide the interface to these methods :

The following attributes of the POP3 UserInterfaceBean can be customized :

Customization


{short description of image} POP3 MimeDecoderBean

This bean decodes a MimeMessage. At present it is minimal Mime compliant (as defined in RFC 1521). The bean supports "base 64" and "7 bit" encoding.

The bean listens to commands from the bean which implements the user interface. Commands can be passed to this bean either wrapped as a DecodeMessageEvent object or by calling the decodeBodyPart method with an object of type Decodable, both of which process the desired request. It listens for DecodeMessageEvent from the UserInterfaceBean by implementing the decodeBodyPart method which accepts a DecodeMessageEvent.

This bean fires theDecodeEvent to notify completion of decoding of a part of a MIME message. The bean can also decode a complete message or any MIME data input stream.

Significant Events

  1. The bean fires the following event, which a user interface component would need to capture:

Significant Methods

The POP3 MimeDecoderBean implements the following significant methods :

  1. Adding / removing listeners for DecodeEvent fired by this bean:
  2. Methods that accept external events
  3. Methods that may be used to request services as an alternate mechanism to using events

Customization

This bean contains no customizable properties.


Refer to the section Usage Scenarios for information on how to use the POP3 suite of beans in different ways.