Holger's Java API

## com.antelmann.net.mail
Class AccountReader

    java.lang.Object
      java.util.TimerTask
          com.antelmann.net.mail.AccountReader

All Implemented Interfaces:
  Task<IOException>, Runnable

    public class AccountReader

extends TimerTask
implements Task<IOException>

a Runnable utility class that processes and optionally deletes all emails from a given account

Since:
  6. Dezember 2006, 16:20
Author:
  Holger Antelmann

Constructor Summary
`AccountReader(POP3Account account, Handler<? super Email,? extends IOException> handler, boolean deleteMessages)`
`AccountReader(POP3Account account, Handler<? super Email,? extends IOException> handler, boolean deleteMessages, Monitor monitor)`
`AccountReader(POP3Account account, Handler<? super Email,? extends IOException> handler, boolean deleteMessages, Monitor monitor, Logger logger)`

Method Summary
`POP3Account` `getAccount()`
`Handler<? super Email,? extends IOException>` `getHandler()`
`Logger` `getLogger()`
`Monitor` `getMonitor()`
`boolean` `isDeleteMessages()`
`boolean` `isRunning()`
`void` `run()` calls runTask() and logs exceptions if any
`void` `runTask()` processes and and then removes all emails from the account
`void` `setDeleteMessages(boolean flag)`
`void` `setMonitor(Monitor monitor)`

Methods inherited from class java.util.TimerTask
`cancel, scheduledExecutionTime`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AccountReader

    public AccountReader(POP3Account account,
                         Handler<? super Email,? extends IOException> handler,
                         boolean deleteMessages)

### AccountReader

    public AccountReader(POP3Account account,
                         Handler<? super Email,? extends IOException> handler,
                         boolean deleteMessages,
                         Monitor monitor)

### AccountReader

    public AccountReader(POP3Account account,
                         Handler<? super Email,? extends IOException> handler,
                         boolean deleteMessages,
                         Monitor monitor,
                         Logger logger)

Method Detail

### isRunning

    public boolean isRunning()

### getAccount

    public POP3Account getAccount()

### getHandler

    public Handler<? super Email,? extends IOException> getHandler()

### setMonitor

    public void setMonitor(Monitor monitor)

### getMonitor

    public Monitor getMonitor()

### getLogger

    public Logger getLogger()

### isDeleteMessages

    public boolean isDeleteMessages()

### setDeleteMessages

    public void setDeleteMessages(boolean flag)

### runTask

    public void runTask()
                 throws IOException

  processes and and then removes all emails from the account

  Specified by:
    `runTask` in interface `Task<IOException>`
  Throws:
    `IOException`

### run

    public void run()

  calls runTask() and logs exceptions if any

  Specified by:
    `run` in interface `Runnable`
  Specified by:
    `run` in class `TimerTask`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads