OOP Pop3Receiver Version 2.2

com.bentofw.popreceiver
Class Pop3Receiver

java.lang.Object
  extended by com.bentofw.popreceiver.Pop3Receiver

public final class Pop3Receiver
extends java.lang.Object

Connects to the POP3 server and calls MailReceiver.received(ReceivedMail,ConfigPerPop3) for each mail.

Pop3Receiver connects to the POP3 server and retrieves a series of incomming e-mails. For each incomming e-mail, this class creates the instance of ReceivedMail and calls:

Because ReceivedMail has a set of getXX methods, the implementation of MailReceiver interface can access the various parts of the incomming e-mail, such as the subject, TO address, FROM address and body text. In addtition, the body of the file attachment is also available in ReceivedMail along with the file name and Content-Type.

Author:
Jun Inamori

Method Summary
static Pop3Receiver getInstance()
          This method always returns the same instance of Pop3Receiver.
 void start()
          Start the background Thread, which connects to the POP3 servers at the specified time interval.
 void stop()
          Stop the background Thread, which connects to the POP3 servers at the specified time interval.
 boolean wasStarted()
          Returns true if the background Thread is running.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Pop3Receiver getInstance()
This method always returns the same instance of Pop3Receiver.

Returns:
Instance of Pop3Receiver.

start

public void start()
           throws SimpleException,
                  NestedException,
                  NoPropertyFileException
Start the background Thread, which connects to the POP3 servers at the specified time interval.

The background Thread connects to the POP3 server and retrieves a series of incomming e-mails. For each incomming e-mail, it creates the instance of ReceivedMail and calls: of this interface. Because ReceivedMail has a set of getXX methods, the implementation of MailReceiver interface can access the various parts of the incomming e-mail, such as the subject, TO address, FROM address and body text. In addtition, the body of the file attachment is also available in ReceivedMail along with the file name and Content-Type.

Throws:
SimpleException
NestedException
NoPropertyFileException
See Also:



stop

public void stop()
Stop the background Thread, which connects to the POP3 servers at the specified time interval.

If the background Thread is talking to the POP3 servers, or if it is working on the incomming e-mails, this method will wait untill the background Thread gives up its task. Note that the background Thread will give up its working task as soon as possible, even if it is working with the incomming e-mails. So this method will not wait for a long time.

See Also:
start()

wasStarted

public boolean wasStarted()
Returns true if the background Thread is running. Otherwise, false.

Returns:
True if the background Thread is running. Otherwise, false.
See Also:
start(),


OOP Pop3Receiver Version 2.2

ALL CONTENTS COPYRIGHT 2005, OOP-Research Corporation. All rights reserved.
Any questions and comments are welcome to OOP-Research Corporation.